From d3df61e354ba0a8c6a4a0a528ab0753ac68db9fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:43:01 -0700 Subject: [PATCH 1/8] Bump google-protobuf from 4.27.3 to 4.27.5 in /website in the bundler group across 1 directory (#4325) Bumps the bundler group with 1 update in the /website directory: [google-protobuf](https://github.com/protocolbuffers/protobuf). Updates `google-protobuf` from 4.27.3 to 4.27.5
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google-protobuf&package-manager=bundler&previous-version=4.27.3&new-version=4.27.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/carbon-language/carbon-lang/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/Gemfile.lock b/website/Gemfile.lock index 0fdac16ce9da3..725a6529b381d 100644 --- a/website/Gemfile.lock +++ b/website/Gemfile.lock @@ -12,10 +12,10 @@ GEM eventmachine (1.2.7) ffi (1.17.0) forwardable-extended (2.6.0) - google-protobuf (4.27.3-arm64-darwin) + google-protobuf (4.27.5-arm64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.27.3-x86_64-linux) + google-protobuf (4.27.5-x86_64-linux) bigdecimal rake (>= 13) http_parser.rb (0.8.0) From 20443666525942717a99a09c07188825ef56d186 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 19 Sep 2024 12:18:32 -0700 Subject: [PATCH 2/8] Support initialization of specific classes from struct literals (#4320) Add support for initializing types like `GenericClass(i32)` from a struct literal. A new kind of instruction, `complete_type_witness`, is added to the class definition to track the object representation type so that it's visible to the generics machinery. Accesses to the object representation of a class have all been updated to pass in the class's `SpecificId` so that the types of the fields of the specific class are used instead of the types of the fields of the generic class in places that look at the object representation -- primarily class initialization. --- toolchain/check/context.cpp | 14 +- toolchain/check/convert.cpp | 35 +- toolchain/check/eval.cpp | 3 + toolchain/check/handle_class.cpp | 120 ++++-- toolchain/check/import_ref.cpp | 34 +- .../alias/no_prelude/alias_of_alias.carbon | 7 +- .../alias/no_prelude/export_name.carbon | 41 +- .../fail_aliased_name_in_diag.carbon | 9 +- .../alias/no_prelude/fail_modifiers.carbon | 3 + .../no_prelude/fail_name_conflict.carbon | 7 +- .../testdata/alias/no_prelude/import.carbon | 39 +- .../alias/no_prelude/import_access.carbon | 10 +- .../alias/no_prelude/import_order.carbon | 23 +- .../alias/no_prelude/in_namespace.carbon | 4 +- .../testdata/as/adapter_conversion.carbon | 136 +++--- toolchain/check/testdata/as/identity.carbon | 25 +- .../check/testdata/as/no_prelude/tuple.carbon | 49 +-- toolchain/check/testdata/as/overloaded.carbon | 98 ++--- .../check/testdata/builtins/float/eq.carbon | 35 +- .../testdata/builtins/float/greater.carbon | 81 ++-- .../testdata/builtins/float/greater_eq.carbon | 81 ++-- .../check/testdata/builtins/float/less.carbon | 81 ++-- .../testdata/builtins/float/less_eq.carbon | 81 ++-- .../check/testdata/builtins/float/neq.carbon | 35 +- .../check/testdata/builtins/int/eq.carbon | 35 +- .../testdata/builtins/int/greater.carbon | 81 ++-- .../testdata/builtins/int/greater_eq.carbon | 81 ++-- .../check/testdata/builtins/int/less.carbon | 81 ++-- .../testdata/builtins/int/less_eq.carbon | 81 ++-- .../check/testdata/builtins/int/neq.carbon | 35 +- .../testdata/class/access_modifers.carbon | 32 +- toolchain/check/testdata/class/adapt.carbon | 13 +- toolchain/check/testdata/class/base.carbon | 66 +-- .../check/testdata/class/base_field.carbon | 44 +- .../class/base_function_unqualified.carbon | 12 +- .../check/testdata/class/base_method.carbon | 34 +- .../class/base_method_qualified.carbon | 38 +- .../testdata/class/base_method_shadow.carbon | 95 +++-- toolchain/check/testdata/class/basic.carbon | 8 +- .../class/complete_in_member_fn.carbon | 4 +- .../testdata/class/compound_field.carbon | 64 +-- .../class/cross_package_import.carbon | 18 +- .../testdata/class/derived_to_base.carbon | 148 +++---- .../check/testdata/class/extend_adapt.carbon | 116 +++--- .../check/testdata/class/fail_abstract.carbon | 58 +-- .../testdata/class/fail_adapt_bad_decl.carbon | 7 + .../testdata/class/fail_adapt_bad_type.carbon | 1 + .../class/fail_adapt_modifiers.carbon | 13 +- .../class/fail_adapt_with_subobjects.carbon | 26 +- .../testdata/class/fail_addr_not_self.carbon | 2 + .../testdata/class/fail_addr_self.carbon | 52 +-- .../testdata/class/fail_base_bad_type.carbon | 391 +++++++++--------- .../class/fail_base_method_define.carbon | 17 +- .../testdata/class/fail_base_misplaced.carbon | 5 +- .../testdata/class/fail_base_modifiers.carbon | 30 +- .../testdata/class/fail_base_no_extend.carbon | 15 +- .../testdata/class/fail_base_repeated.carbon | 22 +- .../testdata/class/fail_base_unbound.carbon | 21 +- .../class/fail_compound_type_mismatch.carbon | 64 +-- .../class/fail_convert_to_invalid.carbon | 1 + .../class/fail_derived_to_base.carbon | 145 +++---- .../testdata/class/fail_extend_cycle.carbon | 26 +- .../class/fail_field_modifiers.carbon | 2 + .../testdata/class/fail_generic_method.carbon | 8 +- .../testdata/class/fail_import_misuses.carbon | 14 +- .../check/testdata/class/fail_init.carbon | 36 +- .../class/fail_init_as_inplace.carbon | 30 +- .../class/fail_memaccess_category.carbon | 28 +- .../testdata/class/fail_member_of_let.carbon | 6 +- .../check/testdata/class/fail_method.carbon | 4 +- .../class/fail_method_modifiers.carbon | 4 + .../class/fail_method_redefinition.carbon | 2 + .../testdata/class/fail_modifiers.carbon | 7 + .../class/fail_out_of_line_decl.carbon | 5 +- .../fail_redeclaration_introducer.carbon | 18 + .../class/fail_redeclaration_scope.carbon | 15 +- .../testdata/class/fail_redefinition.carbon | 9 +- .../check/testdata/class/fail_scope.carbon | 6 +- .../check/testdata/class/fail_self.carbon | 53 +-- .../class/fail_self_type_member.carbon | 8 +- .../class/fail_todo_local_class.carbon | 2 + .../testdata/class/fail_unbound_field.carbon | 4 +- .../testdata/class/fail_unknown_member.carbon | 4 +- .../check/testdata/class/field_access.carbon | 12 +- .../class/field_access_in_value.carbon | 12 +- .../check/testdata/class/generic/basic.carbon | 8 +- .../check/testdata/class/generic/call.carbon | 121 +++--- .../check/testdata/class/generic/field.carbon | 32 +- .../testdata/class/generic/import.carbon | 140 ++++--- .../check/testdata/class/generic/init.carbon | 367 ++++++++-------- .../class/generic/member_access.carbon | 103 +++-- .../class/generic/member_inline.carbon | 10 +- .../class/generic/member_out_of_line.carbon | 37 +- .../class/generic/method_deduce.carbon | 72 ++-- .../testdata/class/generic/redeclare.carbon | 18 + .../check/testdata/class/generic/self.carbon | 4 +- .../testdata/class/generic_method.carbon | 8 +- toolchain/check/testdata/class/import.carbon | 96 +++-- .../check/testdata/class/import_base.carbon | 58 +-- .../testdata/class/import_forward_decl.carbon | 3 + .../testdata/class/import_indirect.carbon | 133 +++--- .../testdata/class/import_member_cycle.carbon | 3 + .../testdata/class/import_struct_cyle.carbon | 11 +- .../testdata/class/inheritance_access.carbon | 181 ++++---- toolchain/check/testdata/class/init.carbon | 8 +- .../check/testdata/class/init_adapt.carbon | 118 +++--- toolchain/check/testdata/class/init_as.carbon | 18 +- .../check/testdata/class/init_nested.carbon | 22 +- toolchain/check/testdata/class/method.carbon | 12 +- toolchain/check/testdata/class/nested.carbon | 34 +- .../check/testdata/class/nested_name.carbon | 10 +- .../class/no_prelude/export_name.carbon | 13 +- .../testdata/class/no_prelude/extern.carbon | 13 + .../class/no_prelude/generic_vs_params.carbon | 24 +- .../class/no_prelude/implicit_import.carbon | 22 +- .../class/no_prelude/import_access.carbon | 22 +- .../no_prelude/indirect_import_member.carbon | 52 ++- .../no_definition_in_impl_file.carbon | 3 + .../class/no_prelude/syntactic_merge.carbon | 162 +++++--- .../check/testdata/class/raw_self.carbon | 6 +- .../check/testdata/class/raw_self_type.carbon | 25 +- .../check/testdata/class/redeclaration.carbon | 4 +- .../class/redeclaration_introducer.carbon | 7 + .../check/testdata/class/reenter_scope.carbon | 4 +- toolchain/check/testdata/class/reorder.carbon | 8 +- .../testdata/class/reorder_qualified.carbon | 72 ++-- toolchain/check/testdata/class/scope.carbon | 12 +- toolchain/check/testdata/class/self.carbon | 4 +- .../testdata/class/self_conversion.carbon | 62 +-- .../check/testdata/class/self_type.carbon | 4 +- .../check/testdata/class/static_method.carbon | 4 +- .../class/syntactic_merge_literal.carbon | 50 ++- .../class/todo_access_modifiers.carbon | 2 + .../testdata/class/virtual_modifiers.carbon | 3 + .../declaration/no_prelude/extern.carbon | 2 + .../fail_import_incomplete_return.carbon | 6 +- .../no_prelude/syntactic_merge.carbon | 131 +++--- .../testdata/function/generic/deduce.carbon | 25 +- .../function/generic/no_prelude/call.carbon | 10 +- .../function/generic/return_slot.carbon | 26 +- .../check/testdata/global/class_obj.carbon | 7 +- .../testdata/global/class_with_fun.carbon | 7 +- .../if_expr/fail_not_in_function.carbon | 1 + .../check/testdata/impl/extend_impl.carbon | 4 +- .../impl/fail_extend_impl_forall.carbon | 2 + .../impl/fail_extend_impl_type_as.carbon | 4 + .../impl/fail_extend_non_interface.carbon | 2 + ..._extend_partially_defined_interface.carbon | 2 + .../fail_extend_undefined_interface.carbon | 2 + .../impl/fail_impl_bad_assoc_fn.carbon | 216 +++++----- toolchain/check/testdata/impl/impl_as.carbon | 4 +- .../check/testdata/impl/lookup/alias.carbon | 8 +- .../lookup/fail_alias_impl_not_found.carbon | 4 +- .../lookup/fail_todo_undefined_impl.carbon | 8 +- .../check/testdata/impl/lookup/import.carbon | 38 +- .../impl/lookup/instance_method.carbon | 4 +- .../impl/lookup/no_prelude/import.carbon | 38 +- .../testdata/impl/no_prelude/basic.carbon | 7 +- .../impl/no_prelude/interface_args.carbon | 322 ++++++++------- .../impl/no_prelude/self_in_class.carbon | 10 +- .../impl/no_prelude/self_in_signature.carbon | 139 ++++--- .../check/testdata/impl/redeclaration.carbon | 6 +- ..._todo_define_default_fn_out_of_line.carbon | 4 +- .../interface/no_prelude/default_fn.carbon | 4 +- .../interface/no_prelude/generic.carbon | 129 +++--- .../no_prelude/generic_import.carbon | 45 +- .../no_prelude/generic_vs_params.carbon | 34 +- .../no_prelude/syntactic_merge.carbon | 242 ++++++----- .../merging_with_indirections.carbon | 17 +- .../testdata/operators/overloaded/add.carbon | 95 ++--- .../operators/overloaded/bit_and.carbon | 95 ++--- .../overloaded/bit_complement.carbon | 33 +- .../operators/overloaded/bit_or.carbon | 95 ++--- .../operators/overloaded/bit_xor.carbon | 95 ++--- .../testdata/operators/overloaded/dec.carbon | 59 +-- .../testdata/operators/overloaded/div.carbon | 95 ++--- .../testdata/operators/overloaded/eq.carbon | 177 ++++---- .../overloaded/fail_assign_non_ref.carbon | 105 ++--- .../operators/overloaded/fail_no_impl.carbon | 95 ++--- .../overloaded/fail_no_impl_for_arg.carbon | 141 ++++--- .../operators/overloaded/implicit_as.carbon | 90 ++-- .../testdata/operators/overloaded/inc.carbon | 59 +-- .../operators/overloaded/left_shift.carbon | 95 ++--- .../testdata/operators/overloaded/mod.carbon | 95 ++--- .../testdata/operators/overloaded/mul.carbon | 95 ++--- .../operators/overloaded/negate.carbon | 33 +- .../operators/overloaded/ordered.carbon | 130 +++--- .../operators/overloaded/right_shift.carbon | 95 ++--- .../testdata/operators/overloaded/sub.carbon | 95 ++--- .../check/testdata/package_expr/syntax.carbon | 4 +- .../no_prelude/cross_package_export.carbon | 63 +-- .../packages/no_prelude/export_import.carbon | 37 +- .../packages/no_prelude/export_mixed.carbon | 80 ++-- .../packages/no_prelude/export_name.carbon | 179 ++++---- .../no_prelude/fail_export_name_member.carbon | 3 + .../implicit_imports_entities.carbon | 43 +- .../no_prelude/missing_prelude.carbon | 2 + toolchain/check/testdata/pointer/arrow.carbon | 4 +- .../fail_return_with_returned_var.carbon | 12 +- .../check/testdata/return/returned_var.carbon | 22 +- toolchain/check/testdata/struct/import.carbon | 160 +++---- toolchain/check/testdata/tuple/import.carbon | 136 +++--- .../testdata/var/fail_not_copyable.carbon | 13 +- .../no_prelude/fail_designator.carbon | 4 +- toolchain/lower/constant.cpp | 6 + toolchain/lower/file_context.cpp | 6 +- toolchain/lower/handle_aggregates.cpp | 15 +- toolchain/sem_ir/BUILD | 1 + toolchain/sem_ir/class.cpp | 28 ++ toolchain/sem_ir/class.h | 17 +- toolchain/sem_ir/file.cpp | 2 + toolchain/sem_ir/generic.cpp | 13 +- toolchain/sem_ir/inst_kind.def | 1 + toolchain/sem_ir/typed_insts.h | 20 + 214 files changed, 5557 insertions(+), 4223 deletions(-) create mode 100644 toolchain/sem_ir/class.cpp diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index bba09498eb57c..fc77e2c582cc0 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -27,6 +27,7 @@ #include "toolchain/sem_ir/builtin_inst_kind.h" #include "toolchain/sem_ir/file.h" #include "toolchain/sem_ir/formatter.h" +#include "toolchain/sem_ir/generic.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/import_ir.h" #include "toolchain/sem_ir/inst.h" @@ -873,7 +874,7 @@ class TypeCompleter { if (inst.specific_id.is_valid()) { ResolveSpecificDefinition(context_, inst.specific_id); } - Push(class_info.object_repr_id); + Push(class_info.GetObjectRepr(context_.sem_ir(), inst.specific_id)); break; } case CARBON_KIND(SemIR::ConstType inst): { @@ -1051,14 +1052,19 @@ class TypeCompleter { // The value representation of an adapter is the value representation of // its adapted type. if (class_info.adapt_id.is_valid()) { - return GetNestedValueRepr(class_info.object_repr_id); + return GetNestedValueRepr(SemIR::GetTypeInSpecific( + context_.sem_ir(), inst.specific_id, + context_.insts() + .GetAs(class_info.adapt_id) + .adapted_type_id)); } // Otherwise, the value representation for a class is a pointer to the // object representation. // TODO: Support customized value representations for classes. // TODO: Pick a better value representation when possible. - return MakePointerValueRepr(class_info.object_repr_id, - SemIR::ValueRepr::ObjectAggregate); + return MakePointerValueRepr( + class_info.GetObjectRepr(context_.sem_ir(), inst.specific_id), + SemIR::ValueRepr::ObjectAggregate); } template diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index d5908d273ca66..62da182ac013f 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -532,8 +532,8 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, SemIR::InstId value_id, ConversionTarget target) -> SemIR::InstId { PendingBlock target_block(context); - auto& class_info = context.classes().Get(dest_type.class_id); - if (class_info.inheritance_kind == SemIR::Class::Abstract) { + auto& dest_class_info = context.classes().Get(dest_type.class_id); + if (dest_class_info.inheritance_kind == SemIR::Class::Abstract) { CARBON_DIAGNOSTIC(ConstructionOfAbstractClass, Error, "Cannot construct instance of abstract class. " "Consider using `partial {0}` instead.", @@ -542,11 +542,13 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, target.type_id); return SemIR::InstId::BuiltinError; } - if (class_info.object_repr_id == SemIR::TypeId::Error) { + auto object_repr_id = + dest_class_info.GetObjectRepr(context.sem_ir(), dest_type.specific_id); + if (object_repr_id == SemIR::TypeId::Error) { return SemIR::InstId::BuiltinError; } auto dest_struct_type = - context.types().GetAs(class_info.object_repr_id); + context.types().GetAs(object_repr_id); // If we're trying to create a class value, form a temporary for the value to // point to. @@ -571,9 +573,10 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, return result_id; } -// An inheritance path is a sequence of `BaseDecl`s in order from derived to -// base. -using InheritancePath = llvm::SmallVector; +// An inheritance path is a sequence of `BaseDecl`s and corresponding base types +// in order from derived to base. +using InheritancePath = + llvm::SmallVector>; // Computes the inheritance path from class `derived_id` to class `base_id`. // Returns nullopt if `derived_id` is not a class derived from `base_id`. @@ -602,10 +605,13 @@ static auto ComputeInheritancePath(Context& context, SemIR::TypeId derived_id, result = std::nullopt; break; } - result->push_back(derived_class.base_id); - derived_id = context.insts() - .GetAs(derived_class.base_id) - .base_type_id; + auto base_decl = + context.insts().GetAs(derived_class.base_id); + auto base_type_id = SemIR::GetTypeInSpecific( + context.sem_ir(), derived_class_type->specific_id, + base_decl.base_type_id); + result->push_back({derived_class.base_id, base_type_id}); + derived_id = base_type_id; } return result; } @@ -619,10 +625,10 @@ static auto ConvertDerivedToBase(Context& context, SemIR::LocId loc_id, value_id = ConvertToValueOrRefExpr(context, value_id); // Add a series of `.base` accesses. - for (auto base_id : path) { + for (auto [base_id, base_type_id] : path) { auto base_decl = context.insts().GetAs(base_id); value_id = context.AddInst( - loc_id, {.type_id = base_decl.base_type_id, + loc_id, {.type_id = base_type_id, .base_id = value_id, .index = base_decl.index}); } @@ -677,7 +683,8 @@ static auto GetCompatibleBaseType(Context& context, SemIR::TypeId type_id) if (auto class_type = context.types().TryGetAs(type_id)) { auto& class_info = context.classes().Get(class_type->class_id); if (class_info.adapt_id.is_valid()) { - return class_info.object_repr_id; + return class_info.GetObjectRepr(context.sem_ir(), + class_type->specific_id); } } diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index 3fe78ad7ddfa4..c53d4afc33e58 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -1166,6 +1166,9 @@ auto TryEvalInstInContext(EvalContext& eval_context, SemIR::InstId inst_id, case SemIR::ClassType::Kind: return RebuildIfFieldsAreConstant(eval_context, inst, &SemIR::ClassType::specific_id); + case SemIR::CompleteTypeWitness::Kind: + return RebuildIfFieldsAreConstant( + eval_context, inst, &SemIR::CompleteTypeWitness::object_repr_id); case SemIR::FunctionType::Kind: return RebuildIfFieldsAreConstant(eval_context, inst, &SemIR::FunctionType::specific_id); diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index 32f4fbb4ac45a..ee0c6dbcb64bc 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -94,7 +94,7 @@ static auto MergeClassRedecl(Context& context, SemIRLoc new_loc, prev_class.body_block_id = new_class.body_block_id; prev_class.adapt_id = new_class.adapt_id; prev_class.base_id = new_class.base_id; - prev_class.object_repr_id = new_class.object_repr_id; + prev_class.complete_type_witness_id = new_class.complete_type_witness_id; } if ((prev_import_ir_id.is_valid() && !new_is_import) || @@ -561,55 +561,89 @@ auto HandleParseNode(Context& context, Parse::BaseDeclId node_id) -> bool { return true; } -auto HandleParseNode(Context& context, Parse::ClassDefinitionId /*node_id*/) +// Checks that the specified finished adapter definition is valid and builds and +// returns a corresponding complete type witness instruction. +static auto CheckCompleteAdapterClassType(Context& context, + Parse::NodeId node_id, + SemIR::ClassId class_id, + SemIR::InstBlockId fields_id) + -> SemIR::InstId { + const auto& class_info = context.classes().Get(class_id); + if (class_info.base_id.is_valid()) { + CARBON_DIAGNOSTIC(AdaptWithBase, Error, + "Adapter cannot have a base class."); + CARBON_DIAGNOSTIC(AdaptBaseHere, Note, "`base` declaration is here."); + context.emitter() + .Build(class_info.adapt_id, AdaptWithBase) + .Note(class_info.base_id, AdaptBaseHere) + .Emit(); + return SemIR::InstId::BuiltinError; + } + + if (!context.inst_blocks().Get(fields_id).empty()) { + auto first_field_id = context.inst_blocks().Get(fields_id).front(); + CARBON_DIAGNOSTIC(AdaptWithFields, Error, "Adapter cannot have fields."); + CARBON_DIAGNOSTIC(AdaptFieldHere, Note, "First field declaration is here."); + context.emitter() + .Build(class_info.adapt_id, AdaptWithFields) + .Note(first_field_id, AdaptFieldHere) + .Emit(); + return SemIR::InstId::BuiltinError; + } + + // The object representation of the adapter is the object representation + // of the adapted type. This is the adapted type itself unless it's a class + // type. + // + // TODO: The object representation of `const T` should also be the object + // representation of `T`. + auto adapted_type_id = context.insts() + .GetAs(class_info.adapt_id) + .adapted_type_id; + if (auto adapted_class = + context.types().TryGetAs(adapted_type_id)) { + auto& adapted_class_info = context.classes().Get(adapted_class->class_id); + if (adapted_class_info.adapt_id.is_valid()) { + return adapted_class_info.complete_type_witness_id; + } + } + + return context.AddInst( + node_id, + {.type_id = context.GetBuiltinType(SemIR::BuiltinInstKind::WitnessType), + .object_repr_id = adapted_type_id}); +} + +// Checks that the specified finished class definition is valid and builds and +// returns a corresponding complete type witness instruction. +static auto CheckCompleteClassType(Context& context, Parse::NodeId node_id, + SemIR::ClassId class_id, + SemIR::InstBlockId fields_id) + -> SemIR::InstId { + auto& class_info = context.classes().Get(class_id); + if (class_info.adapt_id.is_valid()) { + return CheckCompleteAdapterClassType(context, node_id, class_id, fields_id); + } + + return context.AddInst( + node_id, + {.type_id = context.GetBuiltinType(SemIR::BuiltinInstKind::WitnessType), + .object_repr_id = context.GetStructType(fields_id)}); +} + +auto HandleParseNode(Context& context, Parse::ClassDefinitionId node_id) -> bool { auto fields_id = context.args_type_info_stack().Pop(); auto class_id = context.node_stack().Pop(); - context.inst_block_stack().Pop(); // The class type is now fully defined. Compute its object representation. + auto complete_type_witness_id = + CheckCompleteClassType(context, node_id, class_id, fields_id); auto& class_info = context.classes().Get(class_id); - if (class_info.adapt_id.is_valid()) { - class_info.object_repr_id = SemIR::TypeId::Error; - if (class_info.base_id.is_valid()) { - CARBON_DIAGNOSTIC(AdaptWithBase, Error, - "Adapter cannot have a base class."); - CARBON_DIAGNOSTIC(AdaptBaseHere, Note, "`base` declaration is here."); - context.emitter() - .Build(class_info.adapt_id, AdaptWithBase) - .Note(class_info.base_id, AdaptBaseHere) - .Emit(); - } else if (!context.inst_blocks().Get(fields_id).empty()) { - auto first_field_id = context.inst_blocks().Get(fields_id).front(); - CARBON_DIAGNOSTIC(AdaptWithFields, Error, "Adapter cannot have fields."); - CARBON_DIAGNOSTIC(AdaptFieldHere, Note, - "First field declaration is here."); - context.emitter() - .Build(class_info.adapt_id, AdaptWithFields) - .Note(first_field_id, AdaptFieldHere) - .Emit(); - } else { - // The object representation of the adapter is the object representation - // of the adapted type. - auto adapted_type_id = context.insts() - .GetAs(class_info.adapt_id) - .adapted_type_id; - // If we adapt an adapter, directly track the non-adapter type we're - // adapting so that we have constant-time access to it. - if (auto adapted_class = - context.types().TryGetAs(adapted_type_id)) { - auto& adapted_class_info = - context.classes().Get(adapted_class->class_id); - if (adapted_class_info.adapt_id.is_valid()) { - adapted_type_id = adapted_class_info.object_repr_id; - } - } - class_info.object_repr_id = adapted_type_id; - } - } else { - class_info.object_repr_id = context.GetStructType(fields_id); - } + class_info.complete_type_witness_id = complete_type_witness_id; + + context.inst_block_stack().Pop(); FinishGenericDefinition(context, class_info.generic_id); diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index aa0d334f58ade..952e75d1eab20 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -16,6 +16,7 @@ #include "toolchain/sem_ir/import_ir.h" #include "toolchain/sem_ir/inst.h" #include "toolchain/sem_ir/inst_kind.h" +#include "toolchain/sem_ir/type_info.h" #include "toolchain/sem_ir/typed_insts.h" namespace Carbon::Check { @@ -1011,6 +1012,9 @@ class ImportRefResolver { case CARBON_KIND(SemIR::ClassType inst): { return TryResolveTypedInst(inst); } + case CARBON_KIND(SemIR::CompleteTypeWitness inst): { + return TryResolveTypedInst(inst); + } case CARBON_KIND(SemIR::ConstType inst): { return TryResolveTypedInst(inst); } @@ -1228,12 +1232,11 @@ class ImportRefResolver { // Fills out the class definition for an incomplete class. auto AddClassDefinition(const SemIR::Class& import_class, SemIR::Class& new_class, - SemIR::ConstantId object_repr_const_id, + SemIR::InstId complete_type_witness_id, SemIR::InstId base_id) -> void { new_class.definition_id = new_class.first_owning_decl_id; - new_class.object_repr_id = - context_.GetTypeIdForTypeConstant(object_repr_const_id); + new_class.complete_type_witness_id = complete_type_witness_id; new_class.scope_id = context_.name_scopes().Add( new_class.first_owning_decl_id, SemIR::NameId::Invalid, @@ -1312,10 +1315,10 @@ class ImportRefResolver { auto param_const_ids = GetLocalParamConstantIds(import_class.param_refs_id); auto generic_data = GetLocalGenericData(import_class.generic_id); auto self_const_id = GetLocalConstantId(import_class.self_type_id); - auto object_repr_const_id = - import_class.object_repr_id.is_valid() - ? GetLocalConstantId(import_class.object_repr_id) - : SemIR::ConstantId::Invalid; + auto complete_type_witness_id = + import_class.complete_type_witness_id.is_valid() + ? GetLocalConstantInstId(import_class.complete_type_witness_id) + : SemIR::InstId::Invalid; auto base_id = import_class.base_id.is_valid() ? GetLocalConstantInstId(import_class.base_id) : SemIR::InstId::Invalid; @@ -1334,7 +1337,7 @@ class ImportRefResolver { new_class.self_type_id = context_.GetTypeIdForTypeConstant(self_const_id); if (import_class.is_defined()) { - AddClassDefinition(import_class, new_class, object_repr_const_id, + AddClassDefinition(import_class, new_class, complete_type_witness_id, base_id); } @@ -1368,6 +1371,21 @@ class ImportRefResolver { } } + auto TryResolveTypedInst(SemIR::CompleteTypeWitness inst) -> ResolveResult { + CARBON_CHECK(import_ir_.types().GetInstId(inst.type_id) == + SemIR::InstId::BuiltinWitnessType); + auto object_repr_const_id = GetLocalConstantId(inst.object_repr_id); + if (HasNewWork()) { + return Retry(); + } + auto object_repr_id = + context_.GetTypeIdForTypeConstant(object_repr_const_id); + return ResolveAs( + {.type_id = + context_.GetBuiltinType(SemIR::BuiltinInstKind::WitnessType), + .object_repr_id = object_repr_id}); + } + auto TryResolveTypedInst(SemIR::ConstType inst) -> ResolveResult { CARBON_CHECK(inst.type_id == SemIR::TypeId::TypeType); auto inner_const_id = GetLocalConstantId(inst.inner_id); diff --git a/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon b/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon index 8b66f599344b6..695325091cab1 100644 --- a/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon +++ b/toolchain/check/testdata/alias/no_prelude/alias_of_alias.carbon @@ -19,8 +19,9 @@ let d: c = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -43,6 +44,8 @@ let d: c = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index 3826138bcaafc..fce46c348ae03 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -73,6 +73,7 @@ var d: D* = &c; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -86,6 +87,8 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -95,11 +98,12 @@ var d: D* = &c; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+5, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+7, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -122,11 +126,12 @@ var d: D* = &c; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+5, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -149,14 +154,15 @@ var d: D* = &c; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -191,7 +197,7 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export, inst+8, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -217,16 +223,17 @@ var d: D* = &c; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %C [template] +// CHECK:STDOUT: %.5: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_orig, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, inst+9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_orig, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -241,9 +248,9 @@ var d: D* = &c; // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] -// CHECK:STDOUT: %d.var: ref %.4 = var d -// CHECK:STDOUT: %d: ref %.4 = bind_name d, %d.var +// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.5] +// CHECK:STDOUT: %d.var: ref %.5 = var d +// CHECK:STDOUT: %d: ref %.5 = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -258,7 +265,7 @@ var d: D* = &c; // CHECK:STDOUT: %.loc7_14: init %C = converted %.loc7_13.1, %.loc7_13.2 [template = constants.%struct] // CHECK:STDOUT: assign file.%c.var, %.loc7_14 // CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c -// CHECK:STDOUT: %.loc8: %.4 = addr_of %c.ref +// CHECK:STDOUT: %.loc8: %.5 = addr_of %c.ref // CHECK:STDOUT: assign file.%d.var, %.loc8 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon index c841e1a739bad..d6155b6596762 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon @@ -24,9 +24,10 @@ let c_var: c = d; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %D = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -49,11 +50,15 @@ let c_var: c = d; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon index 85677aad24ed0..7d47bba4016d8 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon @@ -53,6 +53,7 @@ extern alias C = Class; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Class: type = class_type @Class [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -72,6 +73,8 @@ extern alias C = Class; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon index a7e974b069e21..d1fd15f7c0c2b 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon @@ -34,8 +34,9 @@ alias b = C; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -59,6 +60,8 @@ alias b = C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index d691dd0a9c682..2494c159a482b 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -73,7 +73,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = ptr_type %C [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -86,12 +87,14 @@ var c: () = a_alias_alias; // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %c_alias: type = bind_alias c_alias, %C.decl [template = constants.%C] // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.2] -// CHECK:STDOUT: %a.var: ref %.2 = var a -// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var +// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.3] +// CHECK:STDOUT: %a.var: ref %.3 = var a +// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -101,13 +104,14 @@ var c: () = a_alias_alias; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = ptr_type %C [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//class1, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//class1, inst+5, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//class1, inst+10, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//class1, inst+7, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//class1, inst+12, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//class1, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -123,9 +127,9 @@ var c: () = a_alias_alias; // CHECK:STDOUT: %c_alias.ref.loc6: type = name_ref c_alias, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c_alias_alias: type = bind_alias c_alias_alias, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c_alias.ref.loc8: type = name_ref c_alias, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.2] -// CHECK:STDOUT: %b.var: ref %.2 = var b -// CHECK:STDOUT: %b: ref %.2 = bind_name b, %b.var +// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.3] +// CHECK:STDOUT: %b.var: ref %.3 = var b +// CHECK:STDOUT: %b: ref %.3 = bind_name b, %b.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -138,13 +142,14 @@ var c: () = a_alias_alias; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = ptr_type %C [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, inst+15, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//class2, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, inst+16, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//class2, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -155,9 +160,9 @@ var c: () = a_alias_alias; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %c_alias_alias.ref: type = name_ref c_alias_alias, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %.loc6: type = ptr_type %C [template = constants.%.2] -// CHECK:STDOUT: %c.var: ref %.2 = var c -// CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var +// CHECK:STDOUT: %.loc6: type = ptr_type %C [template = constants.%.3] +// CHECK:STDOUT: %c.var: ref %.3 = var c +// CHECK:STDOUT: %c: ref %.3 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index 9feda8afec012..1c4aac6aa407a 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -57,6 +57,7 @@ var inst: Test.A = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -70,6 +71,8 @@ var inst: Test.A = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -79,14 +82,15 @@ var inst: Test.A = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Test//def, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Test//def, inst+5, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Test//def, inst+7, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3 = import_ref Test//def, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/no_prelude/import_order.carbon index 913c302343750..b198a10ff0b2f 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_order.carbon @@ -37,6 +37,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: %.3: type = struct_type {.v: %.1} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -62,6 +63,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc4_19.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_19.2: type = converted %.loc4_19.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc4_16: %.2 = field_decl v, element0 [template] +// CHECK:STDOUT: %.loc4_22: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -74,20 +76,21 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.v: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %C, %.1 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+16, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5: type = import_ref Main//a, inst+18, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+16, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+18, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//a, inst+20, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.7: %.4 = import_ref Main//a, inst+7, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7: %.5 = import_ref Main//a, inst+7, loaded [template = %.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -134,7 +137,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc7_25: init %C = converted %.loc7_24.1, %.loc7_24.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%d_val.var, %.loc7_25 // CHECK:STDOUT: %d_val.ref: ref %C = name_ref d_val, file.%d_val -// CHECK:STDOUT: %v.ref.loc8: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc8: %.5 = name_ref v, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc8_27.1: ref %.1 = class_element_access %d_val.ref, element0 // CHECK:STDOUT: %.loc8_29.1: %.2 = struct_literal (%.loc8_27.1) // CHECK:STDOUT: %.loc8_29.2: ref %.1 = class_element_access file.%c_val.var, element0 @@ -144,7 +147,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc8_30: init %C = converted %.loc8_29.1, %.loc8_29.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%c_val.var, %.loc8_30 // CHECK:STDOUT: %c_val.ref: ref %C = name_ref c_val, file.%c_val -// CHECK:STDOUT: %v.ref.loc9: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc9: %.5 = name_ref v, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc9_27.1: ref %.1 = class_element_access %c_val.ref, element0 // CHECK:STDOUT: %.loc9_29.1: %.2 = struct_literal (%.loc9_27.1) // CHECK:STDOUT: %.loc9_29.2: ref %.1 = class_element_access file.%b_val.var, element0 @@ -154,7 +157,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc9_30: init %C = converted %.loc9_29.1, %.loc9_29.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%b_val.var, %.loc9_30 // CHECK:STDOUT: %b_val.ref: ref %C = name_ref b_val, file.%b_val -// CHECK:STDOUT: %v.ref.loc10: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc10: %.5 = name_ref v, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc10_27.1: ref %.1 = class_element_access %b_val.ref, element0 // CHECK:STDOUT: %.loc10_29.1: %.2 = struct_literal (%.loc10_27.1) // CHECK:STDOUT: %.loc10_29.2: ref %.1 = class_element_access file.%a_val.var, element0 diff --git a/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon b/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon index 3a09375cf3633..b410292129907 100644 --- a/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon +++ b/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon @@ -26,7 +26,8 @@ fn F() -> NS.a { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: %.3: type = struct_type {.v: %.1} [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -59,6 +60,7 @@ fn F() -> NS.a { // CHECK:STDOUT: %.loc11_19.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_19.2: type = converted %.loc11_19.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc11_16: %.2 = field_decl v, element0 [template] +// CHECK:STDOUT: %.loc11_22: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 2c6a568726819..13fbdcd9ecbd5 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -116,12 +116,14 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {.x: i32, .y: i32} [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] -// CHECK:STDOUT: %struct: %A = struct_value (%.5, %.6) [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] +// CHECK:STDOUT: %struct: %A = struct_value (%.6, %.7) [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.7: type = ptr_type %B [template] +// CHECK:STDOUT: %.8: = complete_type_witness %A [template] +// CHECK:STDOUT: %.9: type = ptr_type %B [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -159,7 +161,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %A.ref.loc18: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %B.ref.loc21: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %B.ref.loc22: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc22: type = ptr_type %B [template = constants.%.7] +// CHECK:STDOUT: %.loc22: type = ptr_type %B [template = constants.%.9] // CHECK:STDOUT: %B.ref.loc24: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b_factory.var: ref %B = var b_factory // CHECK:STDOUT: %b_factory: ref %B = bind_name b_factory, %b_factory.var @@ -178,6 +180,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %return.var: ref %A = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc11: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -189,6 +192,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A +// CHECK:STDOUT: %.loc15: = complete_type_witness %A [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -198,13 +202,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> @A.%return.var: %A { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9_18: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_26: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_18: i32 = int_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_26: i32 = int_literal 2 [template = constants.%.7] // CHECK:STDOUT: %.loc9_27.1: %.3 = struct_literal (%.loc9_18, %.loc9_26) // CHECK:STDOUT: %.loc9_27.2: ref i32 = class_element_access @A.%return.var, element0 -// CHECK:STDOUT: %.loc9_27.3: init i32 = initialize_from %.loc9_18 to %.loc9_27.2 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_27.3: init i32 = initialize_from %.loc9_18 to %.loc9_27.2 [template = constants.%.6] // CHECK:STDOUT: %.loc9_27.4: ref i32 = class_element_access @A.%return.var, element1 -// CHECK:STDOUT: %.loc9_27.5: init i32 = initialize_from %.loc9_26 to %.loc9_27.4 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_27.5: init i32 = initialize_from %.loc9_26 to %.loc9_27.4 [template = constants.%.7] // CHECK:STDOUT: %.loc9_27.6: init %A = class_init (%.loc9_27.3, %.loc9_27.5), @A.%return.var [template = constants.%struct] // CHECK:STDOUT: %.loc9_28: init %A = converted %.loc9_27.1, %.loc9_27.6 [template = constants.%struct] // CHECK:STDOUT: return %.loc9_28 to @A.%return.var @@ -212,13 +216,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_22: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc17_30: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_22: i32 = int_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_30: i32 = int_literal 2 [template = constants.%.7] // CHECK:STDOUT: %.loc17_31.1: %.3 = struct_literal (%.loc17_22, %.loc17_30) // CHECK:STDOUT: %.loc17_31.2: ref i32 = class_element_access file.%a_ref.var, element0 -// CHECK:STDOUT: %.loc17_31.3: init i32 = initialize_from %.loc17_22 to %.loc17_31.2 [template = constants.%.5] +// CHECK:STDOUT: %.loc17_31.3: init i32 = initialize_from %.loc17_22 to %.loc17_31.2 [template = constants.%.6] // CHECK:STDOUT: %.loc17_31.4: ref i32 = class_element_access file.%a_ref.var, element1 -// CHECK:STDOUT: %.loc17_31.5: init i32 = initialize_from %.loc17_30 to %.loc17_31.4 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_31.5: init i32 = initialize_from %.loc17_30 to %.loc17_31.4 [template = constants.%.7] // CHECK:STDOUT: %.loc17_31.6: init %A = class_init (%.loc17_31.3, %.loc17_31.5), file.%a_ref.var [template = constants.%struct] // CHECK:STDOUT: %.loc17_32: init %A = converted %.loc17_31.1, %.loc17_31.6 [template = constants.%struct] // CHECK:STDOUT: assign file.%a_ref.var, %.loc17_32 @@ -234,8 +238,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %B.ref.loc22: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %.loc22_25.1: ref %B = as_compatible %a_ref.ref.loc22 // CHECK:STDOUT: %.loc22_25.2: ref %B = converted %a_ref.ref.loc22, %.loc22_25.1 -// CHECK:STDOUT: %.loc22_17: %.7 = addr_of %.loc22_25.2 -// CHECK:STDOUT: %b_ptr: %.7 = bind_name b_ptr, %.loc22_17 +// CHECK:STDOUT: %.loc22_17: %.9 = addr_of %.loc22_25.2 +// CHECK:STDOUT: %b_ptr: %.9 = bind_name b_ptr, %.loc22_17 // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, @A.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc24_5: ref %B = splice_block file.%b_factory.var {} @@ -254,7 +258,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.2: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness i32 [template] +// CHECK:STDOUT: %.3: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -292,6 +297,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc5_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc5_12.2: type = converted %int.make_type_32, %.loc5_12.1 [template = i32] // CHECK:STDOUT: adapt_decl i32 +// CHECK:STDOUT: %.loc6: = complete_type_witness i32 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -301,13 +307,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8_13: i32 = int_literal 1 [template = constants.%.2] +// CHECK:STDOUT: %.loc8_13: i32 = int_literal 1 [template = constants.%.3] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_18.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_18.2: type = converted %int.make_type_32.loc8, %.loc8_18.1 [template = i32] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc8_23.1: %A = as_compatible %.loc8_13 [template = constants.%.2] -// CHECK:STDOUT: %.loc8_23.2: %A = converted %.loc8_13, %.loc8_23.1 [template = constants.%.2] +// CHECK:STDOUT: %.loc8_23.1: %A = as_compatible %.loc8_13 [template = constants.%.3] +// CHECK:STDOUT: %.loc8_23.2: %A = converted %.loc8_13, %.loc8_23.1 [template = constants.%.3] // CHECK:STDOUT: %a: %A = bind_name a, %.loc8_23.2 // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] @@ -325,6 +331,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %D: type = class_type @D [template] @@ -365,6 +372,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc4_18: %.1 = struct_literal () // CHECK:STDOUT: %.loc4_19: type = converted %.loc4_18, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: adapt_decl %.1 +// CHECK:STDOUT: %.loc4_21: = complete_type_witness %.1 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -414,11 +422,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %A, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: i32, .y: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] -// CHECK:STDOUT: %struct: %A = struct_value (%.5, %.6) [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: = complete_type_witness %A [template] +// CHECK:STDOUT: %.7: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] +// CHECK:STDOUT: %struct: %A = struct_value (%.7, %.8) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -462,6 +472,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] // CHECK:STDOUT: %.loc6_8: %.2 = field_decl y, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -472,6 +483,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A +// CHECK:STDOUT: %.loc11: = complete_type_witness %A [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -481,15 +493,15 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_25: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc13_33: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_25: i32 = int_literal 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_33: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: %.loc13_34.1: %.3 = struct_literal (%.loc13_25, %.loc13_33) // CHECK:STDOUT: %A.ref.loc13: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc13_34.2: ref %A = temporary_storage // CHECK:STDOUT: %.loc13_34.3: ref i32 = class_element_access %.loc13_34.2, element0 -// CHECK:STDOUT: %.loc13_34.4: init i32 = initialize_from %.loc13_25 to %.loc13_34.3 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_34.4: init i32 = initialize_from %.loc13_25 to %.loc13_34.3 [template = constants.%.7] // CHECK:STDOUT: %.loc13_34.5: ref i32 = class_element_access %.loc13_34.2, element1 -// CHECK:STDOUT: %.loc13_34.6: init i32 = initialize_from %.loc13_33 to %.loc13_34.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_34.6: init i32 = initialize_from %.loc13_33 to %.loc13_34.5 [template = constants.%.8] // CHECK:STDOUT: %.loc13_34.7: init %A = class_init (%.loc13_34.4, %.loc13_34.6), %.loc13_34.2 [template = constants.%struct] // CHECK:STDOUT: %.loc13_34.8: ref %A = temporary %.loc13_34.2, %.loc13_34.7 // CHECK:STDOUT: %.loc13_36: ref %A = converted %.loc13_34.1, %.loc13_34.8 @@ -498,15 +510,15 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc13_42.2: ref %B = converted %.loc13_36, %.loc13_42.1 // CHECK:STDOUT: %.loc13_42.3: %B = bind_value %.loc13_42.2 // CHECK:STDOUT: %b_value: %B = bind_name b_value, %.loc13_42.3 -// CHECK:STDOUT: %.loc24_24: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc24_32: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc24_24: i32 = int_literal 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc24_32: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: %.loc24_33.1: %.3 = struct_literal (%.loc24_24, %.loc24_32) // CHECK:STDOUT: %A.ref.loc24: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc24_33.2: ref %A = temporary_storage // CHECK:STDOUT: %.loc24_33.3: ref i32 = class_element_access %.loc24_33.2, element0 -// CHECK:STDOUT: %.loc24_33.4: init i32 = initialize_from %.loc24_24 to %.loc24_33.3 [template = constants.%.5] +// CHECK:STDOUT: %.loc24_33.4: init i32 = initialize_from %.loc24_24 to %.loc24_33.3 [template = constants.%.7] // CHECK:STDOUT: %.loc24_33.5: ref i32 = class_element_access %.loc24_33.2, element1 -// CHECK:STDOUT: %.loc24_33.6: init i32 = initialize_from %.loc24_32 to %.loc24_33.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc24_33.6: init i32 = initialize_from %.loc24_32 to %.loc24_33.5 [template = constants.%.8] // CHECK:STDOUT: %.loc24_33.7: init %A = class_init (%.loc24_33.4, %.loc24_33.6), %.loc24_33.2 [template = constants.%struct] // CHECK:STDOUT: %.loc24_33.8: ref %A = temporary %.loc24_33.2, %.loc24_33.7 // CHECK:STDOUT: %.loc24_35: ref %A = converted %.loc24_33.1, %.loc24_33.8 @@ -527,26 +539,28 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %A, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: = complete_type_witness %A [template] +// CHECK:STDOUT: %.7: i32 = int_literal 1 [template] // CHECK:STDOUT: %As.type: type = generic_interface_type @As [template] // CHECK:STDOUT: %As: %As.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.6: type = interface_type @As, @As(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @As.%.1 (%.6) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.8: type = interface_type @As, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @As.%.1 (%.8) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.8 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @As(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.6, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.9: type = interface_type @As, @As(%B) [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.11: type = interface_type @As, @As(%B) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @As(%B) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %Convert.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.12: %.7 = assoc_entity element0, imports.%import_ref.7 [symbolic] -// CHECK:STDOUT: %struct: %.3 = struct_value (%.5) [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Convert.type.2 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.14: %.9 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %struct: %.3 = struct_value (%.7) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -565,7 +579,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %As.type = import_ref Core//prelude/operators/as, inst+4, loaded [template = constants.%As] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+27, loaded [symbolic = @As.%.3 (constants.%.12)] +// CHECK:STDOUT: %import_ref.4: @As.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+27, loaded [symbolic = @As.%.3 (constants.%.14)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+20, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+20, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+20, unloaded @@ -590,12 +604,12 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @As, @As(%Dest) [symbolic = %.1 (constants.%.6)] -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @As, @As(%Dest) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @As.%.1 (%.6), @As.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.7)] -// CHECK:STDOUT: %.3: @As.%.2 (%.7) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.8)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @As.%.1 (%.8), @As.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.9)] +// CHECK:STDOUT: %.3: @As.%.2 (%.9) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -610,6 +624,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32, %.loc5_10.1 [template = i32] // CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -619,6 +634,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: adapt_decl %A +// CHECK:STDOUT: %.loc10: = complete_type_witness %A [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -626,22 +642,22 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @As.%.1 (%.6)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @As.%.1 (%.8)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @As, @As(%Dest) [symbolic = %.1 (constants.%.6)] -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @As, @As(%Dest) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc21_18: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc21_18: i32 = int_literal 1 [template = constants.%.7] // CHECK:STDOUT: %.loc21_19.1: %.3 = struct_literal (%.loc21_18) // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc21_21.1: type = interface_type @As, @As(constants.%B) [template = constants.%.9] -// CHECK:STDOUT: %.loc21_21.2: %.10 = specific_constant imports.%import_ref.4, @As(constants.%B) [template = constants.%.11] -// CHECK:STDOUT: %Convert.ref: %.10 = name_ref Convert, %.loc21_21.2 [template = constants.%.11] +// CHECK:STDOUT: %.loc21_21.1: type = interface_type @As, @As(constants.%B) [template = constants.%.11] +// CHECK:STDOUT: %.loc21_21.2: %.12 = specific_constant imports.%import_ref.4, @As(constants.%B) [template = constants.%.13] +// CHECK:STDOUT: %Convert.ref: %.12 = name_ref Convert, %.loc21_21.2 [template = constants.%.13] // CHECK:STDOUT: %struct: %.3 = struct_value (%.loc21_18) [template = constants.%struct] // CHECK:STDOUT: %.loc21_19.2: %.3 = converted %.loc21_19.1, %struct [template = constants.%struct] // CHECK:STDOUT: %.loc21_21.3: %B = converted %.loc21_19.1, [template = ] @@ -663,7 +679,7 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -671,11 +687,11 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Dest => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.10 -// CHECK:STDOUT: %.3 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: %.3 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/identity.carbon b/toolchain/check/testdata/as/identity.carbon index a05b981a76953..fc949a3abf990 100644 --- a/toolchain/check/testdata/as/identity.carbon +++ b/toolchain/check/testdata/as/identity.carbon @@ -33,11 +33,12 @@ fn Initializing() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Value.type: type = fn_type @Value [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Value: %Value.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = ptr_type %X [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = ptr_type %X [template] // CHECK:STDOUT: %Reference.type: type = fn_type @Reference [template] // CHECK:STDOUT: %Reference: %Reference.type = struct_value () [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] @@ -77,9 +78,9 @@ fn Initializing() { // CHECK:STDOUT: } // CHECK:STDOUT: %Reference.decl: %Reference.type = fn_decl @Reference [template = constants.%Reference] { // CHECK:STDOUT: %X.ref.loc21: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc21: type = ptr_type %X [template = constants.%.4] -// CHECK:STDOUT: %p.loc21_14.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @Reference.%p: %.4 = bind_name p, %p.loc21_14.1 +// CHECK:STDOUT: %.loc21: type = ptr_type %X [template = constants.%.5] +// CHECK:STDOUT: %p.loc21_14.1: %.5 = param p, runtime_param0 +// CHECK:STDOUT: @Reference.%p: %.5 = bind_name p, %p.loc21_14.1 // CHECK:STDOUT: } // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %X.ref.loc25: type = name_ref X, %X.decl [template = constants.%X] @@ -89,6 +90,8 @@ fn Initializing() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: } @@ -102,15 +105,15 @@ fn Initializing() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Reference(%p: %.4) { +// CHECK:STDOUT: fn @Reference(%p: %.5) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %X.ref.loc22_10: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc22_11: type = ptr_type %X [template = constants.%.4] -// CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p +// CHECK:STDOUT: %.loc22_11: type = ptr_type %X [template = constants.%.5] +// CHECK:STDOUT: %p.ref: %.5 = name_ref p, %p // CHECK:STDOUT: %.loc22_17: ref %X = deref %p.ref // CHECK:STDOUT: %X.ref.loc22_23: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc22_15: %.4 = addr_of %.loc22_17 -// CHECK:STDOUT: %q: %.4 = bind_name q, %.loc22_15 +// CHECK:STDOUT: %.loc22_15: %.5 = addr_of %.loc22_17 +// CHECK:STDOUT: %q: %.5 = bind_name q, %.loc22_15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/no_prelude/tuple.carbon b/toolchain/check/testdata/as/no_prelude/tuple.carbon index 438a34b6f4e15..322e9391168ca 100644 --- a/toolchain/check/testdata/as/no_prelude/tuple.carbon +++ b/toolchain/check/testdata/as/no_prelude/tuple.carbon @@ -29,16 +29,17 @@ fn Var() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %Let.type: type = fn_type @Let [template] // CHECK:STDOUT: %Let: %Let.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %.4: type = tuple_type (%X, %X) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.6: type = tuple_type (%.5, %.5) [template] -// CHECK:STDOUT: %.7: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.4: type = tuple_type (type, type) [template] +// CHECK:STDOUT: %.5: type = tuple_type (%X, %X) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.7: type = tuple_type (%.6, %.6) [template] +// CHECK:STDOUT: %.8: type = ptr_type %.7 [template] // CHECK:STDOUT: %Var.type: type = fn_type @Var [template] // CHECK:STDOUT: %Var: %Var.type = struct_value () [template] // CHECK:STDOUT: } @@ -60,6 +61,8 @@ fn Var() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { +// CHECK:STDOUT: %.loc13: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: } @@ -70,26 +73,26 @@ fn Var() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %X.ref.loc19_11: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %X.ref.loc19_14: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc19_15.1: %.3 = tuple_literal (%X.ref.loc19_11, %X.ref.loc19_14) -// CHECK:STDOUT: %.loc19_15.2: type = converted %.loc19_15.1, constants.%.4 [template = constants.%.4] +// CHECK:STDOUT: %.loc19_15.1: %.4 = tuple_literal (%X.ref.loc19_11, %X.ref.loc19_14) +// CHECK:STDOUT: %.loc19_15.2: type = converted %.loc19_15.1, constants.%.5 [template = constants.%.5] // CHECK:STDOUT: %Make.ref.loc19_20: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc19_24.1: ref %X = temporary_storage // CHECK:STDOUT: %Make.call.loc19_24: init %X = call %Make.ref.loc19_20() to %.loc19_24.1 // CHECK:STDOUT: %Make.ref.loc19_28: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc19_32.1: ref %X = temporary_storage // CHECK:STDOUT: %Make.call.loc19_32: init %X = call %Make.ref.loc19_28() to %.loc19_32.1 -// CHECK:STDOUT: %.loc19_34: %.4 = tuple_literal (%Make.call.loc19_24, %Make.call.loc19_32) +// CHECK:STDOUT: %.loc19_34: %.5 = tuple_literal (%Make.call.loc19_24, %Make.call.loc19_32) // CHECK:STDOUT: %X.ref.loc19_40: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %X.ref.loc19_43: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc19_44.1: %.3 = tuple_literal (%X.ref.loc19_40, %X.ref.loc19_43) -// CHECK:STDOUT: %.loc19_44.2: type = converted %.loc19_44.1, constants.%.4 [template = constants.%.4] +// CHECK:STDOUT: %.loc19_44.1: %.4 = tuple_literal (%X.ref.loc19_40, %X.ref.loc19_43) +// CHECK:STDOUT: %.loc19_44.2: type = converted %.loc19_44.1, constants.%.5 [template = constants.%.5] // CHECK:STDOUT: %.loc19_24.2: ref %X = temporary %.loc19_24.1, %Make.call.loc19_24 // CHECK:STDOUT: %.loc19_24.3: %X = bind_value %.loc19_24.2 // CHECK:STDOUT: %.loc19_32.2: ref %X = temporary %.loc19_32.1, %Make.call.loc19_32 // CHECK:STDOUT: %.loc19_32.3: %X = bind_value %.loc19_32.2 -// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc19_24.3, %.loc19_32.3) -// CHECK:STDOUT: %.loc19_45: %.4 = converted %.loc19_34, %tuple -// CHECK:STDOUT: %a: %.4 = bind_name a, %.loc19_45 +// CHECK:STDOUT: %tuple: %.5 = tuple_value (%.loc19_24.3, %.loc19_32.3) +// CHECK:STDOUT: %.loc19_45: %.5 = converted %.loc19_34, %tuple +// CHECK:STDOUT: %a: %.5 = bind_name a, %.loc19_45 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -97,23 +100,23 @@ fn Var() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %X.ref.loc24_11: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %X.ref.loc24_14: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc24_15.1: %.3 = tuple_literal (%X.ref.loc24_11, %X.ref.loc24_14) -// CHECK:STDOUT: %.loc24_15.2: type = converted %.loc24_15.1, constants.%.4 [template = constants.%.4] -// CHECK:STDOUT: %b.var: ref %.4 = var b -// CHECK:STDOUT: %b: ref %.4 = bind_name b, %b.var +// CHECK:STDOUT: %.loc24_15.1: %.4 = tuple_literal (%X.ref.loc24_11, %X.ref.loc24_14) +// CHECK:STDOUT: %.loc24_15.2: type = converted %.loc24_15.1, constants.%.5 [template = constants.%.5] +// CHECK:STDOUT: %b.var: ref %.5 = var b +// CHECK:STDOUT: %b: ref %.5 = bind_name b, %b.var // CHECK:STDOUT: %Make.ref.loc24_20: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc24_34.1: ref %X = tuple_access %b.var, element0 // CHECK:STDOUT: %Make.call.loc24_24: init %X = call %Make.ref.loc24_20() to %.loc24_34.1 // CHECK:STDOUT: %Make.ref.loc24_28: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make] // CHECK:STDOUT: %.loc24_34.2: ref %X = tuple_access %b.var, element1 // CHECK:STDOUT: %Make.call.loc24_32: init %X = call %Make.ref.loc24_28() to %.loc24_34.2 -// CHECK:STDOUT: %.loc24_34.3: %.4 = tuple_literal (%Make.call.loc24_24, %Make.call.loc24_32) +// CHECK:STDOUT: %.loc24_34.3: %.5 = tuple_literal (%Make.call.loc24_24, %Make.call.loc24_32) // CHECK:STDOUT: %X.ref.loc24_40: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %X.ref.loc24_43: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc24_44.1: %.3 = tuple_literal (%X.ref.loc24_40, %X.ref.loc24_43) -// CHECK:STDOUT: %.loc24_44.2: type = converted %.loc24_44.1, constants.%.4 [template = constants.%.4] -// CHECK:STDOUT: %.loc24_34.4: init %.4 = tuple_init (%Make.call.loc24_24, %Make.call.loc24_32) to %b.var -// CHECK:STDOUT: %.loc24_45: init %.4 = converted %.loc24_34.3, %.loc24_34.4 +// CHECK:STDOUT: %.loc24_44.1: %.4 = tuple_literal (%X.ref.loc24_40, %X.ref.loc24_43) +// CHECK:STDOUT: %.loc24_44.2: type = converted %.loc24_44.1, constants.%.5 [template = constants.%.5] +// CHECK:STDOUT: %.loc24_34.4: init %.5 = tuple_init (%Make.call.loc24_24, %Make.call.loc24_32) to %b.var +// CHECK:STDOUT: %.loc24_45: init %.5 = converted %.loc24_34.3, %.loc24_34.4 // CHECK:STDOUT: assign %b.var, %.loc24_45 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/overloaded.carbon b/toolchain/check/testdata/as/overloaded.carbon index 8b45fd24c8734..07cea00dc941c 100644 --- a/toolchain/check/testdata/as/overloaded.carbon +++ b/toolchain/check/testdata/as/overloaded.carbon @@ -31,36 +31,37 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %X, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.n: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %As.type: type = generic_interface_type @As [template] // CHECK:STDOUT: %As: %As.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @As, @As(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @As.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @As, @As(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @As.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @As(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.7: type = interface_type @As, @As(%X) [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.8: type = interface_type @As, @As(%X) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @As(%X) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.3 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.10: = interface_witness (%Convert.2) [template] -// CHECK:STDOUT: %.11: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.12: type = interface_type @As, @As(i32) [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.2) [template] +// CHECK:STDOUT: %.12: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.13: type = interface_type @As, @As(i32) [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @As(i32) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.13: type = assoc_entity_type %.12, %Convert.type.5 [template] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.15: = interface_witness (%Convert.4) [template] -// CHECK:STDOUT: %.16: i32 = int_literal 4 [template] -// CHECK:STDOUT: %.17: %.5 = assoc_entity element0, imports.%import_ref.7 [symbolic] -// CHECK:STDOUT: %.18: = bound_method %.16, %Convert.2 [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %.13, %Convert.type.5 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.4) [template] +// CHECK:STDOUT: %.17: i32 = int_literal 4 [template] +// CHECK:STDOUT: %.18: %.6 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.19: = bound_method %.17, %Convert.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -79,7 +80,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %As.type = import_ref Core//prelude/operators/as, inst+4, loaded [template = constants.%As] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4: @As.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+27, loaded [symbolic = @As.%.3 (constants.%.17)] +// CHECK:STDOUT: %import_ref.4: @As.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+27, loaded [symbolic = @As.%.3 (constants.%.18)] // CHECK:STDOUT: %import_ref.5: @As.%Convert.type (%Convert.type.1) = import_ref Core//prelude/operators/as, inst+20, loaded [symbolic = @As.%Convert (constants.%Convert.1)] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+20, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+20, unloaded @@ -100,7 +101,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %As.ref.loc15: %As.type = name_ref As, imports.%import_ref.2 [template = constants.%As] // CHECK:STDOUT: %X.ref.loc15: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc15_20: type = interface_type @As, @As(constants.%X) [template = constants.%.7] +// CHECK:STDOUT: %.loc15_20: type = interface_type @As, @As(constants.%X) [template = constants.%.8] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %X.ref.loc19: type = name_ref X, %X.decl [template = constants.%X] @@ -109,7 +110,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_18.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] // CHECK:STDOUT: %.loc19_18.2: type = converted %int.make_type_32.loc19, %.loc19_18.1 [template = i32] -// CHECK:STDOUT: %.loc19_18.3: type = interface_type @As, @As(i32) [template = constants.%.12] +// CHECK:STDOUT: %.loc19_18.3: type = interface_type @As, @As(i32) [template = constants.%.13] // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] @@ -120,12 +121,12 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @As, @As(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @As, @As(%Dest) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @As.%.1 (%.4), @As.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @As.%.2 (%.5) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @As.%.1 (%.5), @As.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @As.%.2 (%.6) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -135,7 +136,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: i32 as %.7 { +// CHECK:STDOUT: impl @impl.1: i32 as %.8 { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -145,14 +146,14 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %return.var: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness (%Convert.decl) [template = constants.%.10] +// CHECK:STDOUT: %.loc15: = interface_witness (%Convert.decl) [template = constants.%.11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl // CHECK:STDOUT: witness = %.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %X as %.12 { +// CHECK:STDOUT: impl @impl.2: %X as %.13 { // CHECK:STDOUT: %Convert.decl: %Convert.type.4 = fn_decl @Convert.3 [template = constants.%Convert.4] { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %self.loc20_14.1: %X = param self, runtime_param0 @@ -162,7 +163,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_32, %.loc20_28.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = interface_witness (%Convert.decl) [template = constants.%.15] +// CHECK:STDOUT: %.loc19: = interface_witness (%Convert.decl) [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -174,6 +175,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X @@ -182,10 +184,10 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @As.%.1 (%.4)) { +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @As.%.1 (%.5)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @As, @As(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @As, @As(%Dest) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); // CHECK:STDOUT: } @@ -212,25 +214,25 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc23_16: i32 = int_literal 4 [template = constants.%.16] +// CHECK:STDOUT: %.loc23_16: i32 = int_literal 4 [template = constants.%.17] // CHECK:STDOUT: %int.make_type_32.loc23_21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_21.1: type = value_of_initializer %int.make_type_32.loc23_21 [template = i32] // CHECK:STDOUT: %.loc23_21.2: type = converted %int.make_type_32.loc23_21, %.loc23_21.1 [template = i32] // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc23_26.1: type = interface_type @As, @As(constants.%X) [template = constants.%.7] -// CHECK:STDOUT: %.loc23_26.2: %.8 = specific_constant imports.%import_ref.4, @As(constants.%X) [template = constants.%.9] -// CHECK:STDOUT: %Convert.ref.loc23_26: %.8 = name_ref Convert, %.loc23_26.2 [template = constants.%.9] +// CHECK:STDOUT: %.loc23_26.1: type = interface_type @As, @As(constants.%X) [template = constants.%.8] +// CHECK:STDOUT: %.loc23_26.2: %.9 = specific_constant imports.%import_ref.4, @As(constants.%X) [template = constants.%.10] +// CHECK:STDOUT: %Convert.ref.loc23_26: %.9 = name_ref Convert, %.loc23_26.2 [template = constants.%.10] // CHECK:STDOUT: %.loc23_26.3: %Convert.type.3 = interface_witness_access @impl.1.%.loc15, element0 [template = constants.%Convert.2] -// CHECK:STDOUT: %.loc23_26.4: = bound_method %.loc23_16, %.loc23_26.3 [template = constants.%.18] +// CHECK:STDOUT: %.loc23_26.4: = bound_method %.loc23_16, %.loc23_26.3 [template = constants.%.19] // CHECK:STDOUT: %.loc23_26.5: ref %X = temporary_storage // CHECK:STDOUT: %Convert.call.loc23_26: init %X = call %.loc23_26.4(%.loc23_16) to %.loc23_26.5 // CHECK:STDOUT: %.loc23_26.6: init %X = converted %.loc23_16, %Convert.call.loc23_26 // CHECK:STDOUT: %int.make_type_32.loc23_35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_35.1: type = value_of_initializer %int.make_type_32.loc23_35 [template = i32] // CHECK:STDOUT: %.loc23_35.2: type = converted %int.make_type_32.loc23_35, %.loc23_35.1 [template = i32] -// CHECK:STDOUT: %.loc23_32.1: type = interface_type @As, @As(i32) [template = constants.%.12] -// CHECK:STDOUT: %.loc23_32.2: %.13 = specific_constant imports.%import_ref.4, @As(i32) [template = constants.%.14] -// CHECK:STDOUT: %Convert.ref.loc23_32: %.13 = name_ref Convert, %.loc23_32.2 [template = constants.%.14] +// CHECK:STDOUT: %.loc23_32.1: type = interface_type @As, @As(i32) [template = constants.%.13] +// CHECK:STDOUT: %.loc23_32.2: %.14 = specific_constant imports.%import_ref.4, @As(i32) [template = constants.%.15] +// CHECK:STDOUT: %Convert.ref.loc23_32: %.14 = name_ref Convert, %.loc23_32.2 [template = constants.%.15] // CHECK:STDOUT: %.loc23_26.7: ref %X = temporary %.loc23_26.5, %.loc23_26.6 // CHECK:STDOUT: %.loc23_32.3: %Convert.type.5 = interface_witness_access @impl.2.%.loc19, element0 [template = constants.%Convert.4] // CHECK:STDOUT: %.loc23_32.4: = bound_method %.loc23_26.7, %.loc23_32.3 @@ -257,7 +259,7 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -265,17 +267,17 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Dest => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 // CHECK:STDOUT: %Convert => constants.%Convert.3 -// CHECK:STDOUT: %.2 => constants.%.8 -// CHECK:STDOUT: %.3 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: %.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%X, i32) { // CHECK:STDOUT: %Dest => constants.%X -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Self => i32 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -283,17 +285,17 @@ let n: i32 = ((4 as i32) as X) as i32; // CHECK:STDOUT: %Dest => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.2 => constants.%.13 -// CHECK:STDOUT: %.3 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.14 +// CHECK:STDOUT: %.3 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(i32, constants.%X) { // CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: %Self => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index 561d74ef1d2ef..be57cdec19872 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -46,14 +46,15 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %Eq: %Eq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: f64 = float_literal 1 [template] -// CHECK:STDOUT: %.6: bool = bool_literal true [template] -// CHECK:STDOUT: %.7: f64 = float_literal 2 [template] -// CHECK:STDOUT: %.8: bool = bool_literal false [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.7: bool = bool_literal true [template] +// CHECK:STDOUT: %.8: f64 = float_literal 2 [template] +// CHECK:STDOUT: %.9: bool = bool_literal false [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -134,11 +135,15 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -153,11 +158,11 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Eq.ref.loc8: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %.loc8_19: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc8_24: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.eq.loc8: init bool = call %Eq.ref.loc8(%.loc8_19, %.loc8_24) [template = constants.%.6] -// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %float.eq.loc8 [template = constants.%.6] -// CHECK:STDOUT: %.loc8_13.2: bool = converted %float.eq.loc8, %.loc8_13.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc8_19: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc8_24: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.eq.loc8: init bool = call %Eq.ref.loc8(%.loc8_19, %.loc8_24) [template = constants.%.7] +// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %float.eq.loc8 [template = constants.%.7] +// CHECK:STDOUT: %.loc8_13.2: bool = converted %float.eq.loc8, %.loc8_13.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc8_13.2 br !if.expr.then.loc8 else br !if.expr.else.loc8 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8: @@ -172,11 +177,11 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %.loc8_13.3: type = block_arg !if.expr.result.loc8 [template = constants.%True] // CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ // CHECK:STDOUT: %Eq.ref.loc9: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %.loc9_20: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_25: f64 = float_literal 2 [template = constants.%.7] -// CHECK:STDOUT: %float.eq.loc9: init bool = call %Eq.ref.loc9(%.loc9_20, %.loc9_25) [template = constants.%.8] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %float.eq.loc9 [template = constants.%.8] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %float.eq.loc9, %.loc9_14.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_20: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_25: f64 = float_literal 2 [template = constants.%.8] +// CHECK:STDOUT: %float.eq.loc9: init bool = call %Eq.ref.loc9(%.loc9_20, %.loc9_25) [template = constants.%.9] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %float.eq.loc9 [template = constants.%.9] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %float.eq.loc9, %.loc9_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: diff --git a/toolchain/check/testdata/builtins/float/greater.carbon b/toolchain/check/testdata/builtins/float/greater.carbon index 7f18ba112701c..712ad6639e789 100644 --- a/toolchain/check/testdata/builtins/float/greater.carbon +++ b/toolchain/check/testdata/builtins/float/greater.carbon @@ -43,16 +43,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: f64 = float_literal 1 [template] -// CHECK:STDOUT: %.6: f64 = float_literal 2 [template] -// CHECK:STDOUT: %.7: bool = bool_literal false [template] -// CHECK:STDOUT: %.8: f64 = float_literal 0 [template] -// CHECK:STDOUT: %.9: bool = bool_literal true [template] -// CHECK:STDOUT: %.10: f64 = float_literal -1 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.7: f64 = float_literal 2 [template] +// CHECK:STDOUT: %.8: bool = bool_literal false [template] +// CHECK:STDOUT: %.9: f64 = float_literal 0 [template] +// CHECK:STDOUT: %.10: bool = bool_literal true [template] +// CHECK:STDOUT: %.11: f64 = float_literal -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -147,11 +148,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -168,11 +173,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc9: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc9_25: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_30: f64 = float_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %float.greater.loc9: init bool = call %Greater.ref.loc9(%.loc9_25, %.loc9_30) [template = constants.%.7] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %float.greater.loc9 [template = constants.%.7] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %float.greater.loc9, %.loc9_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_25: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_30: f64 = float_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %float.greater.loc9: init bool = call %Greater.ref.loc9(%.loc9_25, %.loc9_30) [template = constants.%.8] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %float.greater.loc9 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %float.greater.loc9, %.loc9_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -187,11 +192,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] // CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc10: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc10_25: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc10_30: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.greater.loc10: init bool = call %Greater.ref.loc10(%.loc10_25, %.loc10_30) [template = constants.%.7] -// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %float.greater.loc10 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_14.2: bool = converted %float.greater.loc10, %.loc10_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc10_25: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc10_30: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.greater.loc10: init bool = call %Greater.ref.loc10(%.loc10_25, %.loc10_30) [template = constants.%.8] +// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %float.greater.loc10 [template = constants.%.8] +// CHECK:STDOUT: %.loc10_14.2: bool = converted %float.greater.loc10, %.loc10_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc10_14.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -206,11 +211,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ // CHECK:STDOUT: %Greater.ref.loc11: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc11_24: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_29: f64 = float_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %float.greater.loc11: init bool = call %Greater.ref.loc11(%.loc11_24, %.loc11_29) [template = constants.%.9] -// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %float.greater.loc11 [template = constants.%.9] -// CHECK:STDOUT: %.loc11_13.2: bool = converted %float.greater.loc11, %.loc11_13.1 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_24: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_29: f64 = float_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %float.greater.loc11: init bool = call %Greater.ref.loc11(%.loc11_24, %.loc11_29) [template = constants.%.10] +// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %float.greater.loc11 [template = constants.%.10] +// CHECK:STDOUT: %.loc11_13.2: bool = converted %float.greater.loc11, %.loc11_13.1 [template = constants.%.10] // CHECK:STDOUT: if %.loc11_13.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -226,14 +231,14 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc12: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_32: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_32) [template = constants.%.10] -// CHECK:STDOUT: %.loc12_38: f64 = float_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc12_24.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_24.2: f64 = converted %float.negate.loc12, %.loc12_24.1 [template = constants.%.10] -// CHECK:STDOUT: %float.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_24.2, %.loc12_38) [template = constants.%.7] -// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %float.greater.loc12 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_14.2: bool = converted %float.greater.loc12, %.loc12_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_32: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_32) [template = constants.%.11] +// CHECK:STDOUT: %.loc12_38: f64 = float_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %.loc12_24.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] +// CHECK:STDOUT: %.loc12_24.2: f64 = converted %float.negate.loc12, %.loc12_24.1 [template = constants.%.11] +// CHECK:STDOUT: %float.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_24.2, %.loc12_38) [template = constants.%.8] +// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %float.greater.loc12 [template = constants.%.8] +// CHECK:STDOUT: %.loc12_14.2: bool = converted %float.greater.loc12, %.loc12_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -248,15 +253,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ // CHECK:STDOUT: %Greater.ref.loc13: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc13_24: f64 = float_literal 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_24: f64 = float_literal 0 [template = constants.%.9] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_36: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.10] -// CHECK:STDOUT: %.loc13_23.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.10] -// CHECK:STDOUT: %.loc13_23.2: f64 = converted %float.negate.loc13, %.loc13_23.1 [template = constants.%.10] -// CHECK:STDOUT: %float.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.9] -// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %float.greater.loc13 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_13.2: bool = converted %float.greater.loc13, %.loc13_13.1 [template = constants.%.9] +// CHECK:STDOUT: %.loc13_36: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.11] +// CHECK:STDOUT: %.loc13_23.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_23.2: f64 = converted %float.negate.loc13, %.loc13_23.1 [template = constants.%.11] +// CHECK:STDOUT: %float.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.10] +// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %float.greater.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_13.2: bool = converted %float.greater.loc13, %.loc13_13.1 [template = constants.%.10] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: diff --git a/toolchain/check/testdata/builtins/float/greater_eq.carbon b/toolchain/check/testdata/builtins/float/greater_eq.carbon index 9f4e8537bb092..0c8ffc9f6211b 100644 --- a/toolchain/check/testdata/builtins/float/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/float/greater_eq.carbon @@ -43,16 +43,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: f64 = float_literal 1 [template] -// CHECK:STDOUT: %.6: f64 = float_literal 2 [template] -// CHECK:STDOUT: %.7: bool = bool_literal false [template] -// CHECK:STDOUT: %.8: bool = bool_literal true [template] -// CHECK:STDOUT: %.9: f64 = float_literal 0 [template] -// CHECK:STDOUT: %.10: f64 = float_literal -1 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.7: f64 = float_literal 2 [template] +// CHECK:STDOUT: %.8: bool = bool_literal false [template] +// CHECK:STDOUT: %.9: bool = bool_literal true [template] +// CHECK:STDOUT: %.10: f64 = float_literal 0 [template] +// CHECK:STDOUT: %.11: f64 = float_literal -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -147,11 +148,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -168,11 +173,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc9: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc9_27: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_32: f64 = float_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %float.greater_eq.loc9: init bool = call %GreaterEq.ref.loc9(%.loc9_27, %.loc9_32) [template = constants.%.7] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %float.greater_eq.loc9 [template = constants.%.7] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %float.greater_eq.loc9, %.loc9_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_27: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_32: f64 = float_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %float.greater_eq.loc9: init bool = call %GreaterEq.ref.loc9(%.loc9_27, %.loc9_32) [template = constants.%.8] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %float.greater_eq.loc9 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %float.greater_eq.loc9, %.loc9_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -187,11 +192,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc10: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc10: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc10_26: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc10_31: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.greater_eq.loc10: init bool = call %GreaterEq.ref.loc10(%.loc10_26, %.loc10_31) [template = constants.%.8] -// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %float.greater_eq.loc10 [template = constants.%.8] -// CHECK:STDOUT: %.loc10_13.2: bool = converted %float.greater_eq.loc10, %.loc10_13.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc10_26: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc10_31: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.greater_eq.loc10: init bool = call %GreaterEq.ref.loc10(%.loc10_26, %.loc10_31) [template = constants.%.9] +// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %float.greater_eq.loc10 [template = constants.%.9] +// CHECK:STDOUT: %.loc10_13.2: bool = converted %float.greater_eq.loc10, %.loc10_13.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc10_13.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -206,11 +211,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc10_13.3: type = block_arg !if.expr.result.loc10 [template = constants.%True] // CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc11: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc11_26: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_31: f64 = float_literal 0 [template = constants.%.9] -// CHECK:STDOUT: %float.greater_eq.loc11: init bool = call %GreaterEq.ref.loc11(%.loc11_26, %.loc11_31) [template = constants.%.8] -// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %float.greater_eq.loc11 [template = constants.%.8] -// CHECK:STDOUT: %.loc11_13.2: bool = converted %float.greater_eq.loc11, %.loc11_13.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_26: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_31: f64 = float_literal 0 [template = constants.%.10] +// CHECK:STDOUT: %float.greater_eq.loc11: init bool = call %GreaterEq.ref.loc11(%.loc11_26, %.loc11_31) [template = constants.%.9] +// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %float.greater_eq.loc11 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_13.2: bool = converted %float.greater_eq.loc11, %.loc11_13.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc11_13.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -226,14 +231,14 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc12: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_34: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_34) [template = constants.%.10] -// CHECK:STDOUT: %.loc12_40: f64 = float_literal 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_26.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_26.2: f64 = converted %float.negate.loc12, %.loc12_26.1 [template = constants.%.10] -// CHECK:STDOUT: %float.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_26.2, %.loc12_40) [template = constants.%.7] -// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %float.greater_eq.loc12 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_14.2: bool = converted %float.greater_eq.loc12, %.loc12_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_34: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_34) [template = constants.%.11] +// CHECK:STDOUT: %.loc12_40: f64 = float_literal 0 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_26.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] +// CHECK:STDOUT: %.loc12_26.2: f64 = converted %float.negate.loc12, %.loc12_26.1 [template = constants.%.11] +// CHECK:STDOUT: %float.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_26.2, %.loc12_40) [template = constants.%.8] +// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %float.greater_eq.loc12 [template = constants.%.8] +// CHECK:STDOUT: %.loc12_14.2: bool = converted %float.greater_eq.loc12, %.loc12_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -248,15 +253,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc13: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc13_26: f64 = float_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %.loc13_26: f64 = float_literal 0 [template = constants.%.10] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_38: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_38) [template = constants.%.10] -// CHECK:STDOUT: %.loc13_25.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.10] -// CHECK:STDOUT: %.loc13_25.2: f64 = converted %float.negate.loc13, %.loc13_25.1 [template = constants.%.10] -// CHECK:STDOUT: %float.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26, %.loc13_25.2) [template = constants.%.8] -// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %float.greater_eq.loc13 [template = constants.%.8] -// CHECK:STDOUT: %.loc13_13.2: bool = converted %float.greater_eq.loc13, %.loc13_13.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_38: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_38) [template = constants.%.11] +// CHECK:STDOUT: %.loc13_25.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_25.2: f64 = converted %float.negate.loc13, %.loc13_25.1 [template = constants.%.11] +// CHECK:STDOUT: %float.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26, %.loc13_25.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %float.greater_eq.loc13 [template = constants.%.9] +// CHECK:STDOUT: %.loc13_13.2: bool = converted %float.greater_eq.loc13, %.loc13_13.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: diff --git a/toolchain/check/testdata/builtins/float/less.carbon b/toolchain/check/testdata/builtins/float/less.carbon index 8ec60ba29b3d9..ce67aaa0e314f 100644 --- a/toolchain/check/testdata/builtins/float/less.carbon +++ b/toolchain/check/testdata/builtins/float/less.carbon @@ -43,16 +43,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: f64 = float_literal 1 [template] -// CHECK:STDOUT: %.6: f64 = float_literal 2 [template] -// CHECK:STDOUT: %.7: bool = bool_literal true [template] -// CHECK:STDOUT: %.8: bool = bool_literal false [template] -// CHECK:STDOUT: %.9: f64 = float_literal 0 [template] -// CHECK:STDOUT: %.10: f64 = float_literal -1 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.7: f64 = float_literal 2 [template] +// CHECK:STDOUT: %.8: bool = bool_literal true [template] +// CHECK:STDOUT: %.9: bool = bool_literal false [template] +// CHECK:STDOUT: %.10: f64 = float_literal 0 [template] +// CHECK:STDOUT: %.11: f64 = float_literal -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -147,11 +148,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -168,11 +173,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc9: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc9_21: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_26: f64 = float_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %float.less.loc9: init bool = call %Less.ref.loc9(%.loc9_21, %.loc9_26) [template = constants.%.7] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %float.less.loc9 [template = constants.%.7] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %float.less.loc9, %.loc9_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_21: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_26: f64 = float_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %float.less.loc9: init bool = call %Less.ref.loc9(%.loc9_21, %.loc9_26) [template = constants.%.8] +// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %float.less.loc9 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_13.2: bool = converted %float.less.loc9, %.loc9_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -187,11 +192,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc10: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc10_22: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc10_27: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.less.loc10: init bool = call %Less.ref.loc10(%.loc10_22, %.loc10_27) [template = constants.%.8] -// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %float.less.loc10 [template = constants.%.8] -// CHECK:STDOUT: %.loc10_14.2: bool = converted %float.less.loc10, %.loc10_14.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc10_22: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc10_27: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.less.loc10: init bool = call %Less.ref.loc10(%.loc10_22, %.loc10_27) [template = constants.%.9] +// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %float.less.loc10 [template = constants.%.9] +// CHECK:STDOUT: %.loc10_14.2: bool = converted %float.less.loc10, %.loc10_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc10_14.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -206,11 +211,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] // CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc11: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc11_22: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_27: f64 = float_literal 0 [template = constants.%.9] -// CHECK:STDOUT: %float.less.loc11: init bool = call %Less.ref.loc11(%.loc11_22, %.loc11_27) [template = constants.%.8] -// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %float.less.loc11 [template = constants.%.8] -// CHECK:STDOUT: %.loc11_14.2: bool = converted %float.less.loc11, %.loc11_14.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_22: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_27: f64 = float_literal 0 [template = constants.%.10] +// CHECK:STDOUT: %float.less.loc11: init bool = call %Less.ref.loc11(%.loc11_22, %.loc11_27) [template = constants.%.9] +// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %float.less.loc11 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_14.2: bool = converted %float.less.loc11, %.loc11_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc11_14.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -226,14 +231,14 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc12: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_28: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_28) [template = constants.%.10] -// CHECK:STDOUT: %.loc12_34: f64 = float_literal 0 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_20.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_20.2: f64 = converted %float.negate.loc12, %.loc12_20.1 [template = constants.%.10] -// CHECK:STDOUT: %float.less.loc12: init bool = call %Less.ref.loc12(%.loc12_20.2, %.loc12_34) [template = constants.%.7] -// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %float.less.loc12 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_13.2: bool = converted %float.less.loc12, %.loc12_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_28: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_28) [template = constants.%.11] +// CHECK:STDOUT: %.loc12_34: f64 = float_literal 0 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_20.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] +// CHECK:STDOUT: %.loc12_20.2: f64 = converted %float.negate.loc12, %.loc12_20.1 [template = constants.%.11] +// CHECK:STDOUT: %float.less.loc12: init bool = call %Less.ref.loc12(%.loc12_20.2, %.loc12_34) [template = constants.%.8] +// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %float.less.loc12 [template = constants.%.8] +// CHECK:STDOUT: %.loc12_13.2: bool = converted %float.less.loc12, %.loc12_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -248,15 +253,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc13: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc13_22: f64 = float_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %.loc13_22: f64 = float_literal 0 [template = constants.%.10] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_34: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.10] -// CHECK:STDOUT: %.loc13_21.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.10] -// CHECK:STDOUT: %.loc13_21.2: f64 = converted %float.negate.loc13, %.loc13_21.1 [template = constants.%.10] -// CHECK:STDOUT: %float.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22, %.loc13_21.2) [template = constants.%.8] -// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %float.less.loc13 [template = constants.%.8] -// CHECK:STDOUT: %.loc13_14.2: bool = converted %float.less.loc13, %.loc13_14.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_34: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.11] +// CHECK:STDOUT: %.loc13_21.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_21.2: f64 = converted %float.negate.loc13, %.loc13_21.1 [template = constants.%.11] +// CHECK:STDOUT: %float.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22, %.loc13_21.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %float.less.loc13 [template = constants.%.9] +// CHECK:STDOUT: %.loc13_14.2: bool = converted %float.less.loc13, %.loc13_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: diff --git a/toolchain/check/testdata/builtins/float/less_eq.carbon b/toolchain/check/testdata/builtins/float/less_eq.carbon index e5359dc5bc5da..82effca5c6638 100644 --- a/toolchain/check/testdata/builtins/float/less_eq.carbon +++ b/toolchain/check/testdata/builtins/float/less_eq.carbon @@ -43,16 +43,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: f64 = float_literal 1 [template] -// CHECK:STDOUT: %.6: f64 = float_literal 2 [template] -// CHECK:STDOUT: %.7: bool = bool_literal true [template] -// CHECK:STDOUT: %.8: f64 = float_literal 0 [template] -// CHECK:STDOUT: %.9: bool = bool_literal false [template] -// CHECK:STDOUT: %.10: f64 = float_literal -1 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.7: f64 = float_literal 2 [template] +// CHECK:STDOUT: %.8: bool = bool_literal true [template] +// CHECK:STDOUT: %.9: f64 = float_literal 0 [template] +// CHECK:STDOUT: %.10: bool = bool_literal false [template] +// CHECK:STDOUT: %.11: f64 = float_literal -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -147,11 +148,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -168,11 +173,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc9: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc9_23: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_28: f64 = float_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %float.less_eq.loc9: init bool = call %LessEq.ref.loc9(%.loc9_23, %.loc9_28) [template = constants.%.7] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %float.less_eq.loc9 [template = constants.%.7] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %float.less_eq.loc9, %.loc9_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_23: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_28: f64 = float_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %float.less_eq.loc9: init bool = call %LessEq.ref.loc9(%.loc9_23, %.loc9_28) [template = constants.%.8] +// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %float.less_eq.loc9 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_13.2: bool = converted %float.less_eq.loc9, %.loc9_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -187,11 +192,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] // CHECK:STDOUT: %true_.ref.loc10: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc10: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc10_23: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc10_28: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.less_eq.loc10: init bool = call %LessEq.ref.loc10(%.loc10_23, %.loc10_28) [template = constants.%.7] -// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %float.less_eq.loc10 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_13.2: bool = converted %float.less_eq.loc10, %.loc10_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc10_23: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc10_28: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.less_eq.loc10: init bool = call %LessEq.ref.loc10(%.loc10_23, %.loc10_28) [template = constants.%.8] +// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %float.less_eq.loc10 [template = constants.%.8] +// CHECK:STDOUT: %.loc10_13.2: bool = converted %float.less_eq.loc10, %.loc10_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc10_13.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -206,11 +211,11 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc10_13.3: type = block_arg !if.expr.result.loc10 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ // CHECK:STDOUT: %LessEq.ref.loc11: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc11_24: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc11_29: f64 = float_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %float.less_eq.loc11: init bool = call %LessEq.ref.loc11(%.loc11_24, %.loc11_29) [template = constants.%.9] -// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %float.less_eq.loc11 [template = constants.%.9] -// CHECK:STDOUT: %.loc11_14.2: bool = converted %float.less_eq.loc11, %.loc11_14.1 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_24: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc11_29: f64 = float_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %float.less_eq.loc11: init bool = call %LessEq.ref.loc11(%.loc11_24, %.loc11_29) [template = constants.%.10] +// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %float.less_eq.loc11 [template = constants.%.10] +// CHECK:STDOUT: %.loc11_14.2: bool = converted %float.less_eq.loc11, %.loc11_14.1 [template = constants.%.10] // CHECK:STDOUT: if %.loc11_14.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -226,14 +231,14 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc12: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_30: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_30) [template = constants.%.10] -// CHECK:STDOUT: %.loc12_36: f64 = float_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc12_22.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.10] -// CHECK:STDOUT: %.loc12_22.2: f64 = converted %float.negate.loc12, %.loc12_22.1 [template = constants.%.10] -// CHECK:STDOUT: %float.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_22.2, %.loc12_36) [template = constants.%.7] -// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %float.less_eq.loc12 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_13.2: bool = converted %float.less_eq.loc12, %.loc12_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_30: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.negate.loc12: init f64 = call %Negate.ref.loc12(%.loc12_30) [template = constants.%.11] +// CHECK:STDOUT: %.loc12_36: f64 = float_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %.loc12_22.1: f64 = value_of_initializer %float.negate.loc12 [template = constants.%.11] +// CHECK:STDOUT: %.loc12_22.2: f64 = converted %float.negate.loc12, %.loc12_22.1 [template = constants.%.11] +// CHECK:STDOUT: %float.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_22.2, %.loc12_36) [template = constants.%.8] +// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %float.less_eq.loc12 [template = constants.%.8] +// CHECK:STDOUT: %.loc12_13.2: bool = converted %float.less_eq.loc12, %.loc12_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -248,15 +253,15 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ // CHECK:STDOUT: %LessEq.ref.loc13: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc13_24: f64 = float_literal 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_24: f64 = float_literal 0 [template = constants.%.9] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_36: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.10] -// CHECK:STDOUT: %.loc13_23.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.10] -// CHECK:STDOUT: %.loc13_23.2: f64 = converted %float.negate.loc13, %.loc13_23.1 [template = constants.%.10] -// CHECK:STDOUT: %float.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.9] -// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %float.less_eq.loc13 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_14.2: bool = converted %float.less_eq.loc13, %.loc13_14.1 [template = constants.%.9] +// CHECK:STDOUT: %.loc13_36: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.negate.loc13: init f64 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.11] +// CHECK:STDOUT: %.loc13_23.1: f64 = value_of_initializer %float.negate.loc13 [template = constants.%.11] +// CHECK:STDOUT: %.loc13_23.2: f64 = converted %float.negate.loc13, %.loc13_23.1 [template = constants.%.11] +// CHECK:STDOUT: %float.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.10] +// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %float.less_eq.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_14.2: bool = converted %float.less_eq.loc13, %.loc13_14.1 [template = constants.%.10] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index dc787b039f1fa..c242b7f458cab 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -46,14 +46,15 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %Neq: %Neq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: f64 = float_literal 1 [template] -// CHECK:STDOUT: %.6: f64 = float_literal 2 [template] -// CHECK:STDOUT: %.7: bool = bool_literal true [template] -// CHECK:STDOUT: %.8: bool = bool_literal false [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: f64 = float_literal 1 [template] +// CHECK:STDOUT: %.7: f64 = float_literal 2 [template] +// CHECK:STDOUT: %.8: bool = bool_literal true [template] +// CHECK:STDOUT: %.9: bool = bool_literal false [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -134,11 +135,15 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -153,11 +158,11 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %.loc8_20: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc8_25: f64 = float_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %float.neq.loc8: init bool = call %Neq.ref.loc8(%.loc8_20, %.loc8_25) [template = constants.%.7] -// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %float.neq.loc8 [template = constants.%.7] -// CHECK:STDOUT: %.loc8_13.2: bool = converted %float.neq.loc8, %.loc8_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc8_20: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc8_25: f64 = float_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %float.neq.loc8: init bool = call %Neq.ref.loc8(%.loc8_20, %.loc8_25) [template = constants.%.8] +// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %float.neq.loc8 [template = constants.%.8] +// CHECK:STDOUT: %.loc8_13.2: bool = converted %float.neq.loc8, %.loc8_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc8_13.2 br !if.expr.then.loc8 else br !if.expr.else.loc8 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8: @@ -172,11 +177,11 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %.loc8_13.3: type = block_arg !if.expr.result.loc8 [template = constants.%True] // CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ // CHECK:STDOUT: %Neq.ref.loc9: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %.loc9_21: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_26: f64 = float_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %float.neq.loc9: init bool = call %Neq.ref.loc9(%.loc9_21, %.loc9_26) [template = constants.%.8] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %float.neq.loc9 [template = constants.%.8] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %float.neq.loc9, %.loc9_14.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_21: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_26: f64 = float_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %float.neq.loc9: init bool = call %Neq.ref.loc9(%.loc9_21, %.loc9_26) [template = constants.%.9] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %float.neq.loc9 [template = constants.%.9] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %float.neq.loc9, %.loc9_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 617100b3b910a..fa72169032c12 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -45,14 +45,15 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %Eq: %Eq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: bool = bool_literal true [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.7: bool = bool_literal false [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: bool = bool_literal true [template] +// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.8: bool = bool_literal false [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -129,11 +130,15 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -148,11 +153,11 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Eq.ref.loc8: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %.loc8_19: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc8_22: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.eq.loc8: init bool = call %Eq.ref.loc8(%.loc8_19, %.loc8_22) [template = constants.%.5] -// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %int.eq.loc8 [template = constants.%.5] -// CHECK:STDOUT: %.loc8_13.2: bool = converted %int.eq.loc8, %.loc8_13.1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_19: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_22: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.eq.loc8: init bool = call %Eq.ref.loc8(%.loc8_19, %.loc8_22) [template = constants.%.6] +// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %int.eq.loc8 [template = constants.%.6] +// CHECK:STDOUT: %.loc8_13.2: bool = converted %int.eq.loc8, %.loc8_13.1 [template = constants.%.6] // CHECK:STDOUT: if %.loc8_13.2 br !if.expr.then.loc8 else br !if.expr.else.loc8 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8: @@ -167,11 +172,11 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %.loc8_13.3: type = block_arg !if.expr.result.loc8 [template = constants.%True] // CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ // CHECK:STDOUT: %Eq.ref.loc9: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %.loc9_20: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_23: i32 = int_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %int.eq.loc9: init bool = call %Eq.ref.loc9(%.loc9_20, %.loc9_23) [template = constants.%.7] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.eq.loc9 [template = constants.%.7] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.eq.loc9, %.loc9_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_20: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_23: i32 = int_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %int.eq.loc9: init bool = call %Eq.ref.loc9(%.loc9_20, %.loc9_23) [template = constants.%.8] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.eq.loc9 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.eq.loc9, %.loc9_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index f5cf1c6df2995..b1554ad82b9be 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -42,16 +42,17 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.6: bool = bool_literal false [template] -// CHECK:STDOUT: %.7: i32 = int_literal 0 [template] -// CHECK:STDOUT: %.8: bool = bool_literal true [template] -// CHECK:STDOUT: %.9: i32 = int_literal -1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.7: bool = bool_literal false [template] +// CHECK:STDOUT: %.8: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.9: bool = bool_literal true [template] +// CHECK:STDOUT: %.10: i32 = int_literal -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -140,11 +141,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -161,11 +166,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc9: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc9_25: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_28: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %int.greater.loc9: init bool = call %Greater.ref.loc9(%.loc9_25, %.loc9_28) [template = constants.%.6] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater.loc9 [template = constants.%.6] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater.loc9, %.loc9_14.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_25: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_28: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %int.greater.loc9: init bool = call %Greater.ref.loc9(%.loc9_25, %.loc9_28) [template = constants.%.7] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater.loc9 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater.loc9, %.loc9_14.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -180,11 +185,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] // CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc10: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc10_25: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_28: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.greater.loc10: init bool = call %Greater.ref.loc10(%.loc10_25, %.loc10_28) [template = constants.%.6] -// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.greater.loc10 [template = constants.%.6] -// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.greater.loc10, %.loc10_14.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc10_25: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_28: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.greater.loc10: init bool = call %Greater.ref.loc10(%.loc10_25, %.loc10_28) [template = constants.%.7] +// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.greater.loc10 [template = constants.%.7] +// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.greater.loc10, %.loc10_14.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc10_14.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -199,11 +204,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ // CHECK:STDOUT: %Greater.ref.loc11: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_27: i32 = int_literal 0 [template = constants.%.7] -// CHECK:STDOUT: %int.greater.loc11: init bool = call %Greater.ref.loc11(%.loc11_24, %.loc11_27) [template = constants.%.8] -// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater.loc11 [template = constants.%.8] -// CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater.loc11, %.loc11_13.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_27: i32 = int_literal 0 [template = constants.%.8] +// CHECK:STDOUT: %int.greater.loc11: init bool = call %Greater.ref.loc11(%.loc11_24, %.loc11_27) [template = constants.%.9] +// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater.loc11 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater.loc11, %.loc11_13.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc11_13.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -219,14 +224,14 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ // CHECK:STDOUT: %Greater.ref.loc12: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_32: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_32) [template = constants.%.9] -// CHECK:STDOUT: %.loc12_36: i32 = int_literal 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_24.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_24.2: i32 = converted %int.snegate.loc12, %.loc12_24.1 [template = constants.%.9] -// CHECK:STDOUT: %int.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_24.2, %.loc12_36) [template = constants.%.6] -// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater.loc12 [template = constants.%.6] -// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater.loc12, %.loc12_14.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_32: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_32) [template = constants.%.10] +// CHECK:STDOUT: %.loc12_36: i32 = int_literal 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc12_24.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_24.2: i32 = converted %int.snegate.loc12, %.loc12_24.1 [template = constants.%.10] +// CHECK:STDOUT: %int.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_24.2, %.loc12_36) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater.loc12 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater.loc12, %.loc12_14.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -241,15 +246,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ // CHECK:STDOUT: %Greater.ref.loc13: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] -// CHECK:STDOUT: %.loc13_24: i32 = int_literal 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_24: i32 = int_literal 0 [template = constants.%.8] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_34: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.9] -// CHECK:STDOUT: %.loc13_23.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_23.2: i32 = converted %int.snegate.loc13, %.loc13_23.1 [template = constants.%.9] -// CHECK:STDOUT: %int.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.8] -// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater.loc13 [template = constants.%.8] -// CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater.loc13, %.loc13_13.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_34: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.10] +// CHECK:STDOUT: %.loc13_23.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_23.2: i32 = converted %int.snegate.loc13, %.loc13_23.1 [template = constants.%.10] +// CHECK:STDOUT: %int.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater.loc13 [template = constants.%.9] +// CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater.loc13, %.loc13_13.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index b266c0a3a074f..fff5948a45862 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -42,16 +42,17 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.6: bool = bool_literal false [template] -// CHECK:STDOUT: %.7: bool = bool_literal true [template] -// CHECK:STDOUT: %.8: i32 = int_literal 0 [template] -// CHECK:STDOUT: %.9: i32 = int_literal -1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.7: bool = bool_literal false [template] +// CHECK:STDOUT: %.8: bool = bool_literal true [template] +// CHECK:STDOUT: %.9: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.10: i32 = int_literal -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -140,11 +141,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -161,11 +166,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc9: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc9_27: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_30: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %int.greater_eq.loc9: init bool = call %GreaterEq.ref.loc9(%.loc9_27, %.loc9_30) [template = constants.%.6] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater_eq.loc9 [template = constants.%.6] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater_eq.loc9, %.loc9_14.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_27: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_30: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %int.greater_eq.loc9: init bool = call %GreaterEq.ref.loc9(%.loc9_27, %.loc9_30) [template = constants.%.7] +// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater_eq.loc9 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater_eq.loc9, %.loc9_14.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -180,11 +185,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc10: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc10: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc10_26: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_29: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.greater_eq.loc10: init bool = call %GreaterEq.ref.loc10(%.loc10_26, %.loc10_29) [template = constants.%.7] -// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.greater_eq.loc10 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.greater_eq.loc10, %.loc10_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc10_26: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_29: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.greater_eq.loc10: init bool = call %GreaterEq.ref.loc10(%.loc10_26, %.loc10_29) [template = constants.%.8] +// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.greater_eq.loc10 [template = constants.%.8] +// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.greater_eq.loc10, %.loc10_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc10_13.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -199,11 +204,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc10_13.3: type = block_arg !if.expr.result.loc10 [template = constants.%True] // CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc11: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc11_26: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_29: i32 = int_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %int.greater_eq.loc11: init bool = call %GreaterEq.ref.loc11(%.loc11_26, %.loc11_29) [template = constants.%.7] -// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater_eq.loc11 [template = constants.%.7] -// CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater_eq.loc11, %.loc11_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_26: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_29: i32 = int_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %int.greater_eq.loc11: init bool = call %GreaterEq.ref.loc11(%.loc11_26, %.loc11_29) [template = constants.%.8] +// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater_eq.loc11 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater_eq.loc11, %.loc11_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc11_13.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -219,14 +224,14 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ // CHECK:STDOUT: %GreaterEq.ref.loc12: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_34: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_34) [template = constants.%.9] -// CHECK:STDOUT: %.loc12_38: i32 = int_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc12_26.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_26.2: i32 = converted %int.snegate.loc12, %.loc12_26.1 [template = constants.%.9] -// CHECK:STDOUT: %int.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_26.2, %.loc12_38) [template = constants.%.6] -// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater_eq.loc12 [template = constants.%.6] -// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater_eq.loc12, %.loc12_14.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_34: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_34) [template = constants.%.10] +// CHECK:STDOUT: %.loc12_38: i32 = int_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %.loc12_26.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_26.2: i32 = converted %int.snegate.loc12, %.loc12_26.1 [template = constants.%.10] +// CHECK:STDOUT: %int.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_26.2, %.loc12_38) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater_eq.loc12 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater_eq.loc12, %.loc12_14.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -241,15 +246,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] // CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ // CHECK:STDOUT: %GreaterEq.ref.loc13: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %.loc13_26: i32 = int_literal 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_26: i32 = int_literal 0 [template = constants.%.9] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_36: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.9] -// CHECK:STDOUT: %.loc13_25.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_25.2: i32 = converted %int.snegate.loc13, %.loc13_25.1 [template = constants.%.9] -// CHECK:STDOUT: %int.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26, %.loc13_25.2) [template = constants.%.7] -// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater_eq.loc13 [template = constants.%.7] -// CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater_eq.loc13, %.loc13_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_36: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_36) [template = constants.%.10] +// CHECK:STDOUT: %.loc13_25.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_25.2: i32 = converted %int.snegate.loc13, %.loc13_25.1 [template = constants.%.10] +// CHECK:STDOUT: %int.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26, %.loc13_25.2) [template = constants.%.8] +// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater_eq.loc13 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater_eq.loc13, %.loc13_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index 729c6402c7ff9..24e50e9d9c1f6 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -42,16 +42,17 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.6: bool = bool_literal true [template] -// CHECK:STDOUT: %.7: bool = bool_literal false [template] -// CHECK:STDOUT: %.8: i32 = int_literal 0 [template] -// CHECK:STDOUT: %.9: i32 = int_literal -1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.7: bool = bool_literal true [template] +// CHECK:STDOUT: %.8: bool = bool_literal false [template] +// CHECK:STDOUT: %.9: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.10: i32 = int_literal -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -140,11 +141,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -161,11 +166,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc9: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc9_21: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_24: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %int.less.loc9: init bool = call %Less.ref.loc9(%.loc9_21, %.loc9_24) [template = constants.%.6] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less.loc9 [template = constants.%.6] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less.loc9, %.loc9_13.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_21: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_24: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %int.less.loc9: init bool = call %Less.ref.loc9(%.loc9_21, %.loc9_24) [template = constants.%.7] +// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less.loc9 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less.loc9, %.loc9_13.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -180,11 +185,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc10: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc10_22: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_25: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.less.loc10: init bool = call %Less.ref.loc10(%.loc10_22, %.loc10_25) [template = constants.%.7] -// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.less.loc10 [template = constants.%.7] -// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.less.loc10, %.loc10_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc10_22: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_25: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.less.loc10: init bool = call %Less.ref.loc10(%.loc10_22, %.loc10_25) [template = constants.%.8] +// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.less.loc10 [template = constants.%.8] +// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.less.loc10, %.loc10_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc10_14.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -199,11 +204,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] // CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc11: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc11_22: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_25: i32 = int_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %int.less.loc11: init bool = call %Less.ref.loc11(%.loc11_22, %.loc11_25) [template = constants.%.7] -// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less.loc11 [template = constants.%.7] -// CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less.loc11, %.loc11_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc11_22: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_25: i32 = int_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %int.less.loc11: init bool = call %Less.ref.loc11(%.loc11_22, %.loc11_25) [template = constants.%.8] +// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less.loc11 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less.loc11, %.loc11_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc11_14.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -219,14 +224,14 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ // CHECK:STDOUT: %Less.ref.loc12: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_28: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_28) [template = constants.%.9] -// CHECK:STDOUT: %.loc12_32: i32 = int_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc12_20.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_20.2: i32 = converted %int.snegate.loc12, %.loc12_20.1 [template = constants.%.9] -// CHECK:STDOUT: %int.less.loc12: init bool = call %Less.ref.loc12(%.loc12_20.2, %.loc12_32) [template = constants.%.6] -// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less.loc12 [template = constants.%.6] -// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less.loc12, %.loc12_13.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_28: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_28) [template = constants.%.10] +// CHECK:STDOUT: %.loc12_32: i32 = int_literal 0 [template = constants.%.9] +// CHECK:STDOUT: %.loc12_20.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_20.2: i32 = converted %int.snegate.loc12, %.loc12_20.1 [template = constants.%.10] +// CHECK:STDOUT: %int.less.loc12: init bool = call %Less.ref.loc12(%.loc12_20.2, %.loc12_32) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less.loc12 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less.loc12, %.loc12_13.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -241,15 +246,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ // CHECK:STDOUT: %Less.ref.loc13: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] -// CHECK:STDOUT: %.loc13_22: i32 = int_literal 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_22: i32 = int_literal 0 [template = constants.%.9] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_32: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_32) [template = constants.%.9] -// CHECK:STDOUT: %.loc13_21.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_21.2: i32 = converted %int.snegate.loc13, %.loc13_21.1 [template = constants.%.9] -// CHECK:STDOUT: %int.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22, %.loc13_21.2) [template = constants.%.7] -// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less.loc13 [template = constants.%.7] -// CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less.loc13, %.loc13_14.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_32: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_32) [template = constants.%.10] +// CHECK:STDOUT: %.loc13_21.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_21.2: i32 = converted %int.snegate.loc13, %.loc13_21.1 [template = constants.%.10] +// CHECK:STDOUT: %int.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22, %.loc13_21.2) [template = constants.%.8] +// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less.loc13 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less.loc13, %.loc13_14.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 0f543b38db8d7..ffd516ca3b78c 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -42,16 +42,17 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.6: bool = bool_literal true [template] -// CHECK:STDOUT: %.7: i32 = int_literal 0 [template] -// CHECK:STDOUT: %.8: bool = bool_literal false [template] -// CHECK:STDOUT: %.9: i32 = int_literal -1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.7: bool = bool_literal true [template] +// CHECK:STDOUT: %.8: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.9: bool = bool_literal false [template] +// CHECK:STDOUT: %.10: i32 = int_literal -1 [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -140,11 +141,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -161,11 +166,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc9: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc9_23: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_26: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %int.less_eq.loc9: init bool = call %LessEq.ref.loc9(%.loc9_23, %.loc9_26) [template = constants.%.6] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less_eq.loc9 [template = constants.%.6] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less_eq.loc9, %.loc9_13.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_23: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_26: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %int.less_eq.loc9: init bool = call %LessEq.ref.loc9(%.loc9_23, %.loc9_26) [template = constants.%.7] +// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less_eq.loc9 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less_eq.loc9, %.loc9_13.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: @@ -180,11 +185,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] // CHECK:STDOUT: %true_.ref.loc10: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc10: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc10_23: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_26: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.less_eq.loc10: init bool = call %LessEq.ref.loc10(%.loc10_23, %.loc10_26) [template = constants.%.6] -// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.less_eq.loc10 [template = constants.%.6] -// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.less_eq.loc10, %.loc10_13.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc10_23: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_26: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.less_eq.loc10: init bool = call %LessEq.ref.loc10(%.loc10_23, %.loc10_26) [template = constants.%.7] +// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.less_eq.loc10 [template = constants.%.7] +// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.less_eq.loc10, %.loc10_13.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc10_13.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc10: @@ -199,11 +204,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc10_13.3: type = block_arg !if.expr.result.loc10 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ // CHECK:STDOUT: %LessEq.ref.loc11: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc11_27: i32 = int_literal 0 [template = constants.%.7] -// CHECK:STDOUT: %int.less_eq.loc11: init bool = call %LessEq.ref.loc11(%.loc11_24, %.loc11_27) [template = constants.%.8] -// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less_eq.loc11 [template = constants.%.8] -// CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less_eq.loc11, %.loc11_14.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc11_24: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_27: i32 = int_literal 0 [template = constants.%.8] +// CHECK:STDOUT: %int.less_eq.loc11: init bool = call %LessEq.ref.loc11(%.loc11_24, %.loc11_27) [template = constants.%.9] +// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less_eq.loc11 [template = constants.%.9] +// CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less_eq.loc11, %.loc11_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc11_14.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc11: @@ -219,14 +224,14 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ // CHECK:STDOUT: %LessEq.ref.loc12: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc12_30: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_30) [template = constants.%.9] -// CHECK:STDOUT: %.loc12_34: i32 = int_literal 0 [template = constants.%.7] -// CHECK:STDOUT: %.loc12_22.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.9] -// CHECK:STDOUT: %.loc12_22.2: i32 = converted %int.snegate.loc12, %.loc12_22.1 [template = constants.%.9] -// CHECK:STDOUT: %int.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_22.2, %.loc12_34) [template = constants.%.6] -// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less_eq.loc12 [template = constants.%.6] -// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less_eq.loc12, %.loc12_13.1 [template = constants.%.6] +// CHECK:STDOUT: %.loc12_30: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc12: init i32 = call %Negate.ref.loc12(%.loc12_30) [template = constants.%.10] +// CHECK:STDOUT: %.loc12_34: i32 = int_literal 0 [template = constants.%.8] +// CHECK:STDOUT: %.loc12_22.1: i32 = value_of_initializer %int.snegate.loc12 [template = constants.%.10] +// CHECK:STDOUT: %.loc12_22.2: i32 = converted %int.snegate.loc12, %.loc12_22.1 [template = constants.%.10] +// CHECK:STDOUT: %int.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_22.2, %.loc12_34) [template = constants.%.7] +// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less_eq.loc12 [template = constants.%.7] +// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less_eq.loc12, %.loc12_13.1 [template = constants.%.7] // CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc12: @@ -241,15 +246,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] // CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ // CHECK:STDOUT: %LessEq.ref.loc13: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %.loc13_24: i32 = int_literal 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_24: i32 = int_literal 0 [template = constants.%.8] // CHECK:STDOUT: %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %.loc13_34: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.9] -// CHECK:STDOUT: %.loc13_23.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.9] -// CHECK:STDOUT: %.loc13_23.2: i32 = converted %int.snegate.loc13, %.loc13_23.1 [template = constants.%.9] -// CHECK:STDOUT: %int.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.8] -// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less_eq.loc13 [template = constants.%.8] -// CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less_eq.loc13, %.loc13_14.1 [template = constants.%.8] +// CHECK:STDOUT: %.loc13_34: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.snegate.loc13: init i32 = call %Negate.ref.loc13(%.loc13_34) [template = constants.%.10] +// CHECK:STDOUT: %.loc13_23.1: i32 = value_of_initializer %int.snegate.loc13 [template = constants.%.10] +// CHECK:STDOUT: %.loc13_23.2: i32 = converted %int.snegate.loc13, %.loc13_23.1 [template = constants.%.10] +// CHECK:STDOUT: %int.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24, %.loc13_23.2) [template = constants.%.9] +// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less_eq.loc13 [template = constants.%.9] +// CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less_eq.loc13, %.loc13_14.1 [template = constants.%.9] // CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc13: diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index 7f476dd221d14..73762b33b68d2 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -36,14 +36,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %Neq: %Neq.type = struct_value () [template] // CHECK:STDOUT: %True: type = class_type @True [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %False: type = class_type @False [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: bool = bool_literal false [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.7: bool = bool_literal true [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: bool = bool_literal false [template] +// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.8: bool = bool_literal true [template] // CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } @@ -120,11 +121,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @True { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%True // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @False { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%False // CHECK:STDOUT: } @@ -139,11 +144,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ // CHECK:STDOUT: %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %.loc8_21: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc8_24: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %int.neq.loc8: init bool = call %Neq.ref.loc8(%.loc8_21, %.loc8_24) [template = constants.%.5] -// CHECK:STDOUT: %.loc8_14.1: bool = value_of_initializer %int.neq.loc8 [template = constants.%.5] -// CHECK:STDOUT: %.loc8_14.2: bool = converted %int.neq.loc8, %.loc8_14.1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_21: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc8_24: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %int.neq.loc8: init bool = call %Neq.ref.loc8(%.loc8_21, %.loc8_24) [template = constants.%.6] +// CHECK:STDOUT: %.loc8_14.1: bool = value_of_initializer %int.neq.loc8 [template = constants.%.6] +// CHECK:STDOUT: %.loc8_14.2: bool = converted %int.neq.loc8, %.loc8_14.1 [template = constants.%.6] // CHECK:STDOUT: if %.loc8_14.2 br !if.expr.then.loc8 else br !if.expr.else.loc8 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc8: @@ -158,11 +163,11 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc8_14.3: type = block_arg !if.expr.result.loc8 [template = constants.%False] // CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ // CHECK:STDOUT: %Neq.ref.loc9: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %.loc9_20: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_23: i32 = int_literal 2 [template = constants.%.6] -// CHECK:STDOUT: %int.neq.loc9: init bool = call %Neq.ref.loc9(%.loc9_20, %.loc9_23) [template = constants.%.7] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.neq.loc9 [template = constants.%.7] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.neq.loc9, %.loc9_13.1 [template = constants.%.7] +// CHECK:STDOUT: %.loc9_20: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_23: i32 = int_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %int.neq.loc9: init bool = call %Neq.ref.loc9(%.loc9_20, %.loc9_23) [template = constants.%.8] +// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.neq.loc9 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.neq.loc9, %.loc9_13.1 [template = constants.%.8] // CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 // CHECK:STDOUT: // CHECK:STDOUT: !if.expr.then.loc9: diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index ab035420c1932..76895b6e424a8 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -159,8 +159,9 @@ class A { // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] // CHECK:STDOUT: %.4: type = struct_type {.radius: i32} [template] -// CHECK:STDOUT: %.5: i32 = int_literal 0 [template] -// CHECK:STDOUT: %.6: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.4 [template] // CHECK:STDOUT: %struct: %Circle = struct_value (%.3) [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] @@ -212,6 +213,7 @@ class A { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %return.var.loc12: ref %Circle = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc15: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -225,7 +227,7 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @SomeInternalFunction() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9: i32 = int_literal 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc9: i32 = int_literal 0 [template = constants.%.6] // CHECK:STDOUT: return %.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -276,9 +278,10 @@ class A { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %A, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -312,6 +315,7 @@ class A { // CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_32, %.loc5_20.1 [template = i32] // CHECK:STDOUT: %.loc5_18: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -346,8 +350,9 @@ class A { // CHECK:STDOUT: %Compute.type: type = fn_type @Compute [template] // CHECK:STDOUT: %Compute: %Compute.type = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {.radius: i32} [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -403,6 +408,7 @@ class A { // CHECK:STDOUT: %.loc15_31.2: type = converted %int.make_type_32.loc15, %.loc15_31.1 [template = i32] // CHECK:STDOUT: %return.var.loc15: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc18: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -425,7 +431,7 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @SomeInternalFunction() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12: i32 = int_literal 0 [template = constants.%.5] +// CHECK:STDOUT: %.loc12: i32 = int_literal 0 [template = constants.%.6] // CHECK:STDOUT: return %.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -448,7 +454,8 @@ class A { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: i32 = int_literal 5 [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -485,6 +492,7 @@ class A { // CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32, %.loc5_10.1 [template = i32] // CHECK:STDOUT: %.loc5_16: i32 = int_literal 5 [template = constants.%.2] // CHECK:STDOUT: %x: i32 = bind_name x, %.loc5_16 +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -510,7 +518,8 @@ class A { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: i32 = int_literal 5 [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -556,6 +565,7 @@ class A { // CHECK:STDOUT: %.loc6_18.2: type = converted %int.make_type_32.loc6, %.loc6_18.1 [template = i32] // CHECK:STDOUT: %.loc6_24: i32 = int_literal 5 [template = constants.%.2] // CHECK:STDOUT: %y: i32 = bind_name y, %.loc6_24 +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -586,7 +596,8 @@ class A { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -614,6 +625,7 @@ class A { // CHECK:STDOUT: class @A { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index 78c30f8a5c13f..e1947841ebbc6 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -54,8 +54,10 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %SomeClass, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: = complete_type_witness %SomeClass [template] // CHECK:STDOUT: %StructAdapter: type = class_type @StructAdapter [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -96,6 +98,7 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] // CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass @@ -106,6 +109,7 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass +// CHECK:STDOUT: %.loc11: = complete_type_witness %SomeClass [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter @@ -120,6 +124,7 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %.loc14_23.2: type = converted %int.make_type_32.loc14_23, %.loc14_23.1 [template = i32] // CHECK:STDOUT: %.loc14_26: type = struct_type {.a: i32, .b: i32} [template = constants.%.3] // CHECK:STDOUT: adapt_decl %.3 +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%StructAdapter @@ -135,8 +140,10 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %AdaptNotExtend: type = class_type @AdaptNotExtend [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %Adapted [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: } @@ -173,6 +180,7 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: // CHECK:STDOUT: class @Adapted { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Adapted @@ -182,6 +190,7 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: class @AdaptNotExtend { // CHECK:STDOUT: %Adapted.ref: type = name_ref Adapted, file.%Adapted.decl [template = constants.%Adapted] // CHECK:STDOUT: adapt_decl %Adapted +// CHECK:STDOUT: %.loc10: = complete_type_witness %Adapted [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptNotExtend diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index 5f2f33856b412..369f8670c5ef6 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -35,26 +35,28 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Base, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Base, .d: i32} [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Base, .d: i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %.4, .d: i32} [template] -// CHECK:STDOUT: %.9: type = ptr_type %.8 [template] -// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] -// CHECK:STDOUT: %.11: i32 = int_literal 4 [template] -// CHECK:STDOUT: %.12: i32 = int_literal 7 [template] -// CHECK:STDOUT: %.13: type = struct_type {.base: %.3, .d: i32} [template] -// CHECK:STDOUT: %struct.1: %Base = struct_value (%.11) [template] -// CHECK:STDOUT: %struct.2: %Derived = struct_value (%struct.1, %.12) [template] -// CHECK:STDOUT: %.14: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %.15: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %.10: type = struct_type {.base: %.5, .d: i32} [template] +// CHECK:STDOUT: %.11: type = ptr_type %.10 [template] +// CHECK:STDOUT: %.12: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.13: i32 = int_literal 4 [template] +// CHECK:STDOUT: %.14: i32 = int_literal 7 [template] +// CHECK:STDOUT: %.15: type = struct_type {.base: %.3, .d: i32} [template] +// CHECK:STDOUT: %struct.1: %Base = struct_value (%.13) [template] +// CHECK:STDOUT: %struct.2: %Derived = struct_value (%struct.1, %.14) [template] +// CHECK:STDOUT: %.16: type = tuple_type (type, type) [template] +// CHECK:STDOUT: %.17: type = tuple_type (i32, i32) [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] -// CHECK:STDOUT: %.16: type = ptr_type %.15 [template] +// CHECK:STDOUT: %.18: type = ptr_type %.17 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -93,13 +95,13 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: @Access.%d: %Derived = bind_name d, %d.loc25_11.1 // CHECK:STDOUT: %int.make_type_32.loc25_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc25_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc25_35.1: %.14 = tuple_literal (%int.make_type_32.loc25_27, %int.make_type_32.loc25_32) +// CHECK:STDOUT: %.loc25_35.1: %.16 = tuple_literal (%int.make_type_32.loc25_27, %int.make_type_32.loc25_32) // CHECK:STDOUT: %.loc25_35.2: type = value_of_initializer %int.make_type_32.loc25_27 [template = i32] // CHECK:STDOUT: %.loc25_35.3: type = converted %int.make_type_32.loc25_27, %.loc25_35.2 [template = i32] // CHECK:STDOUT: %.loc25_35.4: type = value_of_initializer %int.make_type_32.loc25_32 [template = i32] // CHECK:STDOUT: %.loc25_35.5: type = converted %int.make_type_32.loc25_32, %.loc25_35.4 [template = i32] -// CHECK:STDOUT: %.loc25_35.6: type = converted %.loc25_35.1, constants.%.15 [template = constants.%.15] -// CHECK:STDOUT: @Access.%return: ref %.15 = var +// CHECK:STDOUT: %.loc25_35.6: type = converted %.loc25_35.1, constants.%.17 [template = constants.%.17] +// CHECK:STDOUT: @Access.%return: ref %.17 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -108,6 +110,7 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -116,11 +119,12 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc16: %.5 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc16: %.6 = base_decl %Base, element0 [template] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_32, %.loc18_10.1 [template = i32] -// CHECK:STDOUT: %.loc18_8: %.6 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc18_8: %.7 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -133,42 +137,42 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: %Derived { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22_25: i32 = int_literal 4 [template = constants.%.11] +// CHECK:STDOUT: %.loc22_25: i32 = int_literal 4 [template = constants.%.13] // CHECK:STDOUT: %.loc22_26.1: %.3 = struct_literal (%.loc22_25) -// CHECK:STDOUT: %.loc22_34: i32 = int_literal 7 [template = constants.%.12] -// CHECK:STDOUT: %.loc22_35.1: %.13 = struct_literal (%.loc22_26.1, %.loc22_34) +// CHECK:STDOUT: %.loc22_34: i32 = int_literal 7 [template = constants.%.14] +// CHECK:STDOUT: %.loc22_35.1: %.15 = struct_literal (%.loc22_26.1, %.loc22_34) // CHECK:STDOUT: %.loc22_35.2: ref %Base = class_element_access %return, element0 // CHECK:STDOUT: %.loc22_26.2: ref i32 = class_element_access %.loc22_35.2, element0 -// CHECK:STDOUT: %.loc22_26.3: init i32 = initialize_from %.loc22_25 to %.loc22_26.2 [template = constants.%.11] +// CHECK:STDOUT: %.loc22_26.3: init i32 = initialize_from %.loc22_25 to %.loc22_26.2 [template = constants.%.13] // CHECK:STDOUT: %.loc22_26.4: init %Base = class_init (%.loc22_26.3), %.loc22_35.2 [template = constants.%struct.1] // CHECK:STDOUT: %.loc22_35.3: init %Base = converted %.loc22_26.1, %.loc22_26.4 [template = constants.%struct.1] // CHECK:STDOUT: %.loc22_35.4: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc22_35.5: init i32 = initialize_from %.loc22_34 to %.loc22_35.4 [template = constants.%.12] +// CHECK:STDOUT: %.loc22_35.5: init i32 = initialize_from %.loc22_34 to %.loc22_35.4 [template = constants.%.14] // CHECK:STDOUT: %.loc22_35.6: init %Derived = class_init (%.loc22_35.3, %.loc22_35.5), %return [template = constants.%struct.2] // CHECK:STDOUT: %.loc22_36: init %Derived = converted %.loc22_35.1, %.loc22_35.6 [template = constants.%struct.2] // CHECK:STDOUT: return %.loc22_36 to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Access(%d: %Derived) -> %return: %.15 { +// CHECK:STDOUT: fn @Access(%d: %Derived) -> %return: %.17 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc26_11: %Derived = name_ref d, %d -// CHECK:STDOUT: %d.ref.loc26_12: %.6 = name_ref d, @Derived.%.loc18_8 [template = @Derived.%.loc18_8] +// CHECK:STDOUT: %d.ref.loc26_12: %.7 = name_ref d, @Derived.%.loc18_8 [template = @Derived.%.loc18_8] // CHECK:STDOUT: %.loc26_12.1: ref i32 = class_element_access %d.ref.loc26_11, element1 // CHECK:STDOUT: %.loc26_12.2: i32 = bind_value %.loc26_12.1 // CHECK:STDOUT: %d.ref.loc26_16: %Derived = name_ref d, %d -// CHECK:STDOUT: %base.ref: %.5 = name_ref base, @Derived.%.loc16 [template = @Derived.%.loc16] +// CHECK:STDOUT: %base.ref: %.6 = name_ref base, @Derived.%.loc16 [template = @Derived.%.loc16] // CHECK:STDOUT: %.loc26_17.1: ref %Base = class_element_access %d.ref.loc26_16, element0 // CHECK:STDOUT: %.loc26_17.2: %Base = bind_value %.loc26_17.1 // CHECK:STDOUT: %b.ref: %.2 = name_ref b, @Base.%.loc12_8 [template = @Base.%.loc12_8] // CHECK:STDOUT: %.loc26_22.1: ref i32 = class_element_access %.loc26_17.2, element0 // CHECK:STDOUT: %.loc26_22.2: i32 = bind_value %.loc26_22.1 -// CHECK:STDOUT: %.loc26_24.1: %.15 = tuple_literal (%.loc26_12.2, %.loc26_22.2) +// CHECK:STDOUT: %.loc26_24.1: %.17 = tuple_literal (%.loc26_12.2, %.loc26_22.2) // CHECK:STDOUT: %.loc26_24.2: ref i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc26_24.3: init i32 = initialize_from %.loc26_12.2 to %.loc26_24.2 // CHECK:STDOUT: %.loc26_24.4: ref i32 = tuple_access %return, element1 // CHECK:STDOUT: %.loc26_24.5: init i32 = initialize_from %.loc26_22.2 to %.loc26_24.4 -// CHECK:STDOUT: %.loc26_24.6: init %.15 = tuple_init (%.loc26_24.3, %.loc26_24.5) to %return -// CHECK:STDOUT: %.loc26_25: init %.15 = converted %.loc26_24.1, %.loc26_24.6 +// CHECK:STDOUT: %.loc26_24.6: init %.17 = tuple_init (%.loc26_24.3, %.loc26_24.5) to %return +// CHECK:STDOUT: %.loc26_25: init %.17 = converted %.loc26_24.1, %.loc26_24.6 // CHECK:STDOUT: return %.loc26_25 to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index 61399eca8acb5..94a2bee3d5ef3 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -34,18 +34,20 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Base, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32, .c: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Base, .d: i32, .e: i32} [template] -// CHECK:STDOUT: %.8: type = ptr_type %Derived [template] -// CHECK:STDOUT: %.9: type = ptr_type i32 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Base, .d: i32, .e: i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] +// CHECK:STDOUT: %.10: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.11: type = ptr_type i32 [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = struct_type {.base: %.4, .d: i32, .e: i32} [template] -// CHECK:STDOUT: %.11: type = ptr_type %.10 [template] -// CHECK:STDOUT: %.12: type = ptr_type %.7 [template] +// CHECK:STDOUT: %.12: type = struct_type {.base: %.5, .d: i32, .e: i32} [template] +// CHECK:STDOUT: %.13: type = ptr_type %.12 [template] +// CHECK:STDOUT: %.14: type = ptr_type %.8 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,14 +77,14 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc24_21: type = ptr_type %Derived [template = constants.%.8] -// CHECK:STDOUT: %p.loc24_11.1: %.8 = param p, runtime_param0 -// CHECK:STDOUT: @Access.%p: %.8 = bind_name p, %p.loc24_11.1 +// CHECK:STDOUT: %.loc24_21: type = ptr_type %Derived [template = constants.%.10] +// CHECK:STDOUT: %p.loc24_11.1: %.10 = param p, runtime_param0 +// CHECK:STDOUT: @Access.%p: %.10 = bind_name p, %p.loc24_11.1 // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_30.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_30.2: type = converted %int.make_type_32, %.loc24_30.1 [template = i32] -// CHECK:STDOUT: %.loc24_30.3: type = ptr_type i32 [template = constants.%.9] -// CHECK:STDOUT: @Access.%return: ref %.9 = var +// CHECK:STDOUT: %.loc24_30.3: type = ptr_type i32 [template = constants.%.11] +// CHECK:STDOUT: @Access.%return: ref %.11 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -99,6 +101,7 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14, %.loc14_10.1 [template = i32] // CHECK:STDOUT: %.loc14_8: %.2 = field_decl c, element2 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -109,15 +112,16 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc18: %.5 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc18: %.6 = base_decl %Base, element0 [template] // CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_10.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] // CHECK:STDOUT: %.loc20_10.2: type = converted %int.make_type_32.loc20, %.loc20_10.1 [template = i32] -// CHECK:STDOUT: %.loc20_8: %.6 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc20_8: %.7 = field_decl d, element1 [template] // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32.loc21, %.loc21_10.1 [template = i32] -// CHECK:STDOUT: %.loc21_8: %.6 = field_decl e, element2 [template] +// CHECK:STDOUT: %.loc21_8: %.7 = field_decl e, element2 [template] +// CHECK:STDOUT: %.loc22: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -129,15 +133,15 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Access(%p: %.8) -> %.9 { +// CHECK:STDOUT: fn @Access(%p: %.10) -> %.11 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %.loc25_12: ref %Derived = deref %p.ref // CHECK:STDOUT: %c.ref: %.2 = name_ref c, @Base.%.loc14_8 [template = @Base.%.loc14_8] // CHECK:STDOUT: %.loc25_15.1: ref %Base = class_element_access %.loc25_12, element0 // CHECK:STDOUT: %.loc25_15.2: ref %Base = converted %.loc25_12, %.loc25_15.1 // CHECK:STDOUT: %.loc25_15.3: ref i32 = class_element_access %.loc25_15.2, element2 -// CHECK:STDOUT: %.loc25_10: %.9 = addr_of %.loc25_15.3 +// CHECK:STDOUT: %.loc25_10: %.11 = addr_of %.loc25_15.3 // CHECK:STDOUT: return %.loc25_10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/base_function_unqualified.carbon b/toolchain/check/testdata/class/base_function_unqualified.carbon index 36be675257066..b0f5a3680a1e4 100644 --- a/toolchain/check/testdata/class/base_function_unqualified.carbon +++ b/toolchain/check/testdata/class/base_function_unqualified.carbon @@ -31,14 +31,16 @@ fn Derived.H() { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -68,6 +70,7 @@ fn Derived.H() { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -76,9 +79,10 @@ fn Derived.H() { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc16: %.4 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc16: %.5 = base_decl %Base, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} +// CHECK:STDOUT: %.loc20: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 527854420b142..a00ca01a59d2c 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -38,16 +38,18 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.4: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.7: i32 = int_literal 1 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, %Base [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %.9: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.9: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] +// CHECK:STDOUT: %.11: type = ptr_type %Derived [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = struct_type {.base: %.5} [template] -// CHECK:STDOUT: %.11: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.12: type = struct_type {.base: %.6} [template] +// CHECK:STDOUT: %.13: type = ptr_type %.9 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -84,9 +86,9 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc25: type = ptr_type %Derived [template = constants.%.9] -// CHECK:STDOUT: %p.loc25_9.1: %.9 = param p, runtime_param0 -// CHECK:STDOUT: @Call.%p: %.9 = bind_name p, %p.loc25_9.1 +// CHECK:STDOUT: %.loc25: type = ptr_type %Derived [template = constants.%.11] +// CHECK:STDOUT: %p.loc25_9.1: %.11 = param p, runtime_param0 +// CHECK:STDOUT: @Call.%p: %.11 = bind_name p, %p.loc25_9.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -102,6 +104,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %self.loc14_13.3: %.3 = bind_name self, %self.loc14_13.1 // CHECK:STDOUT: %.loc14_8: %.3 = addr_pattern %self.loc14_13.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc15: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -111,7 +114,8 @@ fn Call(p: Derived*) { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc22: %.7 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc22: %.8 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc23: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -127,18 +131,18 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %.loc18_4: ref %Base = deref %self.ref // CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] // CHECK:STDOUT: %.loc18_10: ref i32 = class_element_access %.loc18_4, element0 -// CHECK:STDOUT: %.loc18_15: i32 = int_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc18_15: i32 = int_literal 1 [template = constants.%.7] // CHECK:STDOUT: assign %.loc18_10, %.loc18_15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%p: %.9) { +// CHECK:STDOUT: fn @Call(%p: %.11) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p // CHECK:STDOUT: %.loc26_4.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Base.%F.decl [template = constants.%F] // CHECK:STDOUT: %.loc26_7: = bound_method %.loc26_4.1, %F.ref -// CHECK:STDOUT: %.loc26_4.2: %.9 = addr_of %.loc26_4.1 +// CHECK:STDOUT: %.loc26_4.2: %.11 = addr_of %.loc26_4.1 // CHECK:STDOUT: %.loc26_9.1: ref %Derived = deref %.loc26_4.2 // CHECK:STDOUT: %.loc26_9.2: ref %Base = class_element_access %.loc26_9.1, element0 // CHECK:STDOUT: %.loc26_9.3: %.3 = addr_of %.loc26_9.2 diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index 0e28dc09fb1be..8f99beb95e6f6 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -51,18 +51,20 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %G.type.1: type = fn_type @G.1 [template] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %.3} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] -// CHECK:STDOUT: %.8: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %.4} [template] +// CHECK:STDOUT: %.9: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.10: type = ptr_type %Derived [template] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [template] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [template] // CHECK:STDOUT: %PassDerivedToBase.type: type = fn_type @PassDerivedToBase [template] @@ -111,9 +113,9 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [template = constants.%CallIndirect] { // CHECK:STDOUT: %Derived.ref.loc29: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %.loc29_27: type = ptr_type %Derived [template = constants.%.8] -// CHECK:STDOUT: %p.loc29_17.1: %.8 = param p, runtime_param0 -// CHECK:STDOUT: @CallIndirect.%p: %.8 = bind_name p, %p.loc29_17.1 +// CHECK:STDOUT: %.loc29_27: type = ptr_type %Derived [template = constants.%.10] +// CHECK:STDOUT: %p.loc29_17.1: %.10 = param p, runtime_param0 +// CHECK:STDOUT: @CallIndirect.%p: %.10 = bind_name p, %p.loc29_17.1 // CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_33.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] // CHECK:STDOUT: %.loc29_33.2: type = converted %int.make_type_32.loc29, %.loc29_33.1 [template = i32] @@ -130,9 +132,9 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %PassDerivedToBaseIndirect.decl: %PassDerivedToBaseIndirect.type = fn_decl @PassDerivedToBaseIndirect [template = constants.%PassDerivedToBaseIndirect] { // CHECK:STDOUT: %Derived.ref.loc37: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] -// CHECK:STDOUT: %.loc37_40: type = ptr_type %Derived [template = constants.%.8] -// CHECK:STDOUT: %p.loc37_30.1: %.8 = param p, runtime_param0 -// CHECK:STDOUT: @PassDerivedToBaseIndirect.%p: %.8 = bind_name p, %p.loc37_30.1 +// CHECK:STDOUT: %.loc37_40: type = ptr_type %Derived [template = constants.%.10] +// CHECK:STDOUT: %p.loc37_30.1: %.10 = param p, runtime_param0 +// CHECK:STDOUT: @PassDerivedToBaseIndirect.%p: %.10 = bind_name p, %p.loc37_30.1 // CHECK:STDOUT: %int.make_type_32.loc37: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc37_46.1: type = value_of_initializer %int.make_type_32.loc37 [template = i32] // CHECK:STDOUT: %.loc37_46.2: type = converted %int.make_type_32.loc37, %.loc37_46.1 [template = i32] @@ -142,7 +144,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc19: %.4 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc19: %.5 = base_decl %Base, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Derived [template = constants.%Derived] // CHECK:STDOUT: %self.loc21_8.1: %Derived = param self, runtime_param0 @@ -153,6 +155,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %self.loc22_8.1: %Derived = param self, runtime_param0 // CHECK:STDOUT: %self.loc22_8.2: %Derived = bind_name self, %self.loc22_8.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc23: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -181,6 +184,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc15_28.2: type = converted %int.make_type_32.loc15, %.loc15_28.1 [template = i32] // CHECK:STDOUT: %return.var.loc15: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -213,9 +217,9 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: return %.loc26_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallIndirect(%p: %.8) -> i32 { +// CHECK:STDOUT: fn @CallIndirect(%p: %.10) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @Base.%F.decl [template = constants.%F.1] // CHECK:STDOUT: %.loc30_11.1: ref %Derived = deref %p.ref @@ -241,9 +245,9 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: return %.loc34_22.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @PassDerivedToBaseIndirect(%p: %.8) -> i32 { +// CHECK:STDOUT: fn @PassDerivedToBaseIndirect(%p: %.10) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.10 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %G.ref: %G.type.1 = name_ref G, @Base.%G.decl [template = constants.%G.1] // CHECK:STDOUT: %.loc38_11.1: ref %Derived = deref %p.ref diff --git a/toolchain/check/testdata/class/base_method_shadow.carbon b/toolchain/check/testdata/class/base_method_shadow.carbon index 1797652342f1d..ac9636ac26e63 100644 --- a/toolchain/check/testdata/class/base_method_shadow.carbon +++ b/toolchain/check/testdata/class/base_method_shadow.carbon @@ -42,28 +42,31 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] -// CHECK:STDOUT: %.6: type = ptr_type %B [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.7: type = ptr_type %B [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %.4} [template] -// CHECK:STDOUT: %.9: type = ptr_type %.7 [template] -// CHECK:STDOUT: %.10: type = unbound_element_type %C, %B [template] -// CHECK:STDOUT: %.11: type = ptr_type %C [template] +// CHECK:STDOUT: %.10: type = struct_type {.base: %.5} [template] +// CHECK:STDOUT: %.11: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.12: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.13: type = ptr_type %C [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.12: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.14: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.15: = complete_type_witness %.14 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.13: type = unbound_element_type %D, %B [template] -// CHECK:STDOUT: %.14: type = ptr_type %D [template] +// CHECK:STDOUT: %.16: type = unbound_element_type %D, %B [template] +// CHECK:STDOUT: %.17: type = ptr_type %D [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] -// CHECK:STDOUT: %.15: type = struct_type {.base: %.9} [template] -// CHECK:STDOUT: %.16: type = ptr_type %.12 [template] +// CHECK:STDOUT: %.18: type = struct_type {.base: %.11} [template] +// CHECK:STDOUT: %.19: type = ptr_type %.14 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -99,17 +102,17 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %a.loc29_9.1: %.1 = param a, runtime_param0 // CHECK:STDOUT: @Call.%a: %.1 = bind_name a, %a.loc29_9.1 // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc29_20: type = ptr_type %B [template = constants.%.6] -// CHECK:STDOUT: %b.loc29_16.1: %.6 = param b, runtime_param1 -// CHECK:STDOUT: @Call.%b: %.6 = bind_name b, %b.loc29_16.1 +// CHECK:STDOUT: %.loc29_20: type = ptr_type %B [template = constants.%.7] +// CHECK:STDOUT: %b.loc29_16.1: %.7 = param b, runtime_param1 +// CHECK:STDOUT: @Call.%b: %.7 = bind_name b, %b.loc29_16.1 // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc29_27: type = ptr_type %C [template = constants.%.11] -// CHECK:STDOUT: %c.loc29_23.1: %.11 = param c, runtime_param2 -// CHECK:STDOUT: @Call.%c: %.11 = bind_name c, %c.loc29_23.1 +// CHECK:STDOUT: %.loc29_27: type = ptr_type %C [template = constants.%.13] +// CHECK:STDOUT: %c.loc29_23.1: %.13 = param c, runtime_param2 +// CHECK:STDOUT: @Call.%c: %.13 = bind_name c, %c.loc29_23.1 // CHECK:STDOUT: %D.ref: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %.loc29_34: type = ptr_type %D [template = constants.%.14] -// CHECK:STDOUT: %d.loc29_30.1: %.14 = param d, runtime_param3 -// CHECK:STDOUT: @Call.%d: %.14 = bind_name d, %d.loc29_30.1 +// CHECK:STDOUT: %.loc29_34: type = ptr_type %D [template = constants.%.17] +// CHECK:STDOUT: %d.loc29_30.1: %.17 = param d, runtime_param3 +// CHECK:STDOUT: @Call.%d: %.17 = bind_name d, %d.loc29_30.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -121,6 +124,7 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %self.loc12_13.3: %.1 = bind_name self, %self.loc12_13.1 // CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self.loc12_13.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -129,14 +133,15 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc16: %.5 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc16: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] -// CHECK:STDOUT: %.loc17_23: type = ptr_type %B [template = constants.%.6] -// CHECK:STDOUT: %self.loc17_13.1: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc17_13.3: %.6 = bind_name self, %self.loc17_13.1 -// CHECK:STDOUT: %.loc17_8: %.6 = addr_pattern %self.loc17_13.3 +// CHECK:STDOUT: %.loc17_23: type = ptr_type %B [template = constants.%.7] +// CHECK:STDOUT: %self.loc17_13.1: %.7 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc17_13.3: %.7 = bind_name self, %self.loc17_13.1 +// CHECK:STDOUT: %.loc17_8: %.7 = addr_pattern %self.loc17_13.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc18: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -147,14 +152,15 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc21: %.10 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc21: %.12 = base_decl %B, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] -// CHECK:STDOUT: %.loc22_23: type = ptr_type %C [template = constants.%.11] -// CHECK:STDOUT: %self.loc22_13.1: %.11 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc22_13.3: %.11 = bind_name self, %self.loc22_13.1 -// CHECK:STDOUT: %.loc22_8: %.11 = addr_pattern %self.loc22_13.3 +// CHECK:STDOUT: %.loc22_23: type = ptr_type %C [template = constants.%.13] +// CHECK:STDOUT: %self.loc22_13.1: %.13 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc22_13.3: %.13 = bind_name self, %self.loc22_13.1 +// CHECK:STDOUT: %.loc22_8: %.13 = addr_pattern %self.loc22_13.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc23: = complete_type_witness %.14 [template = constants.%.15] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -165,7 +171,8 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc26: %.13 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc26: %.16 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc27: = complete_type_witness %.14 [template = constants.%.15] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -175,11 +182,11 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1[addr @A.%self.loc12_13.3: %.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2[addr @B.%self.loc17_13.3: %.6](); +// CHECK:STDOUT: fn @F.2[addr @B.%self.loc17_13.3: %.7](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.3[addr @C.%self.loc22_13.3: %.11](); +// CHECK:STDOUT: fn @F.3[addr @C.%self.loc22_13.3: %.13](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%a: %.1, %b: %.6, %c: %.11, %d: %.14) { +// CHECK:STDOUT: fn @Call(%a: %.1, %b: %.7, %c: %.13, %d: %.17) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %.1 = name_ref a, %a // CHECK:STDOUT: %.loc30_4.1: ref %A = deref %a.ref @@ -187,27 +194,27 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %.loc30_7: = bound_method %.loc30_4.1, %F.ref.loc30 // CHECK:STDOUT: %.loc30_4.2: %.1 = addr_of %.loc30_4.1 // CHECK:STDOUT: %F.call.loc30: init %.2 = call %.loc30_7(%.loc30_4.2) -// CHECK:STDOUT: %b.ref: %.6 = name_ref b, %b +// CHECK:STDOUT: %b.ref: %.7 = name_ref b, %b // CHECK:STDOUT: %.loc31_4.1: ref %B = deref %b.ref // CHECK:STDOUT: %F.ref.loc31: %F.type.2 = name_ref F, @B.%F.decl [template = constants.%F.2] // CHECK:STDOUT: %.loc31_7: = bound_method %.loc31_4.1, %F.ref.loc31 -// CHECK:STDOUT: %.loc31_4.2: %.6 = addr_of %.loc31_4.1 +// CHECK:STDOUT: %.loc31_4.2: %.7 = addr_of %.loc31_4.1 // CHECK:STDOUT: %F.call.loc31: init %.2 = call %.loc31_7(%.loc31_4.2) -// CHECK:STDOUT: %c.ref: %.11 = name_ref c, %c +// CHECK:STDOUT: %c.ref: %.13 = name_ref c, %c // CHECK:STDOUT: %.loc32_4.1: ref %C = deref %c.ref // CHECK:STDOUT: %F.ref.loc32: %F.type.3 = name_ref F, @C.%F.decl [template = constants.%F.3] // CHECK:STDOUT: %.loc32_7: = bound_method %.loc32_4.1, %F.ref.loc32 -// CHECK:STDOUT: %.loc32_4.2: %.11 = addr_of %.loc32_4.1 +// CHECK:STDOUT: %.loc32_4.2: %.13 = addr_of %.loc32_4.1 // CHECK:STDOUT: %F.call.loc32: init %.2 = call %.loc32_7(%.loc32_4.2) -// CHECK:STDOUT: %d.ref: %.14 = name_ref d, %d +// CHECK:STDOUT: %d.ref: %.17 = name_ref d, %d // CHECK:STDOUT: %.loc33_4.1: ref %D = deref %d.ref // CHECK:STDOUT: %F.ref.loc33: %F.type.2 = name_ref F, @B.%F.decl [template = constants.%F.2] // CHECK:STDOUT: %.loc33_7: = bound_method %.loc33_4.1, %F.ref.loc33 -// CHECK:STDOUT: %.loc33_4.2: %.14 = addr_of %.loc33_4.1 +// CHECK:STDOUT: %.loc33_4.2: %.17 = addr_of %.loc33_4.1 // CHECK:STDOUT: %.loc33_9.1: ref %D = deref %.loc33_4.2 // CHECK:STDOUT: %.loc33_9.2: ref %B = class_element_access %.loc33_9.1, element0 -// CHECK:STDOUT: %.loc33_9.3: %.6 = addr_of %.loc33_9.2 -// CHECK:STDOUT: %.loc33_9.4: %.6 = converted %.loc33_4.2, %.loc33_9.3 +// CHECK:STDOUT: %.loc33_9.3: %.7 = addr_of %.loc33_9.2 +// CHECK:STDOUT: %.loc33_9.4: %.7 = converted %.loc33_4.2, %.loc33_9.3 // CHECK:STDOUT: %F.call.loc33: init %.2 = call %.loc33_7(%.loc33_9.4) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index f1e23316f8f1c..89abbbb1aee8a 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -39,10 +39,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.k: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 4 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -114,6 +115,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_32.loc18, %.loc18_10.1 [template = i32] // CHECK:STDOUT: %.loc18_8: %.2 = field_decl k, element0 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -140,7 +142,7 @@ fn Run() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, @Class.%F.decl [template = constants.%F] -// CHECK:STDOUT: %.loc26_18: i32 = int_literal 4 [template = constants.%.5] +// CHECK:STDOUT: %.loc26_18: i32 = int_literal 4 [template = constants.%.6] // CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc26_18) // CHECK:STDOUT: %.loc26_20.1: i32 = value_of_initializer %F.call // CHECK:STDOUT: %.loc26_20.2: i32 = converted %F.call, %.loc26_20.1 diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index 44bfc58af4138..3cac1c2df1e67 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -25,7 +25,8 @@ class C { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -66,6 +67,7 @@ class C { // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14, %.loc14_10.1 [template = i32] // CHECK:STDOUT: %.loc14_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index 9c42115e087bb..ed0073d086c96 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -46,20 +46,22 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Base, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32, .c: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Base, .d: i32, .e: i32} [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Base, .d: i32, .e: i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %AccessDerived.type: type = fn_type @AccessDerived [template] // CHECK:STDOUT: %AccessDerived: %AccessDerived.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %.4, .d: i32, .e: i32} [template] -// CHECK:STDOUT: %.9: type = ptr_type %.8 [template] -// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] +// CHECK:STDOUT: %.10: type = struct_type {.base: %.5, .d: i32, .e: i32} [template] +// CHECK:STDOUT: %.11: type = ptr_type %.10 [template] +// CHECK:STDOUT: %.12: type = ptr_type %.8 [template] // CHECK:STDOUT: %AccessBase.type: type = fn_type @AccessBase [template] // CHECK:STDOUT: %AccessBase: %AccessBase.type = struct_value () [template] -// CHECK:STDOUT: %.11: type = ptr_type %Derived [template] -// CHECK:STDOUT: %.12: type = ptr_type i32 [template] +// CHECK:STDOUT: %.13: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.14: type = ptr_type i32 [template] // CHECK:STDOUT: %AccessDerivedIndirect.type: type = fn_type @AccessDerivedIndirect [template] // CHECK:STDOUT: %AccessDerivedIndirect: %AccessDerivedIndirect.type = struct_value () [template] // CHECK:STDOUT: %AccessBaseIndirect.type: type = fn_type @AccessBaseIndirect [template] @@ -114,25 +116,25 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: } // CHECK:STDOUT: %AccessDerivedIndirect.decl: %AccessDerivedIndirect.type = fn_decl @AccessDerivedIndirect [template = constants.%AccessDerivedIndirect] { // CHECK:STDOUT: %Derived.ref.loc32: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc32_36: type = ptr_type %Derived [template = constants.%.11] -// CHECK:STDOUT: %p.loc32_26.1: %.11 = param p, runtime_param0 -// CHECK:STDOUT: @AccessDerivedIndirect.%p: %.11 = bind_name p, %p.loc32_26.1 +// CHECK:STDOUT: %.loc32_36: type = ptr_type %Derived [template = constants.%.13] +// CHECK:STDOUT: %p.loc32_26.1: %.13 = param p, runtime_param0 +// CHECK:STDOUT: @AccessDerivedIndirect.%p: %.13 = bind_name p, %p.loc32_26.1 // CHECK:STDOUT: %int.make_type_32.loc32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc32_45.1: type = value_of_initializer %int.make_type_32.loc32 [template = i32] // CHECK:STDOUT: %.loc32_45.2: type = converted %int.make_type_32.loc32, %.loc32_45.1 [template = i32] -// CHECK:STDOUT: %.loc32_45.3: type = ptr_type i32 [template = constants.%.12] -// CHECK:STDOUT: @AccessDerivedIndirect.%return: ref %.12 = var +// CHECK:STDOUT: %.loc32_45.3: type = ptr_type i32 [template = constants.%.14] +// CHECK:STDOUT: @AccessDerivedIndirect.%return: ref %.14 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessBaseIndirect.decl: %AccessBaseIndirect.type = fn_decl @AccessBaseIndirect [template = constants.%AccessBaseIndirect] { // CHECK:STDOUT: %Derived.ref.loc36: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc36_33: type = ptr_type %Derived [template = constants.%.11] -// CHECK:STDOUT: %p.loc36_23.1: %.11 = param p, runtime_param0 -// CHECK:STDOUT: @AccessBaseIndirect.%p: %.11 = bind_name p, %p.loc36_23.1 +// CHECK:STDOUT: %.loc36_33: type = ptr_type %Derived [template = constants.%.13] +// CHECK:STDOUT: %p.loc36_23.1: %.13 = param p, runtime_param0 +// CHECK:STDOUT: @AccessBaseIndirect.%p: %.13 = bind_name p, %p.loc36_23.1 // CHECK:STDOUT: %int.make_type_32.loc36: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc36_42.1: type = value_of_initializer %int.make_type_32.loc36 [template = i32] // CHECK:STDOUT: %.loc36_42.2: type = converted %int.make_type_32.loc36, %.loc36_42.1 [template = i32] -// CHECK:STDOUT: %.loc36_42.3: type = ptr_type i32 [template = constants.%.12] -// CHECK:STDOUT: @AccessBaseIndirect.%return: ref %.12 = var +// CHECK:STDOUT: %.loc36_42.3: type = ptr_type i32 [template = constants.%.14] +// CHECK:STDOUT: @AccessBaseIndirect.%return: ref %.14 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -149,6 +151,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14, %.loc14_10.1 [template = i32] // CHECK:STDOUT: %.loc14_8: %.2 = field_decl c, element2 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -159,15 +162,16 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc18: %.5 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc18: %.6 = base_decl %Base, element0 [template] // CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_10.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] // CHECK:STDOUT: %.loc20_10.2: type = converted %int.make_type_32.loc20, %.loc20_10.1 [template = i32] -// CHECK:STDOUT: %.loc20_8: %.6 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc20_8: %.7 = field_decl d, element1 [template] // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32.loc21, %.loc21_10.1 [template = i32] -// CHECK:STDOUT: %.loc21_8: %.6 = field_decl e, element2 [template] +// CHECK:STDOUT: %.loc21_8: %.7 = field_decl e, element2 [template] +// CHECK:STDOUT: %.loc22: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -183,7 +187,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc25_10: %Derived = name_ref d, %d // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.ref.loc25_20: %.6 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] +// CHECK:STDOUT: %d.ref.loc25_20: %.7 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] // CHECK:STDOUT: %.loc25_11.1: ref i32 = class_element_access %d.ref.loc25_10, element1 // CHECK:STDOUT: %.loc25_11.2: i32 = bind_value %.loc25_11.1 // CHECK:STDOUT: return %.loc25_11.2 @@ -201,27 +205,27 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: return %.loc29_11.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessDerivedIndirect(%p: %.11) -> %.12 { +// CHECK:STDOUT: fn @AccessDerivedIndirect(%p: %.13) -> %.14 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.13 = name_ref p, %p // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %d.ref: %.6 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] +// CHECK:STDOUT: %d.ref: %.7 = name_ref d, @Derived.%.loc20_8 [template = @Derived.%.loc20_8] // CHECK:STDOUT: %.loc33_12.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %.loc33_12.2: ref i32 = class_element_access %.loc33_12.1, element1 -// CHECK:STDOUT: %.loc33_10: %.12 = addr_of %.loc33_12.2 +// CHECK:STDOUT: %.loc33_10: %.14 = addr_of %.loc33_12.2 // CHECK:STDOUT: return %.loc33_10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessBaseIndirect(%p: %.11) -> %.12 { +// CHECK:STDOUT: fn @AccessBaseIndirect(%p: %.13) -> %.14 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.13 = name_ref p, %p // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %b.ref: %.2 = name_ref b, @Base.%.loc13_8 [template = @Base.%.loc13_8] // CHECK:STDOUT: %.loc37_12.1: ref %Derived = deref %p.ref // CHECK:STDOUT: %.loc37_12.2: ref %Base = class_element_access %.loc37_12.1, element0 // CHECK:STDOUT: %.loc37_12.3: ref %Base = converted %.loc37_12.1, %.loc37_12.2 // CHECK:STDOUT: %.loc37_12.4: ref i32 = class_element_access %.loc37_12.3, element1 -// CHECK:STDOUT: %.loc37_10: %.12 = addr_of %.loc37_12.4 +// CHECK:STDOUT: %.loc37_10: %.14 = addr_of %.loc37_12.4 // CHECK:STDOUT: return %.loc37_10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index a191e9cd4d47e..a4079d9c7d32e 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -114,6 +114,7 @@ var c: Other.C = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -139,6 +140,8 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -213,8 +216,9 @@ var c: Other.C = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -318,8 +322,9 @@ var c: Other.C = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -377,8 +382,9 @@ var c: Other.C = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // 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 f639a02da413e..703a9501b15af 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -47,26 +47,29 @@ fn ConvertInit() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %A, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %B, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %A, .b: i32} [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %B, i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %A, .b: i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %.4, .b: i32} [template] -// CHECK:STDOUT: %.9: type = ptr_type %.8 [template] -// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] -// CHECK:STDOUT: %.11: type = unbound_element_type %C, %B [template] -// CHECK:STDOUT: %.12: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.13: type = struct_type {.base: %B, .c: i32} [template] -// CHECK:STDOUT: %.14: type = ptr_type %C [template] -// CHECK:STDOUT: %.15: type = ptr_type %B [template] +// CHECK:STDOUT: %.10: type = struct_type {.base: %.5, .b: i32} [template] +// CHECK:STDOUT: %.11: type = ptr_type %.10 [template] +// CHECK:STDOUT: %.12: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.13: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.14: type = unbound_element_type %C, i32 [template] +// CHECK:STDOUT: %.15: type = struct_type {.base: %B, .c: i32} [template] +// CHECK:STDOUT: %.16: = complete_type_witness %.15 [template] +// CHECK:STDOUT: %.17: type = ptr_type %C [template] +// CHECK:STDOUT: %.18: type = ptr_type %B [template] // CHECK:STDOUT: %ConvertCToB.type: type = fn_type @ConvertCToB [template] // CHECK:STDOUT: %ConvertCToB: %ConvertCToB.type = struct_value () [template] -// CHECK:STDOUT: %.16: type = struct_type {.base: %.10, .c: i32} [template] -// CHECK:STDOUT: %.17: type = ptr_type %.16 [template] -// CHECK:STDOUT: %.18: type = ptr_type %.13 [template] -// CHECK:STDOUT: %.19: type = ptr_type %A [template] +// CHECK:STDOUT: %.19: type = struct_type {.base: %.12, .c: i32} [template] +// CHECK:STDOUT: %.20: type = ptr_type %.19 [template] +// CHECK:STDOUT: %.21: type = ptr_type %.15 [template] +// CHECK:STDOUT: %.22: type = ptr_type %A [template] // CHECK:STDOUT: %ConvertBToA.type: type = fn_type @ConvertBToA [template] // CHECK:STDOUT: %ConvertBToA: %ConvertBToA.type = struct_value () [template] // CHECK:STDOUT: %ConvertCToA.type: type = fn_type @ConvertCToA [template] @@ -77,14 +80,14 @@ fn ConvertInit() { // CHECK:STDOUT: %ConvertRef: %ConvertRef.type = struct_value () [template] // CHECK:STDOUT: %ConvertInit.type: type = fn_type @ConvertInit [template] // CHECK:STDOUT: %ConvertInit: %ConvertInit.type = struct_value () [template] -// CHECK:STDOUT: %.20: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.21: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.22: type = struct_type {.base: %.3, .b: i32} [template] -// CHECK:STDOUT: %.23: i32 = int_literal 3 [template] -// CHECK:STDOUT: %.24: type = struct_type {.base: %.22, .c: i32} [template] -// CHECK:STDOUT: %struct.1: %A = struct_value (%.20) [template] -// CHECK:STDOUT: %struct.2: %B = struct_value (%struct.1, %.21) [template] -// CHECK:STDOUT: %struct.3: %C = struct_value (%struct.2, %.23) [template] +// CHECK:STDOUT: %.23: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.24: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.25: type = struct_type {.base: %.3, .b: i32} [template] +// CHECK:STDOUT: %.26: i32 = int_literal 3 [template] +// CHECK:STDOUT: %.27: type = struct_type {.base: %.25, .c: i32} [template] +// CHECK:STDOUT: %struct.1: %A = struct_value (%.23) [template] +// CHECK:STDOUT: %struct.2: %B = struct_value (%struct.1, %.24) [template] +// CHECK:STDOUT: %struct.3: %C = struct_value (%struct.2, %.26) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -121,30 +124,30 @@ fn ConvertInit() { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %ConvertCToB.decl: %ConvertCToB.type = fn_decl @ConvertCToB [template = constants.%ConvertCToB] { // CHECK:STDOUT: %C.ref.loc25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc25_20: type = ptr_type %C [template = constants.%.14] -// CHECK:STDOUT: %p.loc25_16.1: %.14 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertCToB.%p: %.14 = bind_name p, %p.loc25_16.1 +// CHECK:STDOUT: %.loc25_20: type = ptr_type %C [template = constants.%.17] +// CHECK:STDOUT: %p.loc25_16.1: %.17 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertCToB.%p: %.17 = bind_name p, %p.loc25_16.1 // CHECK:STDOUT: %B.ref.loc25: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc25_27: type = ptr_type %B [template = constants.%.15] -// CHECK:STDOUT: @ConvertCToB.%return: ref %.15 = var +// CHECK:STDOUT: %.loc25_27: type = ptr_type %B [template = constants.%.18] +// CHECK:STDOUT: @ConvertCToB.%return: ref %.18 = var // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertBToA.decl: %ConvertBToA.type = fn_decl @ConvertBToA [template = constants.%ConvertBToA] { // CHECK:STDOUT: %B.ref.loc26: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc26_20: type = ptr_type %B [template = constants.%.15] -// CHECK:STDOUT: %p.loc26_16.1: %.15 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertBToA.%p: %.15 = bind_name p, %p.loc26_16.1 +// CHECK:STDOUT: %.loc26_20: type = ptr_type %B [template = constants.%.18] +// CHECK:STDOUT: %p.loc26_16.1: %.18 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertBToA.%p: %.18 = bind_name p, %p.loc26_16.1 // CHECK:STDOUT: %A.ref.loc26: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc26_27: type = ptr_type %A [template = constants.%.19] -// CHECK:STDOUT: @ConvertBToA.%return: ref %.19 = var +// CHECK:STDOUT: %.loc26_27: type = ptr_type %A [template = constants.%.22] +// CHECK:STDOUT: @ConvertBToA.%return: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertCToA.decl: %ConvertCToA.type = fn_decl @ConvertCToA [template = constants.%ConvertCToA] { // CHECK:STDOUT: %C.ref.loc27: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc27_20: type = ptr_type %C [template = constants.%.14] -// CHECK:STDOUT: %p.loc27_16.1: %.14 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertCToA.%p: %.14 = bind_name p, %p.loc27_16.1 +// CHECK:STDOUT: %.loc27_20: type = ptr_type %C [template = constants.%.17] +// CHECK:STDOUT: %p.loc27_16.1: %.17 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertCToA.%p: %.17 = bind_name p, %p.loc27_16.1 // CHECK:STDOUT: %A.ref.loc27: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc27_27: type = ptr_type %A [template = constants.%.19] -// CHECK:STDOUT: @ConvertCToA.%return: ref %.19 = var +// CHECK:STDOUT: %.loc27_27: type = ptr_type %A [template = constants.%.22] +// CHECK:STDOUT: @ConvertCToA.%return: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertValue.decl: %ConvertValue.type = fn_decl @ConvertValue [template = constants.%ConvertValue] { // CHECK:STDOUT: %C.ref.loc29: type = name_ref C, %C.decl [template = constants.%C] @@ -153,12 +156,12 @@ fn ConvertInit() { // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertRef.decl: %ConvertRef.type = fn_decl @ConvertRef [template = constants.%ConvertRef] { // CHECK:STDOUT: %C.ref.loc33: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc33_19: type = ptr_type %C [template = constants.%.14] -// CHECK:STDOUT: %c.loc33_15.1: %.14 = param c, runtime_param0 -// CHECK:STDOUT: @ConvertRef.%c: %.14 = bind_name c, %c.loc33_15.1 +// CHECK:STDOUT: %.loc33_19: type = ptr_type %C [template = constants.%.17] +// CHECK:STDOUT: %c.loc33_15.1: %.17 = param c, runtime_param0 +// CHECK:STDOUT: @ConvertRef.%c: %.17 = bind_name c, %c.loc33_15.1 // CHECK:STDOUT: %A.ref.loc33: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc33_26: type = ptr_type %A [template = constants.%.19] -// CHECK:STDOUT: @ConvertRef.%return: ref %.19 = var +// CHECK:STDOUT: %.loc33_26: type = ptr_type %A [template = constants.%.22] +// CHECK:STDOUT: @ConvertRef.%return: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %ConvertInit.decl: %ConvertInit.type = fn_decl @ConvertInit [template = constants.%ConvertInit] {} // CHECK:STDOUT: } @@ -168,6 +171,7 @@ fn ConvertInit() { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -176,11 +180,12 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc16: %.5 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc16: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_32, %.loc17_10.1 [template = i32] -// CHECK:STDOUT: %.loc17_8: %.6 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc17_8: %.7 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc18: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -191,11 +196,12 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc21: %.11 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc21: %.13 = base_decl %B, element0 [template] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc22_10.2: type = converted %int.make_type_32, %.loc22_10.1 [template = i32] -// CHECK:STDOUT: %.loc22_8: %.12 = field_decl c, element1 [template] +// CHECK:STDOUT: %.loc22_8: %.14 = field_decl c, element1 [template] +// CHECK:STDOUT: %.loc23: = complete_type_witness %.15 [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -206,34 +212,34 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertCToB(%p: %.14) -> %.15 { +// CHECK:STDOUT: fn @ConvertCToB(%p: %.17) -> %.18 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.14 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p // CHECK:STDOUT: %.loc25_39.1: ref %C = deref %p.ref // CHECK:STDOUT: %.loc25_39.2: ref %B = class_element_access %.loc25_39.1, element0 -// CHECK:STDOUT: %.loc25_39.3: %.15 = addr_of %.loc25_39.2 -// CHECK:STDOUT: %.loc25_39.4: %.15 = converted %p.ref, %.loc25_39.3 +// CHECK:STDOUT: %.loc25_39.3: %.18 = addr_of %.loc25_39.2 +// CHECK:STDOUT: %.loc25_39.4: %.18 = converted %p.ref, %.loc25_39.3 // CHECK:STDOUT: return %.loc25_39.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertBToA(%p: %.15) -> %.19 { +// CHECK:STDOUT: fn @ConvertBToA(%p: %.18) -> %.22 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.15 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.18 = name_ref p, %p // CHECK:STDOUT: %.loc26_39.1: ref %B = deref %p.ref // CHECK:STDOUT: %.loc26_39.2: ref %A = class_element_access %.loc26_39.1, element0 -// CHECK:STDOUT: %.loc26_39.3: %.19 = addr_of %.loc26_39.2 -// CHECK:STDOUT: %.loc26_39.4: %.19 = converted %p.ref, %.loc26_39.3 +// CHECK:STDOUT: %.loc26_39.3: %.22 = addr_of %.loc26_39.2 +// CHECK:STDOUT: %.loc26_39.4: %.22 = converted %p.ref, %.loc26_39.3 // CHECK:STDOUT: return %.loc26_39.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertCToA(%p: %.14) -> %.19 { +// CHECK:STDOUT: fn @ConvertCToA(%p: %.17) -> %.22 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.14 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p // CHECK:STDOUT: %.loc27_39.1: ref %C = deref %p.ref // CHECK:STDOUT: %.loc27_39.2: ref %B = class_element_access %.loc27_39.1, element0 // CHECK:STDOUT: %.loc27_39.3: ref %A = class_element_access %.loc27_39.2, element0 -// CHECK:STDOUT: %.loc27_39.4: %.19 = addr_of %.loc27_39.3 -// CHECK:STDOUT: %.loc27_39.5: %.19 = converted %p.ref, %.loc27_39.4 +// CHECK:STDOUT: %.loc27_39.4: %.22 = addr_of %.loc27_39.3 +// CHECK:STDOUT: %.loc27_39.5: %.22 = converted %p.ref, %.loc27_39.4 // CHECK:STDOUT: return %.loc27_39.5 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -249,41 +255,41 @@ fn ConvertInit() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertRef(%c: %.14) -> %.19 { +// CHECK:STDOUT: fn @ConvertRef(%c: %.17) -> %.22 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %c.ref: %.14 = name_ref c, %c +// CHECK:STDOUT: %c.ref: %.17 = name_ref c, %c // CHECK:STDOUT: %.loc34_12: ref %C = deref %c.ref // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %.loc34_15.1: ref %B = class_element_access %.loc34_12, element0 // CHECK:STDOUT: %.loc34_15.2: ref %A = class_element_access %.loc34_15.1, element0 // CHECK:STDOUT: %.loc34_15.3: ref %A = converted %.loc34_12, %.loc34_15.2 -// CHECK:STDOUT: %.loc34_10: %.19 = addr_of %.loc34_15.3 +// CHECK:STDOUT: %.loc34_10: %.22 = addr_of %.loc34_15.3 // CHECK:STDOUT: return %.loc34_10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ConvertInit() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc38_38: i32 = int_literal 1 [template = constants.%.20] +// CHECK:STDOUT: %.loc38_38: i32 = int_literal 1 [template = constants.%.23] // CHECK:STDOUT: %.loc38_39.1: %.3 = struct_literal (%.loc38_38) -// CHECK:STDOUT: %.loc38_47: i32 = int_literal 2 [template = constants.%.21] -// CHECK:STDOUT: %.loc38_48.1: %.22 = struct_literal (%.loc38_39.1, %.loc38_47) -// CHECK:STDOUT: %.loc38_56: i32 = int_literal 3 [template = constants.%.23] -// CHECK:STDOUT: %.loc38_57.1: %.24 = struct_literal (%.loc38_48.1, %.loc38_56) +// CHECK:STDOUT: %.loc38_47: i32 = int_literal 2 [template = constants.%.24] +// CHECK:STDOUT: %.loc38_48.1: %.25 = struct_literal (%.loc38_39.1, %.loc38_47) +// CHECK:STDOUT: %.loc38_56: i32 = int_literal 3 [template = constants.%.26] +// CHECK:STDOUT: %.loc38_57.1: %.27 = struct_literal (%.loc38_48.1, %.loc38_56) // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc38_57.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc38_57.3: ref %B = class_element_access %.loc38_57.2, element0 // CHECK:STDOUT: %.loc38_48.2: ref %A = class_element_access %.loc38_57.3, element0 // CHECK:STDOUT: %.loc38_39.2: ref i32 = class_element_access %.loc38_48.2, element0 -// CHECK:STDOUT: %.loc38_39.3: init i32 = initialize_from %.loc38_38 to %.loc38_39.2 [template = constants.%.20] +// CHECK:STDOUT: %.loc38_39.3: init i32 = initialize_from %.loc38_38 to %.loc38_39.2 [template = constants.%.23] // CHECK:STDOUT: %.loc38_39.4: init %A = class_init (%.loc38_39.3), %.loc38_48.2 [template = constants.%struct.1] // CHECK:STDOUT: %.loc38_48.3: init %A = converted %.loc38_39.1, %.loc38_39.4 [template = constants.%struct.1] // CHECK:STDOUT: %.loc38_48.4: ref i32 = class_element_access %.loc38_57.3, element1 -// CHECK:STDOUT: %.loc38_48.5: init i32 = initialize_from %.loc38_47 to %.loc38_48.4 [template = constants.%.21] +// CHECK:STDOUT: %.loc38_48.5: init i32 = initialize_from %.loc38_47 to %.loc38_48.4 [template = constants.%.24] // CHECK:STDOUT: %.loc38_48.6: init %B = class_init (%.loc38_48.3, %.loc38_48.5), %.loc38_57.3 [template = constants.%struct.2] // CHECK:STDOUT: %.loc38_57.4: init %B = converted %.loc38_48.1, %.loc38_48.6 [template = constants.%struct.2] // CHECK:STDOUT: %.loc38_57.5: ref i32 = class_element_access %.loc38_57.2, element1 -// CHECK:STDOUT: %.loc38_57.6: init i32 = initialize_from %.loc38_56 to %.loc38_57.5 [template = constants.%.23] +// CHECK:STDOUT: %.loc38_57.6: init i32 = initialize_from %.loc38_56 to %.loc38_57.5 [template = constants.%.26] // CHECK:STDOUT: %.loc38_57.7: init %C = class_init (%.loc38_57.4, %.loc38_57.6), %.loc38_57.2 [template = constants.%struct.3] // CHECK:STDOUT: %.loc38_57.8: ref %C = temporary %.loc38_57.2, %.loc38_57.7 // CHECK:STDOUT: %.loc38_59: ref %C = converted %.loc38_57.1, %.loc38_57.8 diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index 3d66737006e34..bfd62196c0698 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -110,7 +110,9 @@ class StructAdapter { // CHECK:STDOUT: %AdapterMethod.type: type = fn_type @AdapterMethod [template] // CHECK:STDOUT: %AdapterMethod: %AdapterMethod.type = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: = complete_type_witness %SomeClass [template] // CHECK:STDOUT: %TestStaticMemberFunction.type: type = fn_type @TestStaticMemberFunction [template] // CHECK:STDOUT: %TestStaticMemberFunction: %TestStaticMemberFunction.type = struct_value () [template] // CHECK:STDOUT: %TestAdapterMethod.type: type = fn_type @TestAdapterMethod [template] @@ -159,6 +161,7 @@ class StructAdapter { // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass +// CHECK:STDOUT: %.loc17: = complete_type_witness %SomeClass [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter @@ -180,6 +183,7 @@ class StructAdapter { // CHECK:STDOUT: %self.loc12_20.1: %SomeClassAdapter = param self, runtime_param0 // CHECK:STDOUT: %self.loc12_20.2: %SomeClassAdapter = bind_name self, %self.loc12_20.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass @@ -220,26 +224,28 @@ class StructAdapter { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %SomeClass [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.6: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.6) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [symbolic] -// CHECK:STDOUT: %.7: type = interface_type @ImplicitAs, @ImplicitAs(%SomeClass) [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %.6, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %.9: type = interface_type @ImplicitAs, @ImplicitAs(%SomeClass) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%SomeClass) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] -// CHECK:STDOUT: %.10: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %Convert.type.2 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.12: %.7 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -256,7 +262,7 @@ class StructAdapter { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] // CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -283,12 +289,12 @@ class StructAdapter { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.4), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.5) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.6), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.7)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.7) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.8)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -304,6 +310,7 @@ class StructAdapter { // CHECK:STDOUT: %self.loc5_8.1: %SomeClass = param self, runtime_param0 // CHECK:STDOUT: %self.loc5_8.2: %SomeClass = bind_name self, %self.loc5_8.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass @@ -313,6 +320,7 @@ class StructAdapter { // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass +// CHECK:STDOUT: %.loc10: = complete_type_witness %SomeClass [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter @@ -326,18 +334,18 @@ class StructAdapter { // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a // CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @SomeClass.%F.decl [template = constants.%F.1] // CHECK:STDOUT: %.loc23_4: = bound_method %a.ref, %F.ref -// CHECK:STDOUT: %.loc23_6.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%.7] -// CHECK:STDOUT: %.loc23_6.2: %.8 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%SomeClass) [template = constants.%.9] -// CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc23_6.2 [template = constants.%.9] +// CHECK:STDOUT: %.loc23_6.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%.9] +// CHECK:STDOUT: %.loc23_6.2: %.10 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%SomeClass) [template = constants.%.11] +// CHECK:STDOUT: %Convert.ref: %.10 = name_ref Convert, %.loc23_6.2 [template = constants.%.11] // CHECK:STDOUT: %.loc23_6.3: %SomeClass = converted %a.ref, [template = ] // CHECK:STDOUT: %F.call: init %.1 = call %.loc23_4() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.4)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.6)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -356,7 +364,7 @@ class StructAdapter { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.6 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -364,12 +372,12 @@ class StructAdapter { // CHECK:STDOUT: %Dest => constants.%SomeClass // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.8 -// CHECK:STDOUT: %.3 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.3 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_field_access.carbon @@ -381,26 +389,28 @@ class StructAdapter { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %SomeClass, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: = complete_type_witness %SomeClass [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.5: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.7: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.7) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%SomeClass) [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.10: type = interface_type @ImplicitAs, @ImplicitAs(%SomeClass) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%SomeClass) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.2 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.11: %.6 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %Convert.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.13: %.8 = assoc_entity element0, imports.%import_ref.7 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -419,7 +429,7 @@ class StructAdapter { // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.11)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.13)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -450,12 +460,12 @@ class StructAdapter { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.5), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.6)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.6) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.7)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.7), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.8) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.9)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -474,6 +484,7 @@ class StructAdapter { // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] // CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClass @@ -484,6 +495,7 @@ class StructAdapter { // CHECK:STDOUT: class @SomeClassAdapter { // CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass] // CHECK:STDOUT: adapt_decl %SomeClass +// CHECK:STDOUT: %.loc11: = complete_type_witness %SomeClass [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SomeClassAdapter @@ -496,18 +508,18 @@ class StructAdapter { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a // CHECK:STDOUT: %b.ref: %.2 = name_ref b, @SomeClass.%.loc6_8 [template = @SomeClass.%.loc6_8] -// CHECK:STDOUT: %.loc21_11.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%.8] -// CHECK:STDOUT: %.loc21_11.2: %.9 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%SomeClass) [template = constants.%.10] -// CHECK:STDOUT: %Convert.ref: %.9 = name_ref Convert, %.loc21_11.2 [template = constants.%.10] +// CHECK:STDOUT: %.loc21_11.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%.10] +// CHECK:STDOUT: %.loc21_11.2: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%SomeClass) [template = constants.%.12] +// CHECK:STDOUT: %Convert.ref: %.11 = name_ref Convert, %.loc21_11.2 [template = constants.%.12] // CHECK:STDOUT: %.loc21_11.3: %SomeClass = converted %a.ref, [template = ] // CHECK:STDOUT: %.loc21_11.4: i32 = class_element_access , element1 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.5)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.7)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -526,7 +538,7 @@ class StructAdapter { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.7 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -534,12 +546,12 @@ class StructAdapter { // CHECK:STDOUT: %Dest => constants.%SomeClass // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.9 -// CHECK:STDOUT: %.3 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: %.3 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_adapt_non_class.carbon @@ -551,6 +563,7 @@ class StructAdapter { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template] // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -586,6 +599,7 @@ class StructAdapter { // CHECK:STDOUT: %.loc8_30.2: type = converted %int.make_type_32.loc8_30, %.loc8_30.1 [template = i32] // CHECK:STDOUT: %.loc8_33: type = struct_type {.a: i32, .b: i32} [template = constants.%.2] // CHECK:STDOUT: adapt_decl %.2 +// CHECK:STDOUT: %.loc9: = complete_type_witness %.2 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%StructAdapter diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index 43559eaf94f42..c4ba94f9e2738 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -39,24 +39,26 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Abstract, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Abstract [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Abstract, .d: i32} [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Abstract [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Derived, i32 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Abstract, .d: i32} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %.4, .d: i32} [template] -// CHECK:STDOUT: %.9: type = ptr_type %.8 [template] -// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] -// CHECK:STDOUT: %.11: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.12: i32 = int_literal 7 [template] -// CHECK:STDOUT: %.13: type = struct_type {.base: %.3, .d: i32} [template] -// CHECK:STDOUT: %.14: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %.15: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %.10: type = struct_type {.base: %.5, .d: i32} [template] +// CHECK:STDOUT: %.11: type = ptr_type %.10 [template] +// CHECK:STDOUT: %.12: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.13: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.14: i32 = int_literal 7 [template] +// CHECK:STDOUT: %.15: type = struct_type {.base: %.3, .d: i32} [template] +// CHECK:STDOUT: %.16: type = tuple_type (type, type) [template] +// CHECK:STDOUT: %.17: type = tuple_type (i32, i32) [template] // CHECK:STDOUT: %Access.type: type = fn_type @Access [template] // CHECK:STDOUT: %Access: %Access.type = struct_value () [template] -// CHECK:STDOUT: %.16: type = ptr_type %.15 [template] +// CHECK:STDOUT: %.18: type = ptr_type %.17 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -95,13 +97,13 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: @Access.%d: %Derived = bind_name d, %d.loc29_11.1 // CHECK:STDOUT: %int.make_type_32.loc29_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc29_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc29_35.1: %.14 = tuple_literal (%int.make_type_32.loc29_27, %int.make_type_32.loc29_32) +// CHECK:STDOUT: %.loc29_35.1: %.16 = tuple_literal (%int.make_type_32.loc29_27, %int.make_type_32.loc29_32) // CHECK:STDOUT: %.loc29_35.2: type = value_of_initializer %int.make_type_32.loc29_27 [template = i32] // CHECK:STDOUT: %.loc29_35.3: type = converted %int.make_type_32.loc29_27, %.loc29_35.2 [template = i32] // CHECK:STDOUT: %.loc29_35.4: type = value_of_initializer %int.make_type_32.loc29_32 [template = i32] // CHECK:STDOUT: %.loc29_35.5: type = converted %int.make_type_32.loc29_32, %.loc29_35.4 [template = i32] -// CHECK:STDOUT: %.loc29_35.6: type = converted %.loc29_35.1, constants.%.15 [template = constants.%.15] -// CHECK:STDOUT: @Access.%return: ref %.15 = var +// CHECK:STDOUT: %.loc29_35.6: type = converted %.loc29_35.1, constants.%.17 [template = constants.%.17] +// CHECK:STDOUT: @Access.%return: ref %.17 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -110,6 +112,7 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Abstract @@ -118,11 +121,12 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract] -// CHECK:STDOUT: %.loc16: %.5 = base_decl %Abstract, element0 [template] +// CHECK:STDOUT: %.loc16: %.6 = base_decl %Abstract, element0 [template] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_10.2: type = converted %int.make_type_32, %.loc18_10.1 [template = i32] -// CHECK:STDOUT: %.loc18_8: %.6 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc18_8: %.7 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -135,33 +139,33 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: %Derived { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc26_25: i32 = int_literal 1 [template = constants.%.11] +// CHECK:STDOUT: %.loc26_25: i32 = int_literal 1 [template = constants.%.13] // CHECK:STDOUT: %.loc26_26: %.3 = struct_literal (%.loc26_25) -// CHECK:STDOUT: %.loc26_34: i32 = int_literal 7 [template = constants.%.12] -// CHECK:STDOUT: %.loc26_35: %.13 = struct_literal (%.loc26_26, %.loc26_34) +// CHECK:STDOUT: %.loc26_34: i32 = int_literal 7 [template = constants.%.14] +// CHECK:STDOUT: %.loc26_35: %.15 = struct_literal (%.loc26_26, %.loc26_34) // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Access(%d: %Derived) -> %return: %.15 { +// CHECK:STDOUT: fn @Access(%d: %Derived) -> %return: %.17 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref.loc30_11: %Derived = name_ref d, %d -// CHECK:STDOUT: %d.ref.loc30_12: %.6 = name_ref d, @Derived.%.loc18_8 [template = @Derived.%.loc18_8] +// CHECK:STDOUT: %d.ref.loc30_12: %.7 = name_ref d, @Derived.%.loc18_8 [template = @Derived.%.loc18_8] // CHECK:STDOUT: %.loc30_12.1: ref i32 = class_element_access %d.ref.loc30_11, element1 // CHECK:STDOUT: %.loc30_12.2: i32 = bind_value %.loc30_12.1 // CHECK:STDOUT: %d.ref.loc30_16: %Derived = name_ref d, %d -// CHECK:STDOUT: %base.ref: %.5 = name_ref base, @Derived.%.loc16 [template = @Derived.%.loc16] +// CHECK:STDOUT: %base.ref: %.6 = name_ref base, @Derived.%.loc16 [template = @Derived.%.loc16] // CHECK:STDOUT: %.loc30_17.1: ref %Abstract = class_element_access %d.ref.loc30_16, element0 // CHECK:STDOUT: %.loc30_17.2: %Abstract = bind_value %.loc30_17.1 // CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Abstract.%.loc12_8 [template = @Abstract.%.loc12_8] // CHECK:STDOUT: %.loc30_22.1: ref i32 = class_element_access %.loc30_17.2, element0 // CHECK:STDOUT: %.loc30_22.2: i32 = bind_value %.loc30_22.1 -// CHECK:STDOUT: %.loc30_24.1: %.15 = tuple_literal (%.loc30_12.2, %.loc30_22.2) +// CHECK:STDOUT: %.loc30_24.1: %.17 = tuple_literal (%.loc30_12.2, %.loc30_22.2) // CHECK:STDOUT: %.loc30_24.2: ref i32 = tuple_access %return, element0 // CHECK:STDOUT: %.loc30_24.3: init i32 = initialize_from %.loc30_12.2 to %.loc30_24.2 // CHECK:STDOUT: %.loc30_24.4: ref i32 = tuple_access %return, element1 // CHECK:STDOUT: %.loc30_24.5: init i32 = initialize_from %.loc30_22.2 to %.loc30_24.4 -// CHECK:STDOUT: %.loc30_24.6: init %.15 = tuple_init (%.loc30_24.3, %.loc30_24.5) to %return -// CHECK:STDOUT: %.loc30_25: init %.15 = converted %.loc30_24.1, %.loc30_24.6 +// CHECK:STDOUT: %.loc30_24.6: init %.17 = tuple_init (%.loc30_24.3, %.loc30_24.5) to %return +// CHECK:STDOUT: %.loc30_25: init %.17 = converted %.loc30_24.1, %.loc30_24.6 // CHECK:STDOUT: return %.loc30_25 to %return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index 3f67a030456f6..ed109914262a6 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -189,6 +189,7 @@ class C { // CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc12_12.2 [template = constants.%.8] // CHECK:STDOUT: %.loc12_12.3: type = converted %.loc12_9, [template = ] // CHECK:STDOUT: adapt_decl +// CHECK:STDOUT: %.loc13: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Bad @@ -326,6 +327,7 @@ class C { // CHECK:STDOUT: %Convert.ref: %.7 = name_ref Convert, %.loc12_19.2 [template = constants.%.8] // CHECK:STDOUT: %.loc12_19.3: type = converted %.loc12_16, [template = ] // CHECK:STDOUT: adapt_decl +// CHECK:STDOUT: %.loc13: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Bad @@ -383,6 +385,7 @@ class C { // CHECK:STDOUT: %MultipleAdapts: type = class_type @MultipleAdapts [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.1 [template] // CHECK:STDOUT: %MultipleAdaptsSameType: type = class_type @MultipleAdaptsSameType [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -415,6 +418,7 @@ class C { // CHECK:STDOUT: %.loc5_11: type = converted %.loc5_10, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: adapt_decl %.1 // CHECK:STDOUT: %.loc13: %.2 = struct_literal () +// CHECK:STDOUT: %.loc14: = complete_type_witness %.1 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%MultipleAdapts @@ -425,6 +429,7 @@ class C { // CHECK:STDOUT: %.loc17_11: type = converted %.loc17_10, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: adapt_decl %.1 // CHECK:STDOUT: %.loc25: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc26: = complete_type_witness %.1 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%MultipleAdaptsSameType @@ -439,6 +444,7 @@ class C { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.3: type = interface_type @I.2 [template] // CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.4: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -486,6 +492,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %I.decl: type = interface_decl @I.2 [template = constants.%.3] {} +// CHECK:STDOUT: %.loc25: = complete_type_witness %.1 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon index 541229b0c9555..81667f95e9347 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon @@ -60,6 +60,7 @@ class AdaptIncomplete { // CHECK:STDOUT: class @AdaptIncomplete { // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: adapt_decl +// CHECK:STDOUT: %.loc14: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptIncomplete diff --git a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon index 0a678c614f454..02d0fd120c06b 100644 --- a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon @@ -60,9 +60,11 @@ class C5 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %C1: type = class_type @C1 [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %B [template] // CHECK:STDOUT: %C2: type = class_type @C2 [template] // CHECK:STDOUT: %C3: type = class_type @C3 [template] // CHECK:STDOUT: %C4: type = class_type @C4 [template] @@ -102,6 +104,8 @@ class C5 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } @@ -109,6 +113,7 @@ class C5 { // CHECK:STDOUT: class @C1 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: adapt_decl %B +// CHECK:STDOUT: %.loc19: = complete_type_witness %B [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C1 @@ -117,6 +122,7 @@ class C5 { // CHECK:STDOUT: class @C2 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: adapt_decl %B +// CHECK:STDOUT: %.loc27: = complete_type_witness %B [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C2 @@ -125,6 +131,7 @@ class C5 { // CHECK:STDOUT: class @C3 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: adapt_decl %B +// CHECK:STDOUT: %.loc35: = complete_type_witness %B [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C3 @@ -133,6 +140,7 @@ class C5 { // CHECK:STDOUT: class @C4 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: adapt_decl %B +// CHECK:STDOUT: %.loc46: = complete_type_witness %B [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C4 @@ -142,6 +150,7 @@ class C5 { // CHECK:STDOUT: class @C5 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: adapt_decl %B +// CHECK:STDOUT: %.loc56: = complete_type_witness %B [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C5 diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index 55a93872c7a49..c8bc3ccefecb5 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -79,12 +79,13 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %AdaptWithBase: type = class_type @AdaptWithBase [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %AdaptWithBase, %Base [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %AdaptWithBase, %Base [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -114,6 +115,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base // CHECK:STDOUT: } @@ -124,7 +127,7 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %.loc10_12.2: type = converted %int.make_type_32, %.loc10_12.1 [template = i32] // CHECK:STDOUT: adapt_decl i32 // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc15: %.4 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc15: %.5 = base_decl %Base, element0 [template] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptWithBase @@ -219,13 +222,14 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %AdaptWithBaseAndFields: type = class_type @AdaptWithBaseAndFields [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %AdaptWithBaseAndFields, %Base [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %AdaptWithBaseAndFields, %Base [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %AdaptWithBaseAndFields, i32 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %AdaptWithBaseAndFields, i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -255,17 +259,19 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithBaseAndFields { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc7: %.4 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc7: %.5 = base_decl %Base, element0 [template] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32, %.loc8_10.1 [template = i32] -// CHECK:STDOUT: %.loc8_8: %.5 = field_decl n, element1 [template] +// CHECK:STDOUT: %.loc8_8: %.6 = field_decl n, element1 [template] // CHECK:STDOUT: %.loc15_10: %.1 = struct_literal () // CHECK:STDOUT: %.loc15_11: type = converted %.loc15_10, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: adapt_decl %.1 diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index 4b3f69a5f0669..3163ab640b910 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -32,6 +32,7 @@ class Class { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -69,6 +70,7 @@ class Class { // CHECK:STDOUT: %b.loc21_13.1: %.1 = param b, runtime_param0 // CHECK:STDOUT: %b.loc21_13.2: %.1 = bind_name b, %b.loc21_13.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc22: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index f616994e6ae3e..2b68e65e27748 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -58,25 +58,26 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.5: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.6: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.6) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [symbolic] -// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%Class) [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %.6, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %.9: type = interface_type @ImplicitAs, @ImplicitAs(%Class) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%Class) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.2 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.5 [template] -// CHECK:STDOUT: %.11: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %Convert.type.2 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.12: %.7 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -93,7 +94,7 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.11)] +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] // CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -122,12 +123,12 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.5), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.6)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.6) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.7)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.6), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.7)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.7) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.8)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -151,6 +152,7 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %self.loc13_13.3: %Class = bind_name self, %self.loc13_13.1 // CHECK:STDOUT: %.loc13: %Class = addr_pattern %self.loc13_13.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -183,18 +185,18 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %G.ref.loc47: %G.type = name_ref G, @Class.%G.decl [template = constants.%G] // CHECK:STDOUT: %.loc47_7: = bound_method %.loc47_4.1, %G.ref.loc47 // CHECK:STDOUT: %.loc47_4.2: %.1 = addr_of %.loc47_4.1 -// CHECK:STDOUT: %.loc47_9.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class) [template = constants.%.8] -// CHECK:STDOUT: %.loc47_9.2: %.9 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class) [template = constants.%.10] -// CHECK:STDOUT: %Convert.ref: %.9 = name_ref Convert, %.loc47_9.2 [template = constants.%.10] +// CHECK:STDOUT: %.loc47_9.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class) [template = constants.%.9] +// CHECK:STDOUT: %.loc47_9.2: %.10 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class) [template = constants.%.11] +// CHECK:STDOUT: %Convert.ref: %.10 = name_ref Convert, %.loc47_9.2 [template = constants.%.11] // CHECK:STDOUT: %.loc47_9.3: %Class = converted %.loc47_4.2, [template = ] // CHECK:STDOUT: %G.call.loc47: init %.2 = call %.loc47_7() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.5)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.6)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -213,7 +215,7 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.6 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -221,11 +223,11 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %Dest => constants.%Class // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.9 -// CHECK:STDOUT: %.3 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.3 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 761f3faab1604..7dc931f9113ba 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -152,101 +152,104 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Final: type = class_type @Final [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = unbound_element_type %Final, i32 [template] -// CHECK:STDOUT: %.4: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.4: type = unbound_element_type %Final, i32 [template] +// CHECK:STDOUT: %.5: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %DeriveFromError: type = class_type @DeriveFromError [template] -// CHECK:STDOUT: %.5: type = ptr_type %DeriveFromError [template] +// CHECK:STDOUT: %.7: type = ptr_type %DeriveFromError [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseError.type: type = fn_type @AccessMemberWithInvalidBaseError [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseError: %AccessMemberWithInvalidBaseError.type = struct_value () [template] // CHECK:STDOUT: %DeriveFromNonType: type = class_type @DeriveFromNonType [template] -// CHECK:STDOUT: %.6: i32 = int_literal 32 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 32 [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.7: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.7) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.9: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.9) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.9 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.10: type = interface_type @ImplicitAs, @ImplicitAs(type) [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.12: type = interface_type @ImplicitAs, @ImplicitAs(type) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(type) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %Convert.type.2 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.13: %.8 = assoc_entity element0, imports.%import_ref.7 [symbolic] -// CHECK:STDOUT: %.14: type = ptr_type %DeriveFromNonType [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.12, %Convert.type.2 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.15: %.10 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.16: type = ptr_type %DeriveFromNonType [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType.type: type = fn_type @AccessMemberWithInvalidBasNonType [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType: %AccessMemberWithInvalidBasNonType.type = struct_value () [template] // CHECK:STDOUT: %DeriveFromi32: type = class_type @DeriveFromi32 [template] -// CHECK:STDOUT: %.15: type = ptr_type %DeriveFromi32 [template] -// CHECK:STDOUT: %.16: type = ptr_type i32 [template] +// CHECK:STDOUT: %.17: type = ptr_type %DeriveFromi32 [template] +// CHECK:STDOUT: %.18: type = ptr_type i32 [template] // CHECK:STDOUT: %ConvertToBadBasei32.type: type = fn_type @ConvertToBadBasei32 [template] // CHECK:STDOUT: %ConvertToBadBasei32: %ConvertToBadBasei32.type = struct_value () [template] -// CHECK:STDOUT: %.17: type = interface_type @ImplicitAs, @ImplicitAs(%.16) [template] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert, @ImplicitAs(%.16) [template] +// CHECK:STDOUT: %.19: type = interface_type @ImplicitAs, @ImplicitAs(%.18) [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert, @ImplicitAs(%.18) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.18: type = assoc_entity_type %.17, %Convert.type.3 [template] -// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.20: type = assoc_entity_type %.19, %Convert.type.3 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasei32.type: type = fn_type @AccessMemberWithInvalidBasei32 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBasei32: %AccessMemberWithInvalidBasei32.type = struct_value () [template] // CHECK:STDOUT: %DeriveFromTuple: type = class_type @DeriveFromTuple [template] -// CHECK:STDOUT: %.20: type = tuple_type (type) [template] -// CHECK:STDOUT: %.21: type = tuple_type (%Base) [template] -// CHECK:STDOUT: %.22: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.23: type = tuple_type (%.22) [template] -// CHECK:STDOUT: %.24: type = ptr_type %DeriveFromTuple [template] -// CHECK:STDOUT: %.25: type = ptr_type %.21 [template] +// CHECK:STDOUT: %.22: type = tuple_type (type) [template] +// CHECK:STDOUT: %.23: type = tuple_type (%Base) [template] +// CHECK:STDOUT: %.24: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.25: type = tuple_type (%.24) [template] +// CHECK:STDOUT: %.26: type = ptr_type %DeriveFromTuple [template] +// CHECK:STDOUT: %.27: type = ptr_type %.23 [template] // CHECK:STDOUT: %ConvertToBadBaseTuple.type: type = fn_type @ConvertToBadBaseTuple [template] // CHECK:STDOUT: %ConvertToBadBaseTuple: %ConvertToBadBaseTuple.type = struct_value () [template] -// CHECK:STDOUT: %.26: type = interface_type @ImplicitAs, @ImplicitAs(%.25) [template] -// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert, @ImplicitAs(%.25) [template] +// CHECK:STDOUT: %.28: type = interface_type @ImplicitAs, @ImplicitAs(%.27) [template] +// CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert, @ImplicitAs(%.27) [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] -// CHECK:STDOUT: %.27: type = assoc_entity_type %.26, %Convert.type.4 [template] -// CHECK:STDOUT: %.28: %.27 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.29: type = assoc_entity_type %.28, %Convert.type.4 [template] +// CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple.type: type = fn_type @AccessMemberWithInvalidBaseTuple [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple: %AccessMemberWithInvalidBaseTuple.type = struct_value () [template] // CHECK:STDOUT: %DeriveFromStruct: type = class_type @DeriveFromStruct [template] -// CHECK:STDOUT: %.29: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.30: type = ptr_type %.29 [template] -// CHECK:STDOUT: %.31: type = ptr_type %DeriveFromStruct [template] +// CHECK:STDOUT: %.31: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.32: type = ptr_type %.31 [template] +// CHECK:STDOUT: %.33: type = ptr_type %DeriveFromStruct [template] // CHECK:STDOUT: %ConvertToBadBaseStruct.type: type = fn_type @ConvertToBadBaseStruct [template] // CHECK:STDOUT: %ConvertToBadBaseStruct: %ConvertToBadBaseStruct.type = struct_value () [template] -// CHECK:STDOUT: %.32: type = interface_type @ImplicitAs, @ImplicitAs(%.30) [template] -// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert, @ImplicitAs(%.30) [template] +// CHECK:STDOUT: %.34: type = interface_type @ImplicitAs, @ImplicitAs(%.32) [template] +// CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert, @ImplicitAs(%.32) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.33: type = assoc_entity_type %.32, %Convert.type.5 [template] -// CHECK:STDOUT: %.34: %.33 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.35: type = assoc_entity_type %.34, %Convert.type.5 [template] +// CHECK:STDOUT: %.36: %.35 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct.type: type = fn_type @AccessMemberWithInvalidBaseStruct [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct: %AccessMemberWithInvalidBaseStruct.type = struct_value () [template] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] // CHECK:STDOUT: %DeriveFromIncomplete: type = class_type @DeriveFromIncomplete [template] -// CHECK:STDOUT: %.35: type = ptr_type %DeriveFromIncomplete [template] -// CHECK:STDOUT: %.36: type = ptr_type %Incomplete [template] +// CHECK:STDOUT: %.37: type = ptr_type %DeriveFromIncomplete [template] +// CHECK:STDOUT: %.38: type = ptr_type %Incomplete [template] // CHECK:STDOUT: %ConvertToBadBaseIncomplete.type: type = fn_type @ConvertToBadBaseIncomplete [template] // CHECK:STDOUT: %ConvertToBadBaseIncomplete: %ConvertToBadBaseIncomplete.type = struct_value () [template] -// CHECK:STDOUT: %.37: type = interface_type @ImplicitAs, @ImplicitAs(%.36) [template] -// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert, @ImplicitAs(%.36) [template] +// CHECK:STDOUT: %.39: type = interface_type @ImplicitAs, @ImplicitAs(%.38) [template] +// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert, @ImplicitAs(%.38) [template] // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [template] -// CHECK:STDOUT: %.38: type = assoc_entity_type %.37, %Convert.type.6 [template] -// CHECK:STDOUT: %.39: %.38 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.40: type = assoc_entity_type %.39, %Convert.type.6 [template] +// CHECK:STDOUT: %.41: %.40 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete.type: type = fn_type @AccessMemberWithInvalidBaseIncomplete [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete: %AccessMemberWithInvalidBaseIncomplete.type = struct_value () [template] // CHECK:STDOUT: %DeriveFromFinal: type = class_type @DeriveFromFinal [template] -// CHECK:STDOUT: %.40: type = ptr_type %.4 [template] -// CHECK:STDOUT: %.41: type = unbound_element_type %DeriveFromFinal, %Final [template] -// CHECK:STDOUT: %.42: type = struct_type {.base: %Final} [template] -// CHECK:STDOUT: %.43: type = ptr_type %DeriveFromFinal [template] -// CHECK:STDOUT: %.44: type = ptr_type %Final [template] +// CHECK:STDOUT: %.42: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.43: type = unbound_element_type %DeriveFromFinal, %Final [template] +// CHECK:STDOUT: %.44: type = struct_type {.base: %Final} [template] +// CHECK:STDOUT: %.45: = complete_type_witness %.44 [template] +// CHECK:STDOUT: %.46: type = ptr_type %DeriveFromFinal [template] +// CHECK:STDOUT: %.47: type = ptr_type %Final [template] // CHECK:STDOUT: %ConvertToBadBaseFinal.type: type = fn_type @ConvertToBadBaseFinal [template] // CHECK:STDOUT: %ConvertToBadBaseFinal: %ConvertToBadBaseFinal.type = struct_value () [template] -// CHECK:STDOUT: %.45: type = struct_type {.base: %.40} [template] -// CHECK:STDOUT: %.46: type = ptr_type %.42 [template] +// CHECK:STDOUT: %.48: type = struct_type {.base: %.42} [template] +// CHECK:STDOUT: %.49: type = ptr_type %.44 [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember.type: type = fn_type @AccessMemberWithInvalidBaseFinal_WithMember [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember: %AccessMemberWithInvalidBaseFinal_WithMember.type = struct_value () [template] // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_NoMember.type: type = fn_type @AccessMemberWithInvalidBaseFinal_NoMember [template] @@ -269,7 +272,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.13)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -308,9 +311,9 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromError.decl: type = class_decl @DeriveFromError [template = constants.%DeriveFromError] {} // CHECK:STDOUT: %AccessMemberWithInvalidBaseError.decl: %AccessMemberWithInvalidBaseError.type = fn_decl @AccessMemberWithInvalidBaseError [template = constants.%AccessMemberWithInvalidBaseError] { // CHECK:STDOUT: %DeriveFromError.ref: type = name_ref DeriveFromError, %DeriveFromError.decl [template = constants.%DeriveFromError] -// CHECK:STDOUT: %.loc25_55: type = ptr_type %DeriveFromError [template = constants.%.5] -// CHECK:STDOUT: %p.loc25_37.1: %.5 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseError.%p: %.5 = bind_name p, %p.loc25_37.1 +// CHECK:STDOUT: %.loc25_55: type = ptr_type %DeriveFromError [template = constants.%.7] +// CHECK:STDOUT: %p.loc25_37.1: %.7 = param p, runtime_param0 +// CHECK:STDOUT: @AccessMemberWithInvalidBaseError.%p: %.7 = bind_name p, %p.loc25_37.1 // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc25_61.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] // CHECK:STDOUT: %.loc25_61.2: type = converted %int.make_type_32.loc25, %.loc25_61.1 [template = i32] @@ -319,9 +322,9 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromNonType.decl: type = class_decl @DeriveFromNonType [template = constants.%DeriveFromNonType] {} // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType.decl: %AccessMemberWithInvalidBasNonType.type = fn_decl @AccessMemberWithInvalidBasNonType [template = constants.%AccessMemberWithInvalidBasNonType] { // CHECK:STDOUT: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, %DeriveFromNonType.decl [template = constants.%DeriveFromNonType] -// CHECK:STDOUT: %.loc38_58: type = ptr_type %DeriveFromNonType [template = constants.%.14] -// CHECK:STDOUT: %p.loc38_38.1: %.14 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBasNonType.%p: %.14 = bind_name p, %p.loc38_38.1 +// CHECK:STDOUT: %.loc38_58: type = ptr_type %DeriveFromNonType [template = constants.%.16] +// CHECK:STDOUT: %p.loc38_38.1: %.16 = param p, runtime_param0 +// CHECK:STDOUT: @AccessMemberWithInvalidBasNonType.%p: %.16 = bind_name p, %p.loc38_38.1 // CHECK:STDOUT: %int.make_type_32.loc38: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc38_64.1: type = value_of_initializer %int.make_type_32.loc38 [template = i32] // CHECK:STDOUT: %.loc38_64.2: type = converted %int.make_type_32.loc38, %.loc38_64.1 [template = i32] @@ -330,20 +333,20 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromi32.decl: type = class_decl @DeriveFromi32 [template = constants.%DeriveFromi32] {} // CHECK:STDOUT: %ConvertToBadBasei32.decl: %ConvertToBadBasei32.type = fn_decl @ConvertToBadBasei32 [template = constants.%ConvertToBadBasei32] { // CHECK:STDOUT: %DeriveFromi32.ref.loc57: type = name_ref DeriveFromi32, %DeriveFromi32.decl [template = constants.%DeriveFromi32] -// CHECK:STDOUT: %.loc57_40: type = ptr_type %DeriveFromi32 [template = constants.%.15] -// CHECK:STDOUT: %p.loc57_24.1: %.15 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBasei32.%p: %.15 = bind_name p, %p.loc57_24.1 +// CHECK:STDOUT: %.loc57_40: type = ptr_type %DeriveFromi32 [template = constants.%.17] +// CHECK:STDOUT: %p.loc57_24.1: %.17 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertToBadBasei32.%p: %.17 = bind_name p, %p.loc57_24.1 // CHECK:STDOUT: %int.make_type_32.loc57: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_49.1: type = value_of_initializer %int.make_type_32.loc57 [template = i32] // CHECK:STDOUT: %.loc57_49.2: type = converted %int.make_type_32.loc57, %.loc57_49.1 [template = i32] -// CHECK:STDOUT: %.loc57_49.3: type = ptr_type i32 [template = constants.%.16] -// CHECK:STDOUT: @ConvertToBadBasei32.%return: ref %.16 = var +// CHECK:STDOUT: %.loc57_49.3: type = ptr_type i32 [template = constants.%.18] +// CHECK:STDOUT: @ConvertToBadBasei32.%return: ref %.18 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBasei32.decl: %AccessMemberWithInvalidBasei32.type = fn_decl @AccessMemberWithInvalidBasei32 [template = constants.%AccessMemberWithInvalidBasei32] { // CHECK:STDOUT: %DeriveFromi32.ref.loc59: type = name_ref DeriveFromi32, %DeriveFromi32.decl [template = constants.%DeriveFromi32] -// CHECK:STDOUT: %.loc59_51: type = ptr_type %DeriveFromi32 [template = constants.%.15] -// CHECK:STDOUT: %p.loc59_35.1: %.15 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBasei32.%p: %.15 = bind_name p, %p.loc59_35.1 +// CHECK:STDOUT: %.loc59_51: type = ptr_type %DeriveFromi32 [template = constants.%.17] +// CHECK:STDOUT: %p.loc59_35.1: %.17 = param p, runtime_param0 +// CHECK:STDOUT: @AccessMemberWithInvalidBasei32.%p: %.17 = bind_name p, %p.loc59_35.1 // CHECK:STDOUT: %int.make_type_32.loc59: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc59_57.1: type = value_of_initializer %int.make_type_32.loc59 [template = i32] // CHECK:STDOUT: %.loc59_57.2: type = converted %int.make_type_32.loc59, %.loc59_57.1 [template = i32] @@ -352,20 +355,20 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromTuple.decl: type = class_decl @DeriveFromTuple [template = constants.%DeriveFromTuple] {} // CHECK:STDOUT: %ConvertToBadBaseTuple.decl: %ConvertToBadBaseTuple.type = fn_decl @ConvertToBadBaseTuple [template = constants.%ConvertToBadBaseTuple] { // CHECK:STDOUT: %DeriveFromTuple.ref.loc76: type = name_ref DeriveFromTuple, %DeriveFromTuple.decl [template = constants.%DeriveFromTuple] -// CHECK:STDOUT: %.loc76_44: type = ptr_type %DeriveFromTuple [template = constants.%.24] -// CHECK:STDOUT: %p.loc76_26.1: %.24 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBaseTuple.%p: %.24 = bind_name p, %p.loc76_26.1 +// CHECK:STDOUT: %.loc76_44: type = ptr_type %DeriveFromTuple [template = constants.%.26] +// CHECK:STDOUT: %p.loc76_26.1: %.26 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertToBadBaseTuple.%p: %.26 = bind_name p, %p.loc76_26.1 // CHECK:STDOUT: %Base.ref: type = name_ref Base, %Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc76_56: %.20 = tuple_literal (%Base.ref) -// CHECK:STDOUT: %.loc76_57.1: type = converted %.loc76_56, constants.%.21 [template = constants.%.21] -// CHECK:STDOUT: %.loc76_57.2: type = ptr_type %.21 [template = constants.%.25] -// CHECK:STDOUT: @ConvertToBadBaseTuple.%return: ref %.25 = var +// CHECK:STDOUT: %.loc76_56: %.22 = tuple_literal (%Base.ref) +// CHECK:STDOUT: %.loc76_57.1: type = converted %.loc76_56, constants.%.23 [template = constants.%.23] +// CHECK:STDOUT: %.loc76_57.2: type = ptr_type %.23 [template = constants.%.27] +// CHECK:STDOUT: @ConvertToBadBaseTuple.%return: ref %.27 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple.decl: %AccessMemberWithInvalidBaseTuple.type = fn_decl @AccessMemberWithInvalidBaseTuple [template = constants.%AccessMemberWithInvalidBaseTuple] { // CHECK:STDOUT: %DeriveFromTuple.ref.loc78: type = name_ref DeriveFromTuple, %DeriveFromTuple.decl [template = constants.%DeriveFromTuple] -// CHECK:STDOUT: %.loc78_55: type = ptr_type %DeriveFromTuple [template = constants.%.24] -// CHECK:STDOUT: %p.loc78_37.1: %.24 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseTuple.%p: %.24 = bind_name p, %p.loc78_37.1 +// CHECK:STDOUT: %.loc78_55: type = ptr_type %DeriveFromTuple [template = constants.%.26] +// CHECK:STDOUT: %p.loc78_37.1: %.26 = param p, runtime_param0 +// CHECK:STDOUT: @AccessMemberWithInvalidBaseTuple.%p: %.26 = bind_name p, %p.loc78_37.1 // CHECK:STDOUT: %int.make_type_32.loc78: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc78_61.1: type = value_of_initializer %int.make_type_32.loc78 [template = i32] // CHECK:STDOUT: %.loc78_61.2: type = converted %int.make_type_32.loc78, %.loc78_61.1 [template = i32] @@ -374,24 +377,24 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromStruct.decl: type = class_decl @DeriveFromStruct [template = constants.%DeriveFromStruct] {} // CHECK:STDOUT: %ConvertToBadBaseStruct.decl: %ConvertToBadBaseStruct.type = fn_decl @ConvertToBadBaseStruct [template = constants.%ConvertToBadBaseStruct] { // CHECK:STDOUT: %DeriveFromStruct.ref.loc97: type = name_ref DeriveFromStruct, %DeriveFromStruct.decl [template = constants.%DeriveFromStruct] -// CHECK:STDOUT: %.loc97_46: type = ptr_type %DeriveFromStruct [template = constants.%.31] -// CHECK:STDOUT: %p.loc97_27.1: %.31 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBaseStruct.%p: %.31 = bind_name p, %p.loc97_27.1 +// CHECK:STDOUT: %.loc97_46: type = ptr_type %DeriveFromStruct [template = constants.%.33] +// CHECK:STDOUT: %p.loc97_27.1: %.33 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertToBadBaseStruct.%p: %.33 = bind_name p, %p.loc97_27.1 // CHECK:STDOUT: %int.make_type_32.loc97_57: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc97_57.1: type = value_of_initializer %int.make_type_32.loc97_57 [template = i32] // CHECK:STDOUT: %.loc97_57.2: type = converted %int.make_type_32.loc97_57, %.loc97_57.1 [template = i32] // CHECK:STDOUT: %int.make_type_32.loc97_66: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc97_66.1: type = value_of_initializer %int.make_type_32.loc97_66 [template = i32] // CHECK:STDOUT: %.loc97_66.2: type = converted %int.make_type_32.loc97_66, %.loc97_66.1 [template = i32] -// CHECK:STDOUT: %.loc97_69: type = struct_type {.a: i32, .b: i32} [template = constants.%.29] -// CHECK:STDOUT: %.loc97_70: type = ptr_type %.29 [template = constants.%.30] -// CHECK:STDOUT: @ConvertToBadBaseStruct.%return: ref %.30 = var +// CHECK:STDOUT: %.loc97_69: type = struct_type {.a: i32, .b: i32} [template = constants.%.31] +// CHECK:STDOUT: %.loc97_70: type = ptr_type %.31 [template = constants.%.32] +// CHECK:STDOUT: @ConvertToBadBaseStruct.%return: ref %.32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct.decl: %AccessMemberWithInvalidBaseStruct.type = fn_decl @AccessMemberWithInvalidBaseStruct [template = constants.%AccessMemberWithInvalidBaseStruct] { // CHECK:STDOUT: %DeriveFromStruct.ref.loc100: type = name_ref DeriveFromStruct, %DeriveFromStruct.decl [template = constants.%DeriveFromStruct] -// CHECK:STDOUT: %.loc100_57: type = ptr_type %DeriveFromStruct [template = constants.%.31] -// CHECK:STDOUT: %p.loc100_38.1: %.31 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseStruct.%p: %.31 = bind_name p, %p.loc100_38.1 +// CHECK:STDOUT: %.loc100_57: type = ptr_type %DeriveFromStruct [template = constants.%.33] +// CHECK:STDOUT: %p.loc100_38.1: %.33 = param p, runtime_param0 +// CHECK:STDOUT: @AccessMemberWithInvalidBaseStruct.%p: %.33 = bind_name p, %p.loc100_38.1 // CHECK:STDOUT: %int.make_type_32.loc100: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc100_63.1: type = value_of_initializer %int.make_type_32.loc100 [template = i32] // CHECK:STDOUT: %.loc100_63.2: type = converted %int.make_type_32.loc100, %.loc100_63.1 [template = i32] @@ -401,18 +404,18 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromIncomplete.decl: type = class_decl @DeriveFromIncomplete [template = constants.%DeriveFromIncomplete] {} // CHECK:STDOUT: %ConvertToBadBaseIncomplete.decl: %ConvertToBadBaseIncomplete.type = fn_decl @ConvertToBadBaseIncomplete [template = constants.%ConvertToBadBaseIncomplete] { // CHECK:STDOUT: %DeriveFromIncomplete.ref.loc122: type = name_ref DeriveFromIncomplete, %DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] -// CHECK:STDOUT: %.loc122_54: type = ptr_type %DeriveFromIncomplete [template = constants.%.35] -// CHECK:STDOUT: %p.loc122_31.1: %.35 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBaseIncomplete.%p: %.35 = bind_name p, %p.loc122_31.1 +// CHECK:STDOUT: %.loc122_54: type = ptr_type %DeriveFromIncomplete [template = constants.%.37] +// CHECK:STDOUT: %p.loc122_31.1: %.37 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertToBadBaseIncomplete.%p: %.37 = bind_name p, %p.loc122_31.1 // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc122_70: type = ptr_type %Incomplete [template = constants.%.36] -// CHECK:STDOUT: @ConvertToBadBaseIncomplete.%return: ref %.36 = var +// CHECK:STDOUT: %.loc122_70: type = ptr_type %Incomplete [template = constants.%.38] +// CHECK:STDOUT: @ConvertToBadBaseIncomplete.%return: ref %.38 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete.decl: %AccessMemberWithInvalidBaseIncomplete.type = fn_decl @AccessMemberWithInvalidBaseIncomplete [template = constants.%AccessMemberWithInvalidBaseIncomplete] { // CHECK:STDOUT: %DeriveFromIncomplete.ref.loc124: type = name_ref DeriveFromIncomplete, %DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] -// CHECK:STDOUT: %.loc124_65: type = ptr_type %DeriveFromIncomplete [template = constants.%.35] -// CHECK:STDOUT: %p.loc124_42.1: %.35 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseIncomplete.%p: %.35 = bind_name p, %p.loc124_42.1 +// CHECK:STDOUT: %.loc124_65: type = ptr_type %DeriveFromIncomplete [template = constants.%.37] +// CHECK:STDOUT: %p.loc124_42.1: %.37 = param p, runtime_param0 +// CHECK:STDOUT: @AccessMemberWithInvalidBaseIncomplete.%p: %.37 = bind_name p, %p.loc124_42.1 // CHECK:STDOUT: %int.make_type_32.loc124: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc124_71.1: type = value_of_initializer %int.make_type_32.loc124 [template = i32] // CHECK:STDOUT: %.loc124_71.2: type = converted %int.make_type_32.loc124, %.loc124_71.1 [template = i32] @@ -421,18 +424,18 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %DeriveFromFinal.decl: type = class_decl @DeriveFromFinal [template = constants.%DeriveFromFinal] {} // CHECK:STDOUT: %ConvertToBadBaseFinal.decl: %ConvertToBadBaseFinal.type = fn_decl @ConvertToBadBaseFinal [template = constants.%ConvertToBadBaseFinal] { // CHECK:STDOUT: %DeriveFromFinal.ref.loc135: type = name_ref DeriveFromFinal, %DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %.loc135_44: type = ptr_type %DeriveFromFinal [template = constants.%.43] -// CHECK:STDOUT: %p.loc135_26.1: %.43 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertToBadBaseFinal.%p: %.43 = bind_name p, %p.loc135_26.1 +// CHECK:STDOUT: %.loc135_44: type = ptr_type %DeriveFromFinal [template = constants.%.46] +// CHECK:STDOUT: %p.loc135_26.1: %.46 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertToBadBaseFinal.%p: %.46 = bind_name p, %p.loc135_26.1 // CHECK:STDOUT: %Final.ref: type = name_ref Final, %Final.decl [template = constants.%Final] -// CHECK:STDOUT: %.loc135_55: type = ptr_type %Final [template = constants.%.44] -// CHECK:STDOUT: @ConvertToBadBaseFinal.%return: ref %.44 = var +// CHECK:STDOUT: %.loc135_55: type = ptr_type %Final [template = constants.%.47] +// CHECK:STDOUT: @ConvertToBadBaseFinal.%return: ref %.47 = var // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember.decl: %AccessMemberWithInvalidBaseFinal_WithMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_WithMember [template = constants.%AccessMemberWithInvalidBaseFinal_WithMember] { // CHECK:STDOUT: %DeriveFromFinal.ref.loc139: type = name_ref DeriveFromFinal, %DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %.loc139_66: type = ptr_type %DeriveFromFinal [template = constants.%.43] -// CHECK:STDOUT: %p.loc139_48.1: %.43 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_WithMember.%p: %.43 = bind_name p, %p.loc139_48.1 +// CHECK:STDOUT: %.loc139_66: type = ptr_type %DeriveFromFinal [template = constants.%.46] +// CHECK:STDOUT: %p.loc139_48.1: %.46 = param p, runtime_param0 +// CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_WithMember.%p: %.46 = bind_name p, %p.loc139_48.1 // CHECK:STDOUT: %int.make_type_32.loc139: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc139_72.1: type = value_of_initializer %int.make_type_32.loc139 [template = i32] // CHECK:STDOUT: %.loc139_72.2: type = converted %int.make_type_32.loc139, %.loc139_72.1 [template = i32] @@ -440,9 +443,9 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_NoMember.decl: %AccessMemberWithInvalidBaseFinal_NoMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_NoMember [template = constants.%AccessMemberWithInvalidBaseFinal_NoMember] { // CHECK:STDOUT: %DeriveFromFinal.ref.loc143: type = name_ref DeriveFromFinal, %DeriveFromFinal.decl [template = constants.%DeriveFromFinal] -// CHECK:STDOUT: %.loc143_64: type = ptr_type %DeriveFromFinal [template = constants.%.43] -// CHECK:STDOUT: %p.loc143_46.1: %.43 = param p, runtime_param0 -// CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_NoMember.%p: %.43 = bind_name p, %p.loc143_46.1 +// CHECK:STDOUT: %.loc143_64: type = ptr_type %DeriveFromFinal [template = constants.%.46] +// CHECK:STDOUT: %p.loc143_46.1: %.46 = param p, runtime_param0 +// CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_NoMember.%p: %.46 = bind_name p, %p.loc143_46.1 // CHECK:STDOUT: %int.make_type_32.loc143: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc143_70.1: type = value_of_initializer %int.make_type_32.loc143 [template = i32] // CHECK:STDOUT: %.loc143_70.2: type = converted %int.make_type_32.loc143, %.loc143_70.1 [template = i32] @@ -454,12 +457,12 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.7), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.8)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.8) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.9)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.9), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.10) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -470,6 +473,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base // CHECK:STDOUT: } @@ -478,7 +483,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32, %.loc13_10.1 [template = i32] -// CHECK:STDOUT: %.loc13_8: %.3 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13_8: %.4 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Final @@ -488,6 +494,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: class @DeriveFromError { // CHECK:STDOUT: %error.ref: = name_ref error, [template = ] // CHECK:STDOUT: %.loc21: = base_decl , element0 [template] +// CHECK:STDOUT: %.loc22: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromError @@ -496,12 +503,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromNonType { -// CHECK:STDOUT: %.loc35_16.1: i32 = int_literal 32 [template = constants.%.6] -// CHECK:STDOUT: %.loc35_16.2: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%.10] -// CHECK:STDOUT: %.loc35_16.3: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.12] -// CHECK:STDOUT: %Convert.ref: %.11 = name_ref Convert, %.loc35_16.3 [template = constants.%.12] +// CHECK:STDOUT: %.loc35_16.1: i32 = int_literal 32 [template = constants.%.8] +// CHECK:STDOUT: %.loc35_16.2: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%.12] +// CHECK:STDOUT: %.loc35_16.3: %.13 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.14] +// CHECK:STDOUT: %Convert.ref: %.13 = name_ref Convert, %.loc35_16.3 [template = constants.%.14] // CHECK:STDOUT: %.loc35_16.4: type = converted %.loc35_16.1, [template = ] // CHECK:STDOUT: %.loc35_18: = base_decl , element0 [template] +// CHECK:STDOUT: %.loc36: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromNonType @@ -514,6 +522,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc45_16.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc45_16.2: type = converted %int.make_type_32, %.loc45_16.1 [template = i32] // CHECK:STDOUT: %.loc45_19: = base_decl , element0 [template] +// CHECK:STDOUT: %.loc46: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromi32 @@ -523,9 +532,10 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromTuple { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc66_22.1: %.20 = tuple_literal (%Base.ref) -// CHECK:STDOUT: %.loc66_22.2: type = converted %.loc66_22.1, constants.%.21 [template = constants.%.21] +// CHECK:STDOUT: %.loc66_22.1: %.22 = tuple_literal (%Base.ref) +// CHECK:STDOUT: %.loc66_22.2: type = converted %.loc66_22.1, constants.%.23 [template = constants.%.23] // CHECK:STDOUT: %.loc66_23: = base_decl , element0 [template] +// CHECK:STDOUT: %.loc67: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromTuple @@ -540,8 +550,9 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %int.make_type_32.loc87_30: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc87_30.1: type = value_of_initializer %int.make_type_32.loc87_30 [template = i32] // CHECK:STDOUT: %.loc87_30.2: type = converted %int.make_type_32.loc87_30, %.loc87_30.1 [template = i32] -// CHECK:STDOUT: %.loc87_33: type = struct_type {.a: i32, .b: i32} [template = constants.%.29] +// CHECK:STDOUT: %.loc87_33: type = struct_type {.a: i32, .b: i32} [template = constants.%.31] // CHECK:STDOUT: %.loc87_34: = base_decl , element0 [template] +// CHECK:STDOUT: %.loc88: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromStruct @@ -554,6 +565,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: class @DeriveFromIncomplete { // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc112: = base_decl , element0 [template] +// CHECK:STDOUT: %.loc113: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromIncomplete @@ -563,7 +575,8 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @DeriveFromFinal { // CHECK:STDOUT: %Final.ref: type = name_ref Final, file.%Final.decl [template = constants.%Final] -// CHECK:STDOUT: %.loc131: %.41 = base_decl %Final, element0 [template] +// CHECK:STDOUT: %.loc131: %.43 = base_decl %Final, element0 [template] +// CHECK:STDOUT: %.loc132: = complete_type_witness %.44 [template = constants.%.45] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromFinal @@ -573,117 +586,117 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p: %.5) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p: %.7) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.5 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.7 = name_ref p, %p // CHECK:STDOUT: %.loc25: ref %DeriveFromError = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.7)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.9)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p: %.14) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBasNonType(%p: %.16) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.14 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.16 = name_ref p, %p // CHECK:STDOUT: %.loc38: ref %DeriveFromNonType = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBasei32(%p: %.15) -> %.16 { +// CHECK:STDOUT: fn @ConvertToBadBasei32(%p: %.17) -> %.18 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.15 = name_ref p, %p -// CHECK:STDOUT: %.loc57_61.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.16) [template = constants.%.17] -// CHECK:STDOUT: %.loc57_61.2: %.18 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.16) [template = constants.%.19] -// CHECK:STDOUT: %Convert.ref: %.18 = name_ref Convert, %.loc57_61.2 [template = constants.%.19] -// CHECK:STDOUT: %.loc57_61.3: %.16 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p +// CHECK:STDOUT: %.loc57_61.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.18) [template = constants.%.19] +// CHECK:STDOUT: %.loc57_61.2: %.20 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.18) [template = constants.%.21] +// CHECK:STDOUT: %Convert.ref: %.20 = name_ref Convert, %.loc57_61.2 [template = constants.%.21] +// CHECK:STDOUT: %.loc57_61.3: %.18 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p: %.15) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBasei32(%p: %.17) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.15 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.17 = name_ref p, %p // CHECK:STDOUT: %.loc59: ref %DeriveFromi32 = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseTuple(%p: %.24) -> %.25 { +// CHECK:STDOUT: fn @ConvertToBadBaseTuple(%p: %.26) -> %.27 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.24 = name_ref p, %p -// CHECK:STDOUT: %.loc76_69.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.25) [template = constants.%.26] -// CHECK:STDOUT: %.loc76_69.2: %.27 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.25) [template = constants.%.28] -// CHECK:STDOUT: %Convert.ref: %.27 = name_ref Convert, %.loc76_69.2 [template = constants.%.28] -// CHECK:STDOUT: %.loc76_69.3: %.25 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.26 = name_ref p, %p +// CHECK:STDOUT: %.loc76_69.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.27) [template = constants.%.28] +// CHECK:STDOUT: %.loc76_69.2: %.29 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.27) [template = constants.%.30] +// CHECK:STDOUT: %Convert.ref: %.29 = name_ref Convert, %.loc76_69.2 [template = constants.%.30] +// CHECK:STDOUT: %.loc76_69.3: %.27 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p: %.24) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseTuple(%p: %.26) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.24 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.26 = name_ref p, %p // CHECK:STDOUT: %.loc78: ref %DeriveFromTuple = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p: %.31) -> %.30 { +// CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p: %.33) -> %.32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.31 = name_ref p, %p -// CHECK:STDOUT: %.loc97_82.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.30) [template = constants.%.32] -// CHECK:STDOUT: %.loc97_82.2: %.33 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.30) [template = constants.%.34] -// CHECK:STDOUT: %Convert.ref: %.33 = name_ref Convert, %.loc97_82.2 [template = constants.%.34] -// CHECK:STDOUT: %.loc97_82.3: %.30 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.33 = name_ref p, %p +// CHECK:STDOUT: %.loc97_82.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.32) [template = constants.%.34] +// CHECK:STDOUT: %.loc97_82.2: %.35 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.32) [template = constants.%.36] +// CHECK:STDOUT: %Convert.ref: %.35 = name_ref Convert, %.loc97_82.2 [template = constants.%.36] +// CHECK:STDOUT: %.loc97_82.3: %.32 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p: %.31) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseStruct(%p: %.33) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.31 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.33 = name_ref p, %p // CHECK:STDOUT: %.loc100: ref %DeriveFromStruct = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseIncomplete(%p: %.35) -> %.36 { +// CHECK:STDOUT: fn @ConvertToBadBaseIncomplete(%p: %.37) -> %.38 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.35 = name_ref p, %p -// CHECK:STDOUT: %.loc122_82.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.36) [template = constants.%.37] -// CHECK:STDOUT: %.loc122_82.2: %.38 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.36) [template = constants.%.39] -// CHECK:STDOUT: %Convert.ref: %.38 = name_ref Convert, %.loc122_82.2 [template = constants.%.39] -// CHECK:STDOUT: %.loc122_82.3: %.36 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.37 = name_ref p, %p +// CHECK:STDOUT: %.loc122_82.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.38) [template = constants.%.39] +// CHECK:STDOUT: %.loc122_82.2: %.40 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.38) [template = constants.%.41] +// CHECK:STDOUT: %Convert.ref: %.40 = name_ref Convert, %.loc122_82.2 [template = constants.%.41] +// CHECK:STDOUT: %.loc122_82.3: %.38 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p: %.35) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseIncomplete(%p: %.37) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.35 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.37 = name_ref p, %p // CHECK:STDOUT: %.loc124: ref %DeriveFromIncomplete = deref %p.ref // CHECK:STDOUT: %n.ref: = name_ref n, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertToBadBaseFinal(%p: %.43) -> %.44 { +// CHECK:STDOUT: fn @ConvertToBadBaseFinal(%p: %.46) -> %.47 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.43 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.46 = name_ref p, %p // CHECK:STDOUT: %.loc136_11.1: ref %DeriveFromFinal = deref %p.ref // CHECK:STDOUT: %.loc136_11.2: ref %Final = class_element_access %.loc136_11.1, element0 -// CHECK:STDOUT: %.loc136_11.3: %.44 = addr_of %.loc136_11.2 -// CHECK:STDOUT: %.loc136_11.4: %.44 = converted %p.ref, %.loc136_11.3 +// CHECK:STDOUT: %.loc136_11.3: %.47 = addr_of %.loc136_11.2 +// CHECK:STDOUT: %.loc136_11.4: %.47 = converted %p.ref, %.loc136_11.3 // CHECK:STDOUT: return %.loc136_11.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_WithMember(%p: %.43) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_WithMember(%p: %.46) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.43 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.46 = name_ref p, %p // CHECK:STDOUT: %.loc140_11: ref %DeriveFromFinal = deref %p.ref -// CHECK:STDOUT: %a.ref: %.3 = name_ref a, @Final.%.loc13_8 [template = @Final.%.loc13_8] +// CHECK:STDOUT: %a.ref: %.4 = name_ref a, @Final.%.loc13_8 [template = @Final.%.loc13_8] // CHECK:STDOUT: %.loc140_14.1: ref %Final = class_element_access %.loc140_11, element0 // CHECK:STDOUT: %.loc140_14.2: ref %Final = converted %.loc140_11, %.loc140_14.1 // CHECK:STDOUT: %.loc140_14.3: ref i32 = class_element_access %.loc140_14.2, element0 @@ -691,9 +704,9 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: return %.loc140_14.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_NoMember(%p: %.43) -> i32 { +// CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_NoMember(%p: %.46) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.43 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.46 = name_ref p, %p // CHECK:STDOUT: %.loc147: ref %DeriveFromFinal = deref %p.ref // CHECK:STDOUT: %b.ref: = name_ref b, [template = ] // CHECK:STDOUT: return @@ -713,7 +726,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -721,59 +734,59 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Dest => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.11 -// CHECK:STDOUT: %.3 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.13 +// CHECK:STDOUT: %.3 => constants.%.14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.16) { -// CHECK:STDOUT: %Dest => constants.%.16 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.18) { +// CHECK:STDOUT: %Dest => constants.%.18 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.1 => constants.%.19 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 // CHECK:STDOUT: %Convert => constants.%Convert.3 -// CHECK:STDOUT: %.2 => constants.%.18 -// CHECK:STDOUT: %.3 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %.3 => constants.%.21 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.25) { -// CHECK:STDOUT: %Dest => constants.%.25 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.27) { +// CHECK:STDOUT: %Dest => constants.%.27 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.26 +// CHECK:STDOUT: %.1 => constants.%.28 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.4 // CHECK:STDOUT: %Convert => constants.%Convert.4 -// CHECK:STDOUT: %.2 => constants.%.27 -// CHECK:STDOUT: %.3 => constants.%.28 +// CHECK:STDOUT: %.2 => constants.%.29 +// CHECK:STDOUT: %.3 => constants.%.30 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.30) { -// CHECK:STDOUT: %Dest => constants.%.30 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.32) { +// CHECK:STDOUT: %Dest => constants.%.32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.32 +// CHECK:STDOUT: %.1 => constants.%.34 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.2 => constants.%.33 -// CHECK:STDOUT: %.3 => constants.%.34 +// CHECK:STDOUT: %.2 => constants.%.35 +// CHECK:STDOUT: %.3 => constants.%.36 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.36) { -// CHECK:STDOUT: %Dest => constants.%.36 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.38) { +// CHECK:STDOUT: %Dest => constants.%.38 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.37 +// CHECK:STDOUT: %.1 => constants.%.39 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.6 // CHECK:STDOUT: %Convert => constants.%Convert.6 -// CHECK:STDOUT: %.2 => constants.%.38 -// CHECK:STDOUT: %.3 => constants.%.39 +// CHECK:STDOUT: %.2 => constants.%.40 +// CHECK:STDOUT: %.3 => constants.%.41 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_method_define.carbon b/toolchain/check/testdata/class/fail_base_method_define.carbon index 1c51226c18354..b44b03cc34ac0 100644 --- a/toolchain/check/testdata/class/fail_base_method_define.carbon +++ b/toolchain/check/testdata/class/fail_base_method_define.carbon @@ -42,14 +42,16 @@ fn D.C.F() {} // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %D, %B [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %D, %B [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.6: %.type = struct_value () [template] +// CHECK:STDOUT: %.8: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,12 +77,13 @@ fn D.C.F() {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.6] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.8] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %.loc17: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -90,6 +93,7 @@ fn D.C.F() {} // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} +// CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -98,7 +102,8 @@ fn D.C.F() {} // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc20: %.4 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc20: %.5 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc21: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D diff --git a/toolchain/check/testdata/class/fail_base_misplaced.carbon b/toolchain/check/testdata/class/fail_base_misplaced.carbon index eda666e07a11e..34b1107a7c855 100644 --- a/toolchain/check/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/check/testdata/class/fail_base_misplaced.carbon @@ -32,14 +32,17 @@ fn F() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file {} // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index 2acb37c4bb5cd..64025c787c7be 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -56,17 +56,19 @@ class C4 { // CHECK:STDOUT: constants { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %C1: type = class_type @C1 [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %C1, %B [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %C1, %B [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %C2: type = class_type @C2 [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %C2, %B [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %C2, %B [template] // CHECK:STDOUT: %C3: type = class_type @C3 [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %C3, %B [template] +// CHECK:STDOUT: %.9: type = unbound_element_type %C3, %B [template] // CHECK:STDOUT: %C4: type = class_type @C4 [template] -// CHECK:STDOUT: %.8: type = unbound_element_type %C4, %B [template] +// CHECK:STDOUT: %.10: type = unbound_element_type %C4, %B [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -100,13 +102,16 @@ class C4 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C1 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc18: %.4 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc18: %.5 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C1 @@ -116,7 +121,8 @@ class C4 { // CHECK:STDOUT: // CHECK:STDOUT: class @C2 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc30: %.6 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc30: %.8 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc31: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C2 @@ -125,7 +131,8 @@ class C4 { // CHECK:STDOUT: // CHECK:STDOUT: class @C3 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc41: %.7 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc41: %.9 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc42: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C3 @@ -135,7 +142,8 @@ class C4 { // CHECK:STDOUT: // CHECK:STDOUT: class @C4 { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc51: %.8 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc51: %.10 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc52: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C4 diff --git a/toolchain/check/testdata/class/fail_base_no_extend.carbon b/toolchain/check/testdata/class/fail_base_no_extend.carbon index 581a2d5657c6f..0b6441fa741a7 100644 --- a/toolchain/check/testdata/class/fail_base_no_extend.carbon +++ b/toolchain/check/testdata/class/fail_base_no_extend.carbon @@ -22,11 +22,13 @@ class C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %C, %B [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -54,13 +56,16 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc17: %.4 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc17: %.5 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc18: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index 4aa9c636eb614..8601b581ace82 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -40,14 +40,16 @@ class D { // CHECK:STDOUT: constants { // CHECK:STDOUT: %B1: type = class_type @B1 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B2: type = class_type @B2 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %C, %B1 [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %B1} [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %C, %B1 [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %B1} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %D, %B1 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %D, %B1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -79,19 +81,24 @@ class D { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B1 { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B2 { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B1.ref: type = name_ref B1, file.%B1.decl [template = constants.%B1] -// CHECK:STDOUT: %.loc15: %.4 = base_decl %B1, element0 [template] +// CHECK:STDOUT: %.loc15: %.5 = base_decl %B1, element0 [template] // CHECK:STDOUT: %B2.ref: type = name_ref B2, file.%B2.decl [template = constants.%B2] +// CHECK:STDOUT: %.loc24: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -101,8 +108,9 @@ class D { // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: %B1.ref.loc28: type = name_ref B1, file.%B1.decl [template = constants.%B1] -// CHECK:STDOUT: %.loc28: %.6 = base_decl %B1, element0 [template] +// CHECK:STDOUT: %.loc28: %.8 = base_decl %B1, element0 [template] // CHECK:STDOUT: %B1.ref.loc35: type = name_ref B1, file.%B1.decl [template = constants.%B1] +// CHECK:STDOUT: %.loc36: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index 2e55b5909786a..329a6909dbff1 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -24,13 +24,15 @@ let b: B = C.base; // CHECK:STDOUT: constants { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %C, %B [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %B} [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %.3} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %.4} [template] +// CHECK:STDOUT: %.9: type = ptr_type %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -60,13 +62,16 @@ let b: B = C.base; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc14: %.4 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc14: %.5 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -77,7 +82,7 @@ let b: B = C.base; // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %base.ref: %.4 = name_ref base, @C.%.loc14 [template = @C.%.loc14] +// CHECK:STDOUT: %base.ref: %.5 = name_ref base, @C.%.loc14 [template = @C.%.loc14] // CHECK:STDOUT: %b: %B = bind_name b, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 9ffa9d66da537..728dc4c650aa6 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -35,29 +35,31 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %A, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %B, i32 [template] -// CHECK:STDOUT: %.5: type = struct_type {.b: i32} [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %B, i32 [template] +// CHECK:STDOUT: %.6: type = struct_type {.b: i32} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %AccessBInA.type: type = fn_type @AccessBInA [template] // CHECK:STDOUT: %AccessBInA: %AccessBInA.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.9: type = ptr_type %.6 [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.8) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.8 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.10: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.10) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.10 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.11: type = interface_type @ImplicitAs, @ImplicitAs(%B) [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.13: type = interface_type @ImplicitAs, @ImplicitAs(%B) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%B) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Convert.type.2 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.14: %.9 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.14: type = assoc_entity_type %.13, %Convert.type.2 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.16: %.11 = assoc_entity element0, imports.%import_ref.7 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -76,7 +78,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.14)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.11) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.16)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -107,12 +109,12 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.8), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.9)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.9) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.10)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.10), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.11) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.12)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -127,6 +129,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -137,7 +140,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_32, %.loc16_10.1 [template = i32] -// CHECK:STDOUT: %.loc16_8: %.4 = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc16_8: %.5 = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -150,19 +154,19 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %b.ref: %.4 = name_ref b, @B.%.loc16_8 [template = @B.%.loc16_8] -// CHECK:STDOUT: %.loc26_11.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%B) [template = constants.%.11] -// CHECK:STDOUT: %.loc26_11.2: %.12 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%B) [template = constants.%.13] -// CHECK:STDOUT: %Convert.ref: %.12 = name_ref Convert, %.loc26_11.2 [template = constants.%.13] +// CHECK:STDOUT: %b.ref: %.5 = name_ref b, @B.%.loc16_8 [template = @B.%.loc16_8] +// CHECK:STDOUT: %.loc26_11.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%B) [template = constants.%.13] +// CHECK:STDOUT: %.loc26_11.2: %.14 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%B) [template = constants.%.15] +// CHECK:STDOUT: %Convert.ref: %.14 = name_ref Convert, %.loc26_11.2 [template = constants.%.15] // CHECK:STDOUT: %.loc26_11.3: %B = converted %a.ref, [template = ] // CHECK:STDOUT: %.loc26_11.4: i32 = class_element_access , element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.8)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.10)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.10)] +// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -181,7 +185,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -189,11 +193,11 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %Dest => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.12 -// CHECK:STDOUT: %.3 => constants.%.13 +// CHECK:STDOUT: %.2 => constants.%.14 +// CHECK:STDOUT: %.3 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index ddc4528b46caf..f53f2c4827e12 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -60,6 +60,7 @@ fn Make() -> C { // CHECK:STDOUT: class @C { // CHECK:STDOUT: %NoSuchType.ref: = name_ref NoSuchType, [template = ] // CHECK:STDOUT: %.loc15: = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc16: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 315090831b31d..a38cfd132afdc 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -49,46 +49,48 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %A1, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %A2: type = class_type @A2 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %A2, i32 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %A2, i32 [template] // CHECK:STDOUT: %B2: type = class_type @B2 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %B2, %A2 [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %B2, i32 [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %A2, .b: i32} [template] -// CHECK:STDOUT: %.9: type = ptr_type %B2 [template] -// CHECK:STDOUT: %.10: type = ptr_type %A1 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %B2, %A2 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %B2, i32 [template] +// CHECK:STDOUT: %.9: type = struct_type {.base: %A2, .b: i32} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] +// CHECK:STDOUT: %.11: type = ptr_type %B2 [template] +// CHECK:STDOUT: %.12: type = ptr_type %A1 [template] // CHECK:STDOUT: %ConvertUnrelated.type: type = fn_type @ConvertUnrelated [template] // CHECK:STDOUT: %ConvertUnrelated: %ConvertUnrelated.type = struct_value () [template] -// CHECK:STDOUT: %.11: type = struct_type {.base: %.5, .b: i32} [template] -// CHECK:STDOUT: %.12: type = ptr_type %.11 [template] -// CHECK:STDOUT: %.13: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.13: type = struct_type {.base: %.6, .b: i32} [template] +// CHECK:STDOUT: %.14: type = ptr_type %.13 [template] +// CHECK:STDOUT: %.15: type = ptr_type %.9 [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.14: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.14) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.14 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.16: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.16) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.16 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.15: type = assoc_entity_type %.14, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.17: type = interface_type @ImplicitAs, @ImplicitAs(%.10) [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%.10) [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %.16, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.19: type = interface_type @ImplicitAs, @ImplicitAs(%.12) [template] +// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%.12) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.18: type = assoc_entity_type %.17, %Convert.type.2 [template] -// CHECK:STDOUT: %.19: %.18 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.20: %.15 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.20: type = assoc_entity_type %.19, %Convert.type.2 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.22: %.17 = assoc_entity element0, imports.%import_ref.7 [symbolic] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] -// CHECK:STDOUT: %.21: type = ptr_type %Incomplete [template] -// CHECK:STDOUT: %.22: type = ptr_type %A2 [template] +// CHECK:STDOUT: %.23: type = ptr_type %Incomplete [template] +// CHECK:STDOUT: %.24: type = ptr_type %A2 [template] // CHECK:STDOUT: %ConvertIncomplete.type: type = fn_type @ConvertIncomplete [template] // CHECK:STDOUT: %ConvertIncomplete: %ConvertIncomplete.type = struct_value () [template] -// CHECK:STDOUT: %.23: type = interface_type @ImplicitAs, @ImplicitAs(%.22) [template] -// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert, @ImplicitAs(%.22) [template] +// CHECK:STDOUT: %.25: type = interface_type @ImplicitAs, @ImplicitAs(%.24) [template] +// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert, @ImplicitAs(%.24) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.24: type = assoc_entity_type %.23, %Convert.type.3 [template] -// CHECK:STDOUT: %.25: %.24 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.26: type = assoc_entity_type %.25, %Convert.type.3 [template] +// CHECK:STDOUT: %.27: %.26 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -107,7 +109,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.15) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.20)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.17) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.22)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -129,22 +131,22 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} // CHECK:STDOUT: %ConvertUnrelated.decl: %ConvertUnrelated.type = fn_decl @ConvertUnrelated [template = constants.%ConvertUnrelated] { // CHECK:STDOUT: %B2.ref: type = name_ref B2, %B2.decl [template = constants.%B2] -// CHECK:STDOUT: %.loc31_26: type = ptr_type %B2 [template = constants.%.9] -// CHECK:STDOUT: %p.loc31_21.1: %.9 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertUnrelated.%p: %.9 = bind_name p, %p.loc31_21.1 +// CHECK:STDOUT: %.loc31_26: type = ptr_type %B2 [template = constants.%.11] +// CHECK:STDOUT: %p.loc31_21.1: %.11 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertUnrelated.%p: %.11 = bind_name p, %p.loc31_21.1 // CHECK:STDOUT: %A1.ref: type = name_ref A1, %A1.decl [template = constants.%A1] -// CHECK:STDOUT: %.loc31_34: type = ptr_type %A1 [template = constants.%.10] -// CHECK:STDOUT: @ConvertUnrelated.%return: ref %.10 = var +// CHECK:STDOUT: %.loc31_34: type = ptr_type %A1 [template = constants.%.12] +// CHECK:STDOUT: @ConvertUnrelated.%return: ref %.12 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: %ConvertIncomplete.decl: %ConvertIncomplete.type = fn_decl @ConvertIncomplete [template = constants.%ConvertIncomplete] { // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc41_35: type = ptr_type %Incomplete [template = constants.%.21] -// CHECK:STDOUT: %p.loc41_22.1: %.21 = param p, runtime_param0 -// CHECK:STDOUT: @ConvertIncomplete.%p: %.21 = bind_name p, %p.loc41_22.1 +// CHECK:STDOUT: %.loc41_35: type = ptr_type %Incomplete [template = constants.%.23] +// CHECK:STDOUT: %p.loc41_22.1: %.23 = param p, runtime_param0 +// CHECK:STDOUT: @ConvertIncomplete.%p: %.23 = bind_name p, %p.loc41_22.1 // CHECK:STDOUT: %A2.ref: type = name_ref A2, %A2.decl [template = constants.%A2] -// CHECK:STDOUT: %.loc41_43: type = ptr_type %A2 [template = constants.%.22] -// CHECK:STDOUT: @ConvertIncomplete.%return: ref %.22 = var +// CHECK:STDOUT: %.loc41_43: type = ptr_type %A2 [template = constants.%.24] +// CHECK:STDOUT: @ConvertIncomplete.%return: ref %.24 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -152,12 +154,12 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.14)] -// CHECK:STDOUT: %Self: %.14 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %Self: %.16 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.14), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.15)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.15) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.16)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.16), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.17)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.17) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.18)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -172,6 +174,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A1 @@ -182,7 +185,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_10.2: type = converted %int.make_type_32, %.loc16_10.1 [template = i32] -// CHECK:STDOUT: %.loc16_8: %.4 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc16_8: %.5 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A2 @@ -191,11 +195,12 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: class @B2 { // CHECK:STDOUT: %A2.ref: type = name_ref A2, file.%A2.decl [template = constants.%A2] -// CHECK:STDOUT: %.loc20: %.6 = base_decl %A2, element0 [template] +// CHECK:STDOUT: %.loc20: %.7 = base_decl %A2, element0 [template] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc21_10.2: type = converted %int.make_type_32, %.loc21_10.1 [template = i32] -// CHECK:STDOUT: %.loc21_8: %.7 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc21_8: %.8 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc22: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B2 @@ -208,31 +213,31 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertUnrelated(%p: %.9) -> %.10 { +// CHECK:STDOUT: fn @ConvertUnrelated(%p: %.11) -> %.12 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.9 = name_ref p, %p -// CHECK:STDOUT: %.loc31_46.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.10) [template = constants.%.17] -// CHECK:STDOUT: %.loc31_46.2: %.18 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.10) [template = constants.%.19] -// CHECK:STDOUT: %Convert.ref: %.18 = name_ref Convert, %.loc31_46.2 [template = constants.%.19] -// CHECK:STDOUT: %.loc31_46.3: %.10 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.11 = name_ref p, %p +// CHECK:STDOUT: %.loc31_46.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.12) [template = constants.%.19] +// CHECK:STDOUT: %.loc31_46.2: %.20 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.12) [template = constants.%.21] +// CHECK:STDOUT: %Convert.ref: %.20 = name_ref Convert, %.loc31_46.2 [template = constants.%.21] +// CHECK:STDOUT: %.loc31_46.3: %.12 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.14)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.16)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.14)] -// CHECK:STDOUT: %Self: %.14 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.16)] +// CHECK:STDOUT: %Self: %.16 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @ConvertIncomplete(%p: %.21) -> %.22 { +// CHECK:STDOUT: fn @ConvertIncomplete(%p: %.23) -> %.24 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.21 = name_ref p, %p -// CHECK:STDOUT: %.loc41_55.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.22) [template = constants.%.23] -// CHECK:STDOUT: %.loc41_55.2: %.24 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.22) [template = constants.%.25] -// CHECK:STDOUT: %Convert.ref: %.24 = name_ref Convert, %.loc41_55.2 [template = constants.%.25] -// CHECK:STDOUT: %.loc41_55.3: %.22 = converted %p.ref, [template = ] +// CHECK:STDOUT: %p.ref: %.23 = name_ref p, %p +// CHECK:STDOUT: %.loc41_55.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.24) [template = constants.%.25] +// CHECK:STDOUT: %.loc41_55.2: %.26 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.24) [template = constants.%.27] +// CHECK:STDOUT: %Convert.ref: %.26 = name_ref Convert, %.loc41_55.2 [template = constants.%.27] +// CHECK:STDOUT: %.loc41_55.3: %.24 = converted %p.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -250,31 +255,31 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.16 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.10) { -// CHECK:STDOUT: %Dest => constants.%.10 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.12) { +// CHECK:STDOUT: %Dest => constants.%.12 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.1 => constants.%.19 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.18 -// CHECK:STDOUT: %.3 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.20 +// CHECK:STDOUT: %.3 => constants.%.21 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%.22) { -// CHECK:STDOUT: %Dest => constants.%.22 +// CHECK:STDOUT: specific @ImplicitAs(constants.%.24) { +// CHECK:STDOUT: %Dest => constants.%.24 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.23 +// CHECK:STDOUT: %.1 => constants.%.25 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 // CHECK:STDOUT: %Convert => constants.%Convert.3 -// CHECK:STDOUT: %.2 => constants.%.24 -// CHECK:STDOUT: %.3 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: %.3 => constants.%.27 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_extend_cycle.carbon b/toolchain/check/testdata/class/fail_extend_cycle.carbon index b4df199dfb5fe..0aff724330596 100644 --- a/toolchain/check/testdata/class/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/fail_extend_cycle.carbon @@ -36,13 +36,15 @@ base class A { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %B, %A [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %.6: type = class_type @.1 [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %.6, %A [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.8: type = class_type @.1 [template] +// CHECK:STDOUT: %.9: type = unbound_element_type %.8, %A [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -67,17 +69,20 @@ base class A { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.6] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.8] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc16: %.4 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc16: %.5 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -87,12 +92,13 @@ base class A { // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc27: %.7 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc27: %.9 = base_decl %A, element0 [template] // CHECK:STDOUT: %C.ref: = name_ref C, [template = ] // CHECK:STDOUT: %.loc31: = field_decl c, element1 [template] +// CHECK:STDOUT: %.loc32: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.6 +// CHECK:STDOUT: .Self = constants.%.8 // CHECK:STDOUT: .base = %.loc27 // CHECK:STDOUT: .c = %.loc31 // CHECK:STDOUT: extend name_scope2 diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index bd79da3df2435..e8a148a1080a1 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -45,6 +45,7 @@ class Class { // CHECK:STDOUT: %.3: i32 = int_literal 0 [template] // CHECK:STDOUT: %.4: i32 = int_literal 1 [template] // CHECK:STDOUT: %.5: type = struct_type {.j: i32, .k: i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -90,6 +91,7 @@ class Class { // CHECK:STDOUT: %.loc34_16.2: type = converted %int.make_type_32.loc34, %.loc34_16.1 [template = i32] // CHECK:STDOUT: %.loc34_22: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %m: i32 = bind_name m, %.loc34_22 +// CHECK:STDOUT: %.loc35: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 0c3ad8525e0dc..38c0b0592787f 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -43,11 +43,12 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.a: %T} [symbolic] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %N: i32 = bind_symbolic_name N 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,7 +76,7 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T.loc11_13.1: type = param T, runtime_param // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc32_14.2: type = converted %int.make_type_32, %.loc32_14.1 [template = i32] @@ -98,6 +99,8 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] +// CHECK:STDOUT: %.2: type = struct_type {.a: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] @@ -111,6 +114,7 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %n.loc13_20.1: @F.%T (%T) = param n, runtime_param1 // CHECK:STDOUT: %n.loc13_20.2: @F.%T (%T) = bind_name n, %n.loc13_20.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 6ea845094431c..b0dec50e156ac 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -52,6 +52,7 @@ var a: Incomplete; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Empty: type = class_type @Empty [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -80,6 +81,8 @@ var a: Incomplete; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Empty // CHECK:STDOUT: } @@ -91,13 +94,14 @@ var a: Incomplete; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Empty: type = class_type @Empty [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = class_type @.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = class_type @.1 [template] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+6, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+8, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -120,7 +124,7 @@ var a: Incomplete; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.2 [template = constants.%Incomplete] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var @@ -132,8 +136,10 @@ var a: Incomplete; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { +// CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.2 +// CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index c36577907803c..eea5a5f5fa739 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -39,15 +39,16 @@ fn F() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.6: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.8: type = struct_type {.a: i32, .c: i32} [template] -// CHECK:STDOUT: %.9: i32 = int_literal 3 [template] -// CHECK:STDOUT: %.10: type = struct_type {.a: i32, .b: i32, .c: i32} [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.7: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.9: type = struct_type {.a: i32, .c: i32} [template] +// CHECK:STDOUT: %.10: i32 = int_literal 3 [template] +// CHECK:STDOUT: %.11: type = struct_type {.a: i32, .b: i32, .c: i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -85,6 +86,7 @@ fn F() { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -96,25 +98,25 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc21_9: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc21_10.1: %.5 = struct_literal (%.loc21_9) +// CHECK:STDOUT: %.loc21_9: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc21_10.1: %.6 = struct_literal (%.loc21_9) // CHECK:STDOUT: %Class.ref.loc21: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc21_10.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc21_10.3: ref %Class = temporary %.loc21_10.2, // CHECK:STDOUT: %.loc21_12: ref %Class = converted %.loc21_10.1, %.loc21_10.3 -// CHECK:STDOUT: %.loc26_9: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc26_17: i32 = int_literal 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc26_18.1: %.8 = struct_literal (%.loc26_9, %.loc26_17) +// CHECK:STDOUT: %.loc26_9: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc26_17: i32 = int_literal 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc26_18.1: %.9 = struct_literal (%.loc26_9, %.loc26_17) // CHECK:STDOUT: %Class.ref.loc26: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc26_18.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc26_18.3: ref i32 = class_element_access %.loc26_18.2, element0 -// CHECK:STDOUT: %.loc26_18.4: init i32 = initialize_from %.loc26_9 to %.loc26_18.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc26_18.4: init i32 = initialize_from %.loc26_9 to %.loc26_18.3 [template = constants.%.5] // CHECK:STDOUT: %.loc26_18.5: ref %Class = temporary %.loc26_18.2, // CHECK:STDOUT: %.loc26_20: ref %Class = converted %.loc26_18.1, %.loc26_18.5 -// CHECK:STDOUT: %.loc30_9: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc30_17: i32 = int_literal 2 [template = constants.%.7] -// CHECK:STDOUT: %.loc30_25: i32 = int_literal 3 [template = constants.%.9] -// CHECK:STDOUT: %.loc30_26.1: %.10 = struct_literal (%.loc30_9, %.loc30_17, %.loc30_25) +// CHECK:STDOUT: %.loc30_9: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc30_17: i32 = int_literal 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc30_25: i32 = int_literal 3 [template = constants.%.10] +// CHECK:STDOUT: %.loc30_26.1: %.11 = struct_literal (%.loc30_9, %.loc30_17, %.loc30_25) // CHECK:STDOUT: %Class.ref.loc30: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc30_26.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc30_26.3: ref %Class = temporary %.loc30_26.2, diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index aec3868aa2d4b..24a2bb658f129 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -35,15 +35,16 @@ fn F() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %.4: type = ptr_type %Class [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %Class [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] -// CHECK:STDOUT: %struct: %Class = struct_value (%.6, %.7) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.7: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] +// CHECK:STDOUT: %struct: %Class = struct_value (%.7, %.8) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -72,9 +73,9 @@ fn F() { // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] -// CHECK:STDOUT: %.loc16: type = ptr_type %Class [template = constants.%.4] -// CHECK:STDOUT: %p.loc16_6.1: %.4 = param p, runtime_param0 -// CHECK:STDOUT: @G.%p: %.4 = bind_name p, %p.loc16_6.1 +// CHECK:STDOUT: %.loc16: type = ptr_type %Class [template = constants.%.5] +// CHECK:STDOUT: %p.loc16_6.1: %.5 = param p, runtime_param0 +// CHECK:STDOUT: @G.%p: %.5 = bind_name p, %p.loc16_6.1 // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } @@ -88,6 +89,7 @@ fn F() { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -97,22 +99,22 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%p: %.4); +// CHECK:STDOUT: fn @G(%p: %.5); // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref.loc25_10: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.var: ref %Class = var c // CHECK:STDOUT: %c: ref %Class = bind_name c, %c.var -// CHECK:STDOUT: %.loc25_24: i32 = int_literal 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc25_32: i32 = int_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %.loc25_24: i32 = int_literal 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc25_32: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: %.loc25_33.1: %.3 = struct_literal (%.loc25_24, %.loc25_32) // CHECK:STDOUT: %Class.ref.loc25_38: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc25_33.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc25_33.3: ref i32 = class_element_access %.loc25_33.2, element0 -// CHECK:STDOUT: %.loc25_33.4: init i32 = initialize_from %.loc25_24 to %.loc25_33.3 [template = constants.%.6] +// CHECK:STDOUT: %.loc25_33.4: init i32 = initialize_from %.loc25_24 to %.loc25_33.3 [template = constants.%.7] // CHECK:STDOUT: %.loc25_33.5: ref i32 = class_element_access %.loc25_33.2, element1 -// CHECK:STDOUT: %.loc25_33.6: init i32 = initialize_from %.loc25_32 to %.loc25_33.5 [template = constants.%.7] +// CHECK:STDOUT: %.loc25_33.6: init i32 = initialize_from %.loc25_32 to %.loc25_33.5 [template = constants.%.8] // CHECK:STDOUT: %.loc25_33.7: init %Class = class_init (%.loc25_33.4, %.loc25_33.6), %.loc25_33.2 [template = constants.%struct] // CHECK:STDOUT: %.loc25_33.8: ref %Class = temporary %.loc25_33.2, %.loc25_33.7 // CHECK:STDOUT: %.loc25_35.1: ref %Class = converted %.loc25_33.1, %.loc25_33.8 @@ -120,7 +122,7 @@ fn F() { // CHECK:STDOUT: assign %c.var, // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G] // CHECK:STDOUT: %c.ref: ref %Class = name_ref c, %c -// CHECK:STDOUT: %.loc26: %.4 = addr_of %c.ref +// CHECK:STDOUT: %.loc26: %.5 = addr_of %c.ref // CHECK:STDOUT: %G.call: init %.1 = call %G.ref(%.loc26) // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index fbe6387553365..62f73d5314f41 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -47,14 +47,16 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] -// CHECK:STDOUT: %.6: type = struct_type {.a: %A} [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.7: type = struct_type {.a: %A} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: type = struct_type {.a: %.4} [template] -// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.9: type = struct_type {.a: %.5} [template] +// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -82,9 +84,9 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc19: type = struct_type {.a: %A} [template = constants.%.6] -// CHECK:STDOUT: %s.loc19_6.1: %.6 = param s, runtime_param0 -// CHECK:STDOUT: @F.2.%s: %.6 = bind_name s, %s.loc19_6.1 +// CHECK:STDOUT: %.loc19: type = struct_type {.a: %A} [template = constants.%.7] +// CHECK:STDOUT: %s.loc19_6.1: %.7 = param s, runtime_param0 +// CHECK:STDOUT: @F.2.%s: %.7 = bind_name s, %s.loc19_6.1 // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b.loc19_18.1: %B = param b, runtime_param1 // CHECK:STDOUT: @F.2.%b: %B = bind_name b, %b.loc19_18.1 @@ -99,6 +101,7 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: %self.loc12_13.3: %.1 = bind_name self, %self.loc12_13.1 // CHECK:STDOUT: %.loc12_8: %.1 = addr_pattern %self.loc12_13.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -107,7 +110,8 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc16: %.5 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc16: %.6 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -116,15 +120,15 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1[addr @A.%self.loc12_13.3: %.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2(%s: %.6, %b: %B) { +// CHECK:STDOUT: fn @F.2(%s: %.7, %b: %B) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %s.ref: %.6 = name_ref s, %s +// CHECK:STDOUT: %s.ref: %.7 = name_ref s, %s // CHECK:STDOUT: %.loc28_4: %A = struct_access %s.ref, element0 // CHECK:STDOUT: %F.ref.loc28: %F.type.1 = name_ref F, @A.%F.decl [template = constants.%F.1] // CHECK:STDOUT: %.loc28_6: = bound_method %.loc28_4, %F.ref.loc28 // CHECK:STDOUT: %F.call.loc28: init %.2 = call %.loc28_6() [template = ] // CHECK:STDOUT: %b.ref: %B = name_ref b, %b -// CHECK:STDOUT: %a.ref: %.5 = name_ref a, @B.%.loc16 [template = @B.%.loc16] +// CHECK:STDOUT: %a.ref: %.6 = name_ref a, @B.%.loc16 [template = @B.%.loc16] // CHECK:STDOUT: %.loc38_4.1: ref %A = class_element_access %b.ref, element0 // CHECK:STDOUT: %.loc38_4.2: %A = bind_value %.loc38_4.1 // CHECK:STDOUT: %F.ref.loc38: %F.type.1 = name_ref F, @A.%F.decl [template = constants.%F.1] diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 4234a5e42415e..3e83d2ae0e2f7 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -35,8 +35,9 @@ fn T.F() {} // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -62,7 +63,7 @@ fn T.F() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { @@ -72,6 +73,7 @@ fn T.F() {} // CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index 5b809b1d78458..01400f89cf84f 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -56,7 +56,8 @@ fn F(c: Class) { // CHECK:STDOUT: %WithSelf.type: type = fn_type @WithSelf [template] // CHECK:STDOUT: %WithSelf: %WithSelf.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -100,6 +101,7 @@ fn F(c: Class) { // CHECK:STDOUT: %self.loc13_15.1: %Class = param self, runtime_param0 // CHECK:STDOUT: %self.loc13_15.2: %Class = bind_name self, %self.loc13_15.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index 10ae2779f654e..18fde85e0e48c 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -65,6 +65,7 @@ base class BaseClass { // CHECK:STDOUT: %Virtual.type: type = fn_type @Virtual [template] // CHECK:STDOUT: %Virtual: %Virtual.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %AbstractClass: type = class_type @AbstractClass [template] // CHECK:STDOUT: %Default.type: type = fn_type @Default [template] // CHECK:STDOUT: %Default: %Default.type = struct_value () [template] @@ -112,6 +113,7 @@ base class BaseClass { // CHECK:STDOUT: %self.loc29_22.1: %FinalClass = param self, runtime_param0 // CHECK:STDOUT: %self.loc29_22.2: %FinalClass = bind_name self, %self.loc29_22.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc30: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FinalClass @@ -130,6 +132,7 @@ base class BaseClass { // CHECK:STDOUT: %self.loc44_18.1: %AbstractClass = param self, runtime_param0 // CHECK:STDOUT: %self.loc44_18.2: %AbstractClass = bind_name self, %self.loc44_18.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc45: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AbstractClass @@ -143,6 +146,7 @@ base class BaseClass { // CHECK:STDOUT: %self.loc55_24.1: %BaseClass = param self, runtime_param0 // CHECK:STDOUT: %self.loc55_24.2: %BaseClass = bind_name self, %self.loc55_24.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc56: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%BaseClass diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index 7b1331e79640e..4aa2eaab5399f 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -27,6 +27,7 @@ class Class { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -54,6 +55,7 @@ class Class { // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %F.decl.loc19: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %.loc20: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index 01c69991ffcfb..709fc63d5643b 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -75,6 +75,7 @@ abstract base class AbstractAndBase {} // CHECK:STDOUT: %DuplicatePrivate: type = class_type @DuplicatePrivate [template] // CHECK:STDOUT: %TwoAccess: type = class_type @TwoAccess [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %TwoAbstract: type = class_type @TwoAbstract [template] // CHECK:STDOUT: %Virtual: type = class_type @Virtual [template] // CHECK:STDOUT: %WrongOrder: type = class_type @WrongOrder [template] @@ -116,6 +117,8 @@ abstract base class AbstractAndBase {} // CHECK:STDOUT: class @DuplicatePrivate; // CHECK:STDOUT: // CHECK:STDOUT: class @TwoAccess { +// CHECK:STDOUT: %.loc27: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%TwoAccess // CHECK:STDOUT: } @@ -123,6 +126,8 @@ abstract base class AbstractAndBase {} // CHECK:STDOUT: class @TwoAbstract; // CHECK:STDOUT: // CHECK:STDOUT: class @Virtual { +// CHECK:STDOUT: %.loc53: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Virtual // CHECK:STDOUT: } @@ -130,6 +135,8 @@ abstract base class AbstractAndBase {} // CHECK:STDOUT: class @WrongOrder; // CHECK:STDOUT: // CHECK:STDOUT: class @AbstractAndBase { +// CHECK:STDOUT: %.loc70: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AbstractAndBase // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon index 842bd2757909f..6f60150df3464 100644 --- a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon +++ b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon @@ -20,8 +20,9 @@ fn C.F() {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -49,6 +50,8 @@ fn C.F() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .F = file.%F.decl diff --git a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon index 8b94f35efe4f2..56af7fb03f064 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon @@ -96,6 +96,7 @@ base class F {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -122,6 +123,8 @@ base class F {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } @@ -131,6 +134,7 @@ base class F {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -157,6 +161,8 @@ base class F {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } @@ -166,6 +172,7 @@ base class F {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -192,6 +199,8 @@ base class F {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -201,6 +210,7 @@ base class F {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -227,6 +237,8 @@ base class F {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } @@ -236,6 +248,7 @@ base class F {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %E: type = class_type @E [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -262,6 +275,8 @@ base class F {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%E // CHECK:STDOUT: } @@ -271,6 +286,7 @@ base class F {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %F: type = class_type @F [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -297,6 +313,8 @@ base class F {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @F { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%F // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon index ec7aa4d3db2f8..703870e39466a 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon @@ -33,9 +33,10 @@ class Y { // CHECK:STDOUT: %A.2: type = class_type @A.2 [template] // CHECK:STDOUT: %B.1: type = class_type @B.1 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B.2: type = class_type @B.2 [template] // CHECK:STDOUT: %Y: type = class_type @Y [template] -// CHECK:STDOUT: %.2: type = class_type @.1 [template] +// CHECK:STDOUT: %.3: type = class_type @.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -67,6 +68,7 @@ class Y { // CHECK:STDOUT: // CHECK:STDOUT: class @A.1 { // CHECK:STDOUT: %B.decl: type = class_decl @B.2 [template = constants.%B.2] {} +// CHECK:STDOUT: %.loc19: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.1 @@ -76,6 +78,7 @@ class Y { // CHECK:STDOUT: class @X { // CHECK:STDOUT: %A.decl: type = class_decl @A.2 [template = constants.%A.2] {} // CHECK:STDOUT: %B.decl: type = class_decl @B.1 [template = constants.%B.1] {} +// CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X @@ -84,6 +87,7 @@ class Y { // CHECK:STDOUT: // CHECK:STDOUT: class @A.2 { // CHECK:STDOUT: %B.decl: type = class_decl @B.1 [template = constants.%B.1] {} +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.2 @@ -91,6 +95,8 @@ class Y { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B.1 { +// CHECK:STDOUT: %.loc16: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B.1 // CHECK:STDOUT: } @@ -98,14 +104,17 @@ class Y { // CHECK:STDOUT: class @B.2; // CHECK:STDOUT: // CHECK:STDOUT: class @Y { -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} +// CHECK:STDOUT: %.loc26: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Y // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { +// CHECK:STDOUT: %.loc25: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.2 +// CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index 18a099393ea5d..2945292bc5467 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -54,7 +54,8 @@ fn Class.I() {} // CHECK:STDOUT: %I.type.1: type = fn_type @I.1 [template] // CHECK:STDOUT: %I.1: %I.type.1 = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = class_type @.1 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = class_type @.1 [template] // CHECK:STDOUT: %G.type.1: type = fn_type @G.1 [template] // CHECK:STDOUT: %G.1: %G.type.1 = struct_value () [template] // CHECK:STDOUT: %H.type.2: type = fn_type @H.2 [template] @@ -85,7 +86,7 @@ fn Class.I() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.4] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %G.decl: %G.type.2 = fn_decl @G.2 [template = constants.%G.2] {} // CHECK:STDOUT: %H.decl: %H.type.1 = fn_decl @H.1 [template = constants.%H.1] {} @@ -96,6 +97,7 @@ fn Class.I() {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %H.decl: %H.type.1 = fn_decl @H.1 [template = constants.%H.1] {} // CHECK:STDOUT: %I.decl: %I.type.1 = fn_decl @I.1 [template = constants.%I.1] {} +// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -109,9 +111,10 @@ fn Class.I() {} // CHECK:STDOUT: %G.decl: %G.type.1 = fn_decl @G.1 [template = constants.%G.1] {} // CHECK:STDOUT: %H.decl: %H.type.2 = fn_decl @H.2 [template = constants.%H.2] {} // CHECK:STDOUT: %I.decl: %I.type.2 = fn_decl @I.2 [template = constants.%I.2] {} +// CHECK:STDOUT: %.loc28: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.3 +// CHECK:STDOUT: .Self = constants.%.4 // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: .H = %H.decl // CHECK:STDOUT: .I = %I.decl diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index ec8e760b4e0e5..85e2d87eb91c9 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -31,7 +31,8 @@ fn G() -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } @@ -74,6 +75,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -84,7 +86,7 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13: i32 = int_literal 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc13: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: return %.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index d0418ebb78ad9..84b0e1f1e3686 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -65,7 +65,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %WrongSelf: type = class_type @WrongSelf [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] @@ -74,19 +75,19 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [symbolic] -// CHECK:STDOUT: %.7: type = interface_type @ImplicitAs, @ImplicitAs(%Class) [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%Class) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%Class) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] -// CHECK:STDOUT: %.10: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.2 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.11: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -103,7 +104,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.11)] // CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -139,12 +140,12 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.4), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.5) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.5), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.6) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -164,6 +165,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %return.var: ref %Class = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -177,6 +179,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %self.loc42_8.1: %Class = param self, runtime_param0 // CHECK:STDOUT: %self.loc42_8.2: %Class = bind_name self, %self.loc42_8.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc43: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%WrongSelf @@ -205,18 +208,18 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %ws.ref: %WrongSelf = name_ref ws, %ws // CHECK:STDOUT: %F.ref: %F.type.2 = name_ref F, @WrongSelf.%F.decl [template = constants.%F.2] // CHECK:STDOUT: %.loc55_5: = bound_method %ws.ref, %F.ref -// CHECK:STDOUT: %.loc55_7.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class) [template = constants.%.7] -// CHECK:STDOUT: %.loc55_7.2: %.8 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class) [template = constants.%.9] -// CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc55_7.2 [template = constants.%.9] +// CHECK:STDOUT: %.loc55_7.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class) [template = constants.%.8] +// CHECK:STDOUT: %.loc55_7.2: %.9 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class) [template = constants.%.10] +// CHECK:STDOUT: %Convert.ref: %.9 = name_ref Convert, %.loc55_7.2 [template = constants.%.10] // CHECK:STDOUT: %.loc55_7.3: %Class = converted %ws.ref, [template = ] // CHECK:STDOUT: %F.call: init %.1 = call %.loc55_5() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.4)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.5)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -235,7 +238,7 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -243,11 +246,11 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %Dest => constants.%Class // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.8 -// CHECK:STDOUT: %.3 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: %.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_self_type_member.carbon b/toolchain/check/testdata/class/fail_self_type_member.carbon index e82b7f58abadb..2a672cd438f41 100644 --- a/toolchain/check/testdata/class/fail_self_type_member.carbon +++ b/toolchain/check/testdata/class/fail_self_type_member.carbon @@ -34,11 +34,12 @@ fn F() -> bool { // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Class, bool [template] // CHECK:STDOUT: %.3: type = struct_type {.b: bool} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: bool = bool_literal true [template] -// CHECK:STDOUT: %struct: %Class = struct_value (%.5) [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: bool = bool_literal true [template] +// CHECK:STDOUT: %struct: %Class = struct_value (%.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file {} @@ -48,6 +49,7 @@ fn F() -> bool { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc12_10.2: type = converted %bool.make_type, %.loc12_10.1 [template = bool] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_todo_local_class.carbon b/toolchain/check/testdata/class/fail_todo_local_class.carbon index 466e35494c320..79ba85ba6c356 100644 --- a/toolchain/check/testdata/class/fail_todo_local_class.carbon +++ b/toolchain/check/testdata/class/fail_todo_local_class.carbon @@ -34,12 +34,14 @@ class A { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file {} // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %.loc27: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 23ff4d6b69d3e..b40d58ad6e8f9 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -37,9 +37,10 @@ fn G() -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {.field: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -84,6 +85,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc20: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 8be8461b43d83..eacb9e0e4b0e7 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -29,9 +29,10 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.n: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,6 +74,7 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 9af2c7719ece5..a0a58bb3f96c6 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -30,11 +30,12 @@ fn Run() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.j: i32, .k: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -72,6 +73,7 @@ fn Run() { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_8: %.2 = field_decl k, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -89,12 +91,12 @@ fn Run() { // CHECK:STDOUT: %c.ref.loc18: ref %Class = name_ref c, %c // CHECK:STDOUT: %j.ref.loc18: %.2 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] // CHECK:STDOUT: %.loc18_4: ref i32 = class_element_access %c.ref.loc18, element0 -// CHECK:STDOUT: %.loc18_9: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc18_9: i32 = int_literal 1 [template = constants.%.6] // CHECK:STDOUT: assign %.loc18_4, %.loc18_9 // CHECK:STDOUT: %c.ref.loc19: ref %Class = name_ref c, %c // CHECK:STDOUT: %k.ref.loc19: %.2 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] // CHECK:STDOUT: %.loc19_4: ref i32 = class_element_access %c.ref.loc19, element1 -// CHECK:STDOUT: %.loc19_9: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc19_9: i32 = int_literal 2 [template = constants.%.7] // CHECK:STDOUT: assign %.loc19_4, %.loc19_9 // CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_11.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 52bc197a1f459..5659319a7f8e2 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -31,11 +31,12 @@ fn Test() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.j: i32, .k: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,6 +74,7 @@ fn Test() { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_8: %.2 = field_decl k, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -90,12 +92,12 @@ fn Test() { // CHECK:STDOUT: %cv.ref.loc18: ref %Class = name_ref cv, %cv // CHECK:STDOUT: %j.ref.loc18: %.2 = name_ref j, @Class.%.loc12_8 [template = @Class.%.loc12_8] // CHECK:STDOUT: %.loc18_5: ref i32 = class_element_access %cv.ref.loc18, element0 -// CHECK:STDOUT: %.loc18_10: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc18_10: i32 = int_literal 1 [template = constants.%.6] // CHECK:STDOUT: assign %.loc18_5, %.loc18_10 // CHECK:STDOUT: %cv.ref.loc19: ref %Class = name_ref cv, %cv // CHECK:STDOUT: %k.ref.loc19: %.2 = name_ref k, @Class.%.loc13_8 [template = @Class.%.loc13_8] // CHECK:STDOUT: %.loc19_5: ref i32 = class_element_access %cv.ref.loc19, element1 -// CHECK:STDOUT: %.loc19_10: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc19_10: i32 = int_literal 2 [template = constants.%.7] // CHECK:STDOUT: assign %.loc19_5, %.loc19_10 // CHECK:STDOUT: %Class.ref.loc20: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %cv.ref.loc20: ref %Class = name_ref cv, %cv diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index b8ebb6782dee9..ff80b07224e59 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -39,7 +39,8 @@ class Declaration(T:! type); // CHECK:STDOUT: %GetValue: %GetValue.type = struct_value () [symbolic] // CHECK:STDOUT: %.4: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.5: type = struct_type {.k: %T} [symbolic] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [symbolic] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [symbolic] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [symbolic] // CHECK:STDOUT: %Declaration.type: type = generic_class_type @Declaration [template] // CHECK:STDOUT: %Declaration.1: %Declaration.type = struct_value () [template] // CHECK:STDOUT: %Declaration.2: type = class_type @Declaration, @Declaration(%T) [symbolic] @@ -85,6 +86,8 @@ class Declaration(T:! type); // CHECK:STDOUT: %GetValue: @Class.%GetValue.type (%GetValue.type) = struct_value () [symbolic = %GetValue (constants.%GetValue)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.2: type = struct_type {.k: @Class.%T (%T)} [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.5) [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %GetAddr.decl: @Class.%GetAddr.type (%GetAddr.type) = fn_decl @GetAddr [symbolic = %GetAddr (constants.%GetAddr)] { @@ -108,6 +111,7 @@ class Declaration(T:! type); // CHECK:STDOUT: } // CHECK:STDOUT: %T.ref.loc21: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.loc21: @Class.%.1 (%.4) = field_decl k, element0 [template] +// CHECK:STDOUT: %.loc22: = complete_type_witness %.5 [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -170,6 +174,8 @@ class Declaration(T:! type); // CHECK:STDOUT: %GetValue => constants.%GetValue // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: %.3 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@GetAddr.%T) { diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 6b740a8035cfd..5235198533d16 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -97,12 +97,13 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type i32 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 5 [template] -// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%.3, %.4) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 0 [template] -// CHECK:STDOUT: %Class.4: type = class_type @Class, @Class(%.1, %.6) [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type i32 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 5 [template] +// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%.4, %.5) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.7: i32 = int_literal 0 [template] +// CHECK:STDOUT: %Class.4: type = class_type @Class, @Class(%.1, %.7) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -141,16 +142,16 @@ class Outer(T:! type) { // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_17.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_17.2: type = converted %int.make_type_32.loc6, %.loc6_17.1 [template = i32] -// CHECK:STDOUT: %.loc6_17.3: type = ptr_type i32 [template = constants.%.3] -// CHECK:STDOUT: %.loc6_20: i32 = int_literal 5 [template = constants.%.4] -// CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%.3, constants.%.4) [template = constants.%Class.3] +// CHECK:STDOUT: %.loc6_17.3: type = ptr_type i32 [template = constants.%.4] +// CHECK:STDOUT: %.loc6_20: i32 = int_literal 5 [template = constants.%.5] +// CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%.4, constants.%.5) [template = constants.%Class.3] // CHECK:STDOUT: %a.var: ref %Class.3 = var a // CHECK:STDOUT: %a: ref %Class.3 = bind_name a, %a.var // CHECK:STDOUT: %Class.ref.loc9: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %.loc9_15: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc9_18: i32 = int_literal 0 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_18: i32 = int_literal 0 [template = constants.%.7] // CHECK:STDOUT: %.loc9_13: type = converted %.loc9_15, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%.1, constants.%.6) [template = constants.%Class.4] +// CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%.1, constants.%.7) [template = constants.%Class.4] // CHECK:STDOUT: %b.var: ref %Class.4 = var b // CHECK:STDOUT: %b: ref %Class.4 = bind_name b, %b.var // CHECK:STDOUT: } @@ -162,6 +163,8 @@ class Outer(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 // CHECK:STDOUT: } @@ -174,16 +177,16 @@ class Outer(T:! type) { // CHECK:STDOUT: %N => constants.%N // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%.3, constants.%.4) { -// CHECK:STDOUT: %T => constants.%.3 -// CHECK:STDOUT: %N => constants.%.4 +// CHECK:STDOUT: specific @Class(constants.%.4, constants.%.5) { +// CHECK:STDOUT: %T => constants.%.4 +// CHECK:STDOUT: %N => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%.1, constants.%.6) { +// CHECK:STDOUT: specific @Class(constants.%.1, constants.%.7) { // CHECK:STDOUT: %T => constants.%.1 -// CHECK:STDOUT: %N => constants.%.6 +// CHECK:STDOUT: %N => constants.%.7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: } @@ -200,7 +203,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type i32 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -238,7 +242,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13, %.loc13_17.1 [template = i32] -// CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.3] +// CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.4] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } @@ -250,6 +254,8 @@ class Outer(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 // CHECK:STDOUT: } @@ -274,9 +280,10 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type i32 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type i32 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -314,9 +321,9 @@ class Outer(T:! type) { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13, %.loc13_17.1 [template = i32] -// CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.3] -// CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_23: i32 = int_literal 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.4] +// CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_23: i32 = int_literal 2 [template = constants.%.6] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } @@ -328,6 +335,8 @@ class Outer(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 // CHECK:STDOUT: } @@ -352,24 +361,25 @@ class Outer(T:! type) { // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: i32 = int_literal 5 [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: i32 = int_literal 5 [template] +// CHECK:STDOUT: %.5: type = ptr_type i32 [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.5: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.6: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.6) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(type) [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %.6, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.9: type = interface_type @ImplicitAs, @ImplicitAs(type) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(type) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.2 [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.11: %.6 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %Convert.type.2 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.12: %.7 = assoc_entity element0, imports.%import_ref.7 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -388,7 +398,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.11)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.7) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.12)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -411,14 +421,14 @@ class Outer(T:! type) { // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N 1, %N.loc4_23.1 [symbolic = @Class.%N (constants.%N)] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %.loc15_14: i32 = int_literal 5 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_14: i32 = int_literal 5 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_20.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_20.2: type = converted %int.make_type_32.loc15, %.loc15_20.1 [template = i32] -// CHECK:STDOUT: %.loc15_20.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc15_13.1: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%.8] -// CHECK:STDOUT: %.loc15_13.2: %.9 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.10] -// CHECK:STDOUT: %Convert.ref: %.9 = name_ref Convert, %.loc15_13.2 [template = constants.%.10] +// CHECK:STDOUT: %.loc15_20.3: type = ptr_type i32 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_13.1: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%.9] +// CHECK:STDOUT: %.loc15_13.2: %.10 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.11] +// CHECK:STDOUT: %Convert.ref: %.10 = name_ref Convert, %.loc15_13.2 [template = constants.%.11] // CHECK:STDOUT: %.loc15_13.3: type = converted %.loc15_14, [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var @@ -428,12 +438,12 @@ class Outer(T:! type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.5), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.6)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.6) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.7)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.6), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.7)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.7) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.8)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -450,6 +460,8 @@ class Outer(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 // CHECK:STDOUT: } @@ -457,10 +469,10 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.5)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.6)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -484,7 +496,7 @@ class Outer(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.6 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -492,12 +504,12 @@ class Outer(T:! type) { // CHECK:STDOUT: %Dest => type // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.9 -// CHECK:STDOUT: %.3 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.10 +// CHECK:STDOUT: %.3 => constants.%.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- call_in_nested_return_type.carbon @@ -523,7 +535,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %D.type.1: type = fn_type @D, @Inner(%T, %U) [symbolic] // CHECK:STDOUT: %D.1: %D.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %struct.1: %Outer.2 = struct_value () [symbolic] // CHECK:STDOUT: %Inner.type.2: type = generic_class_type @Inner, @Outer(%U) [symbolic] // CHECK:STDOUT: %Inner.4: %Inner.type.2 = struct_value () [symbolic] @@ -577,6 +590,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %U.loc3_15.1: type = param U, runtime_param // CHECK:STDOUT: %U.loc3_15.2: type = bind_symbolic_name U 1, %U.loc3_15.1 [symbolic = @Inner.%U (constants.%U)] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc17: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer.2 @@ -625,6 +639,7 @@ class Outer(T:! type) { // CHECK:STDOUT: %Inner.loc13: type = class_type @Inner, @Inner(constants.%T, constants.%U) [symbolic = @D.%Inner.2 (constants.%Inner.2)] // CHECK:STDOUT: %return.var.loc13: ref @D.%Inner.2 (%Inner.2) = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner.2 diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index b41840c845f09..a970c816aa7d8 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -34,20 +34,27 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.x: %T} [symbolic] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(i32) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %Class.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] +// CHECK:STDOUT: %.5: type = unbound_element_type %Class.3, i32 [template] +// CHECK:STDOUT: %.6: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] +// CHECK:STDOUT: %.9: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U 0 [symbolic] // CHECK:STDOUT: %Class.4: type = class_type @Class, @Class(%U) [symbolic] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Class.4, %U [symbolic] +// CHECK:STDOUT: %.10: type = unbound_element_type %Class.4, %U [symbolic] +// CHECK:STDOUT: %.11: type = struct_type {.x: %U} [symbolic] +// CHECK:STDOUT: %.12: = complete_type_witness %.11 [symbolic] +// CHECK:STDOUT: %.13: type = ptr_type %.11 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -121,10 +128,13 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.loc12: @Class.%.1 (%.2) = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -137,7 +147,7 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: fn @F(%c: %Class.3) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.3 = name_ref c, %c -// CHECK:STDOUT: %x.ref: %.4 = name_ref x, @Class.%.loc12 [template = @Class.%.loc12] +// CHECK:STDOUT: %x.ref: %.5 = name_ref x, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc16_11.1: ref i32 = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc16_11.2: i32 = bind_value %.loc16_11.1 // CHECK:STDOUT: return %.loc16_11.2 @@ -165,12 +175,12 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%U.1) [symbolic = %Class (constants.%Class.4)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = unbound_element_type @H.%Class (%Class.4), @H.%U.1 (%U) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %.1: type = unbound_element_type @H.%Class (%Class.4), @H.%U.1 (%U) [symbolic = %.1 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%U.loc23: type, %c: @H.%Class (%Class.4)) -> @H.%U.1 (%U) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: @H.%Class (%Class.4) = name_ref c, %c -// CHECK:STDOUT: %x.ref: @H.%.1 (%.6) = name_ref x, @Class.%.loc12 [template = @Class.%.loc12] +// CHECK:STDOUT: %x.ref: @H.%.1 (%.10) = name_ref x, @Class.%.loc12 [template = @Class.%.loc12] // CHECK:STDOUT: %.loc24_11.1: ref @H.%U.1 (%U) = class_element_access %c.ref, element0 // CHECK:STDOUT: %.loc24_11.2: @H.%U.1 (%U) = bind_value %.loc24_11.1 // CHECK:STDOUT: return %.loc24_11.2 @@ -183,6 +193,8 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %.1 => constants.%.2 +// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T) { @@ -194,7 +206,9 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: %.3 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@G.%T.1) { @@ -211,7 +225,9 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.4 -// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: %.3 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@H.%U.1) { diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 4b2abb4edb10b..f9ef44835dea0 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -103,7 +103,8 @@ class Class(U:! type) { // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.4: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 0 [template] // CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(i32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] @@ -176,6 +177,7 @@ class Class(U:! type) { // CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc9: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%CompleteClass.2 @@ -191,7 +193,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8: i32 = int_literal 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc8: i32 = int_literal 0 [template = constants.%.5] // CHECK:STDOUT: return %.loc8 // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -232,11 +234,13 @@ class Class(U:! type) { // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.x: %T} [symbolic] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.1: %CompleteClass.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = struct_type {.n: i32} [template] +// CHECK:STDOUT: %.5: type = struct_type {.n: i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] -// CHECK:STDOUT: %.5: type = unbound_element_type %CompleteClass.2, i32 [symbolic] +// CHECK:STDOUT: %.7: type = unbound_element_type %CompleteClass.2, i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] @@ -244,18 +248,18 @@ class Class(U:! type) { // CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(i32) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %CompleteClass.3, i32 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %CompleteClass.3, i32 [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @CompleteClass(i32) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %.4 [template] -// CHECK:STDOUT: %.8: i32 = int_literal 1 [template] -// CHECK:STDOUT: %struct: %CompleteClass.3 = struct_value (%.8) [template] +// CHECK:STDOUT: %.9: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.10: i32 = int_literal 1 [template] +// CHECK:STDOUT: %struct: %CompleteClass.3 = struct_value (%.10) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+6, loaded [template = constants.%Class.1] // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.2 = import_ref Main//foo, inst+53, loaded [template = constants.%F.2] +// CHECK:STDOUT: %import_ref.3: %F.type.2 = import_ref Main//foo, inst+55, loaded [template = constants.%F.2] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude @@ -303,10 +307,13 @@ class Class(U:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.loc5: @Class.%.1 (%.2) = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -319,7 +326,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.7)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: @@ -341,10 +348,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> %return: %CompleteClass.3 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc9_16: i32 = int_literal 1 [template = constants.%.8] -// CHECK:STDOUT: %.loc9_17.1: %.4 = struct_literal (%.loc9_16) +// CHECK:STDOUT: %.loc9_16: i32 = int_literal 1 [template = constants.%.10] +// CHECK:STDOUT: %.loc9_17.1: %.5 = struct_literal (%.loc9_16) // CHECK:STDOUT: %.loc9_17.2: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc9_17.3: init i32 = initialize_from %.loc9_16 to %.loc9_17.2 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_17.3: init i32 = initialize_from %.loc9_16 to %.loc9_17.2 [template = constants.%.10] // CHECK:STDOUT: %.loc9_17.4: init %CompleteClass.3 = class_init (%.loc9_17.3), %return [template = constants.%struct] // CHECK:STDOUT: %.loc9_18: init %CompleteClass.3 = converted %.loc9_17.1, %.loc9_17.4 [template = constants.%struct] // CHECK:STDOUT: return %.loc9_18 to %return @@ -363,7 +370,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.7 // CHECK:STDOUT: %F.type => constants.%F.type.1 // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } @@ -379,7 +386,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 -// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 // CHECK:STDOUT: } @@ -395,16 +402,17 @@ class Class(U:! type) { // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.1: %CompleteClass.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {.n: i32} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] -// CHECK:STDOUT: %.3: type = unbound_element_type %CompleteClass.2, i32 [symbolic] +// CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.2, i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(i32) [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.3, i32 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %CompleteClass.3, i32 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @CompleteClass(i32) [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.2 [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] // CHECK:STDOUT: %UseField.type: type = fn_type @UseField [template] @@ -414,7 +422,7 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+6, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+53, loaded [template = constants.%F.3] +// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+55, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.4 // CHECK:STDOUT: import Core//prelude @@ -428,7 +436,7 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+18, unloaded -// CHECK:STDOUT: %import_ref.6: @CompleteClass.%.1 (%.3) = import_ref Main//foo, inst+28, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.6: @CompleteClass.%.1 (%.4) = import_ref Main//foo, inst+28, loaded [template = %.1] // CHECK:STDOUT: %import_ref.7: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+35, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -462,7 +470,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: @@ -520,7 +528,7 @@ class Class(U:! type) { // CHECK:STDOUT: %F.call: init %CompleteClass.3 = call %F.ref() to %.loc11_7 // CHECK:STDOUT: assign %v.var, %F.call // CHECK:STDOUT: %v.ref: ref %CompleteClass.3 = name_ref v, %v -// CHECK:STDOUT: %n.ref: %.4 = name_ref n, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %n.ref: %.5 = name_ref n, imports.%import_ref.6 [template = imports.%.1] // CHECK:STDOUT: %.loc12_11.1: ref i32 = class_element_access %v.ref, element0 // CHECK:STDOUT: %.loc12_11.2: i32 = bind_value %.loc12_11.1 // CHECK:STDOUT: return %.loc12_11.2 @@ -531,7 +539,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 -// CHECK:STDOUT: %.1 => constants.%.3 +// CHECK:STDOUT: %.1 => constants.%.4 // CHECK:STDOUT: %F.type => constants.%F.type.1 // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } @@ -547,7 +555,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 // CHECK:STDOUT: } @@ -563,47 +571,48 @@ class Class(U:! type) { // CHECK:STDOUT: %CompleteClass.type: type = generic_class_type @CompleteClass [template] // CHECK:STDOUT: %CompleteClass.1: %CompleteClass.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {.n: i32} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %CompleteClass.2: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] -// CHECK:STDOUT: %.3: type = unbound_element_type %CompleteClass.2, i32 [symbolic] +// CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.2, i32 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] -// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(%.4) [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %CompleteClass.3, i32 [template] -// CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @CompleteClass(%.4) [template] +// CHECK:STDOUT: %.5: type = ptr_type i32 [template] +// CHECK:STDOUT: %CompleteClass.3: type = class_type @CompleteClass, @CompleteClass(%.5) [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %CompleteClass.3, i32 [template] +// CHECK:STDOUT: %F.type.2: type = fn_type @F.1, @CompleteClass(%.5) [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.2 [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] // CHECK:STDOUT: %CompleteClass.4: type = class_type @CompleteClass, @CompleteClass(i32) [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %CompleteClass.4, i32 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %CompleteClass.4, i32 [template] // CHECK:STDOUT: %F.type.4: type = fn_type @F.1, @CompleteClass(i32) [template] // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.8) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.8 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.9: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.9) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.9 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.12 [symbolic] -// CHECK:STDOUT: %.11: type = interface_type @ImplicitAs, @ImplicitAs(%CompleteClass.3) [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.12 [symbolic] +// CHECK:STDOUT: %.12: type = interface_type @ImplicitAs, @ImplicitAs(%CompleteClass.3) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%CompleteClass.3) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Convert.type.2 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %.14: %.9 = assoc_entity element0, imports.%import_ref.13 [symbolic] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.12, %Convert.type.2 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.15: %.10 = assoc_entity element0, imports.%import_ref.13 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+6, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+53, loaded [template = constants.%F.3] +// CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+55, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: .ImplicitAs = %import_ref.8 @@ -622,7 +631,7 @@ class Class(U:! type) { // CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.8: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.14)] +// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] // CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -645,12 +654,12 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.8), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.9)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.9) = assoc_entity element0, imports.%import_ref.12 [symbolic = %.3 (constants.%.10)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.9), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.10) = assoc_entity element0, imports.%import_ref.12 [symbolic = %.3 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -665,7 +674,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic = %CompleteClass (constants.%CompleteClass.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.3)] +// CHECK:STDOUT: %.1: type = unbound_element_type @CompleteClass.%CompleteClass (%CompleteClass.2), i32 [symbolic = %.1 (constants.%.4)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @CompleteClass(%T) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @CompleteClass.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] // CHECK:STDOUT: @@ -683,16 +692,16 @@ class Class(U:! type) { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_27.2: type = converted %int.make_type_32, %.loc14_27.1 [template = i32] -// CHECK:STDOUT: %.loc14_27.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%.4) [template = constants.%CompleteClass.3] +// CHECK:STDOUT: %.loc14_27.3: type = ptr_type i32 [template = constants.%.5] +// CHECK:STDOUT: %CompleteClass: type = class_type @CompleteClass, @CompleteClass(constants.%.5) [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var // CHECK:STDOUT: %F.ref: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3] // CHECK:STDOUT: %.loc14_33.1: ref %CompleteClass.4 = temporary_storage // CHECK:STDOUT: %F.call: init %CompleteClass.4 = call %F.ref() to %.loc14_33.1 -// CHECK:STDOUT: %.loc14_35.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%CompleteClass.3) [template = constants.%.11] -// CHECK:STDOUT: %.loc14_35.2: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%CompleteClass.3) [template = constants.%.13] -// CHECK:STDOUT: %Convert.ref: %.12 = name_ref Convert, %.loc14_35.2 [template = constants.%.13] +// CHECK:STDOUT: %.loc14_35.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%CompleteClass.3) [template = constants.%.12] +// CHECK:STDOUT: %.loc14_35.2: %.13 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%CompleteClass.3) [template = constants.%.14] +// CHECK:STDOUT: %Convert.ref: %.13 = name_ref Convert, %.loc14_35.2 [template = constants.%.14] // CHECK:STDOUT: %.loc14_33.2: ref %CompleteClass.4 = temporary %.loc14_33.1, %F.call // CHECK:STDOUT: %.loc14_35.3: %CompleteClass.3 = converted %F.call, [template = ] // CHECK:STDOUT: assign %v.var, @@ -709,10 +718,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> %CompleteClass.4; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.8)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.9)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -722,7 +731,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.2 -// CHECK:STDOUT: %.1 => constants.%.3 +// CHECK:STDOUT: %.1 => constants.%.4 // CHECK:STDOUT: %F.type => constants.%F.type.1 // CHECK:STDOUT: %F => constants.%F.1 // CHECK:STDOUT: } @@ -733,12 +742,12 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%T) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @CompleteClass(constants.%.4) { -// CHECK:STDOUT: %T => constants.%.4 +// CHECK:STDOUT: specific @CompleteClass(constants.%.5) { +// CHECK:STDOUT: %T => constants.%.5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.3 -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.6 // CHECK:STDOUT: %F.type => constants.%F.type.2 // CHECK:STDOUT: %F => constants.%F.2 // CHECK:STDOUT: } @@ -748,7 +757,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %CompleteClass => constants.%CompleteClass.4 -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %F.type => constants.%F.type.4 // CHECK:STDOUT: %F => constants.%F.4 // CHECK:STDOUT: } @@ -767,7 +776,7 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -775,12 +784,12 @@ class Class(U:! type) { // CHECK:STDOUT: %Dest => constants.%CompleteClass.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.12 -// CHECK:STDOUT: %.3 => constants.%.13 +// CHECK:STDOUT: %.2 => constants.%.13 +// CHECK:STDOUT: %.3 => constants.%.14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_foo.impl.carbon @@ -800,7 +809,7 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+6, loaded [template = constants.%Class.1] // CHECK:STDOUT: %import_ref.2 = import_ref Main//foo, inst+14, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+53, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+55, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -843,6 +852,7 @@ class Class(U:! type) { // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: = name_ref T, [template = ] // CHECK:STDOUT: %.loc18: = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness [template = ] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index b79b29e0ca320..e1438aeda1b58 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -8,7 +8,9 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/init.carbon -// --- init.carbon +// --- from_struct.carbon + +library "[[@TEST_NAME]]"; class Class(T:! type) { var k: T; @@ -19,27 +21,28 @@ fn InitFromStructGeneric(T:! type, x: T) -> T { return v.k; } -// --- fail_todo_init.carbon +fn InitFromStructSpecific(x: i32) -> i32 { + var v: Class(i32) = {.k = x}; + return v.k; +} + +// --- adapt.carbon library "[[@TEST_NAME]]"; -class Class(T:! type) { - var k: T; +class Adapt(T:! type) { + adapt T; } -// TODO: The following should work. -fn InitFromStructSpecific() -> i32 { - // CHECK:STDERR: fail_todo_init.carbon:[[@LINE+6]]:23: ERROR: Cannot implicitly convert from `i32` to `T`. - // CHECK:STDERR: var v: Class(i32) = {.k = 0}; - // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_todo_init.carbon:[[@LINE+3]]:23: Type `i32` does not implement interface `ImplicitAs`. - // CHECK:STDERR: var v: Class(i32) = {.k = 0}; - // CHECK:STDERR: ^~~~~~~~ - var v: Class(i32) = {.k = 0}; - return v.k; +fn InitFromAdaptedGeneric(T:! type, x: T) -> T { + return (x as Adapt(T)) as T; +} + +fn InitFromAdaptedSpecific(x: i32) -> i32 { + return (x as Adapt(i32)) as i32; } -// CHECK:STDOUT: --- init.carbon +// CHECK:STDOUT: --- from_struct.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] @@ -49,13 +52,24 @@ fn InitFromStructSpecific() -> i32 { // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.k: %T} [symbolic] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] // CHECK:STDOUT: %InitFromStructGeneric.type: type = fn_type @InitFromStructGeneric [template] // CHECK:STDOUT: %InitFromStructGeneric: %InitFromStructGeneric.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] +// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] +// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [template] +// CHECK:STDOUT: %InitFromStructSpecific: %InitFromStructSpecific.type = struct_value () [template] +// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(i32) [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Class.3, i32 [template] +// CHECK:STDOUT: %.7: type = struct_type {.k: i32} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.9: type = ptr_type %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +79,7 @@ fn InitFromStructSpecific() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -72,41 +87,56 @@ fn InitFromStructSpecific() -> i32 { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .InitFromStructGeneric = %InitFromStructGeneric.decl +// CHECK:STDOUT: .InitFromStructSpecific = %InitFromStructSpecific.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { -// CHECK:STDOUT: %T.loc2_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T 0, %T.loc2_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.loc4_13.1: type = param T, runtime_param +// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %InitFromStructGeneric.decl: %InitFromStructGeneric.type = fn_decl @InitFromStructGeneric [template = constants.%InitFromStructGeneric] { -// CHECK:STDOUT: %T.loc6_26.1: type = param T, runtime_param -// CHECK:STDOUT: @InitFromStructGeneric.%T.loc6: type = bind_symbolic_name T 0, %T.loc6_26.1 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %T.ref.loc6_39: type = name_ref T, @InitFromStructGeneric.%T.loc6 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] -// CHECK:STDOUT: %x.loc6_36.1: @InitFromStructGeneric.%T.1 (%T) = param x, runtime_param0 -// CHECK:STDOUT: @InitFromStructGeneric.%x: @InitFromStructGeneric.%T.1 (%T) = bind_name x, %x.loc6_36.1 -// CHECK:STDOUT: %T.ref.loc6_45: type = name_ref T, @InitFromStructGeneric.%T.loc6 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.loc8_26.1: type = param T, runtime_param +// CHECK:STDOUT: @InitFromStructGeneric.%T.loc8: type = bind_symbolic_name T 0, %T.loc8_26.1 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc8_39: type = name_ref T, @InitFromStructGeneric.%T.loc8 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] +// CHECK:STDOUT: %x.loc8_36.1: @InitFromStructGeneric.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: @InitFromStructGeneric.%x: @InitFromStructGeneric.%T.1 (%T) = bind_name x, %x.loc8_36.1 +// CHECK:STDOUT: %T.ref.loc8_45: type = name_ref T, @InitFromStructGeneric.%T.loc8 [symbolic = @InitFromStructGeneric.%T.1 (constants.%T)] // CHECK:STDOUT: @InitFromStructGeneric.%return: ref @InitFromStructGeneric.%T.1 (%T) = var // CHECK:STDOUT: } +// CHECK:STDOUT: %InitFromStructSpecific.decl: %InitFromStructSpecific.type = fn_decl @InitFromStructSpecific [template = constants.%InitFromStructSpecific] { +// CHECK:STDOUT: %int.make_type_32.loc13_30: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_32.loc13_30 [template = i32] +// CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_32.loc13_30, %.loc13_30.1 [template = i32] +// CHECK:STDOUT: %x.loc13_27.1: i32 = param x, runtime_param0 +// CHECK:STDOUT: @InitFromStructSpecific.%x: i32 = bind_name x, %x.loc13_27.1 +// CHECK:STDOUT: %int.make_type_32.loc13_38: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_38.1: type = value_of_initializer %int.make_type_32.loc13_38 [template = i32] +// CHECK:STDOUT: %.loc13_38.2: type = converted %int.make_type_32.loc13_38, %.loc13_38.1 [template = i32] +// CHECK:STDOUT: @InitFromStructSpecific.%return: ref i32 = var +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc2_13.2: type) { +// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.k: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { -// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc2_13.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc3: @Class.%.1 (%.2) = field_decl k, element0 [template] +// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %.loc5: @Class.%.1 (%.2) = field_decl k, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 -// CHECK:STDOUT: .k = %.loc3 +// CHECK:STDOUT: .k = %.loc5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc6: type) { +// CHECK:STDOUT: generic fn @InitFromStructGeneric(%T.loc8: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -114,34 +144,61 @@ fn InitFromStructSpecific() -> i32 { // CHECK:STDOUT: %.1: type = struct_type {.k: @InitFromStructGeneric.%T.1 (%T)} [symbolic = %.1 (constants.%.3)] // CHECK:STDOUT: %.2: type = unbound_element_type @InitFromStructGeneric.%Class.1 (%Class.2), @InitFromStructGeneric.%T.1 (%T) [symbolic = %.2 (constants.%.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc6: type, %x: @InitFromStructGeneric.%T.1 (%T)) -> @InitFromStructGeneric.%T.1 (%T) { +// CHECK:STDOUT: fn(%T.loc8: type, %x: @InitFromStructGeneric.%T.1 (%T)) -> @InitFromStructGeneric.%T.1 (%T) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6 [symbolic = %T.1 (constants.%T)] -// CHECK:STDOUT: %Class.loc7: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] +// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%T) [symbolic = %Class.1 (constants.%Class.2)] // CHECK:STDOUT: %v.var: ref @InitFromStructGeneric.%Class.1 (%Class.2) = var v // CHECK:STDOUT: %v: ref @InitFromStructGeneric.%Class.1 (%Class.2) = bind_name v, %v.var // CHECK:STDOUT: %x.ref: @InitFromStructGeneric.%T.1 (%T) = name_ref x, %x -// CHECK:STDOUT: %.loc7_28.1: @InitFromStructGeneric.%.1 (%.3) = struct_literal (%x.ref) -// CHECK:STDOUT: %.loc7_28.2: ref @InitFromStructGeneric.%T.1 (%T) = class_element_access %v.var, element0 -// CHECK:STDOUT: %.loc7_28.3: init @InitFromStructGeneric.%T.1 (%T) = initialize_from %x.ref to %.loc7_28.2 -// CHECK:STDOUT: %.loc7_28.4: init @InitFromStructGeneric.%Class.1 (%Class.2) = class_init (%.loc7_28.3), %v.var -// CHECK:STDOUT: %.loc7_29: init @InitFromStructGeneric.%Class.1 (%Class.2) = converted %.loc7_28.1, %.loc7_28.4 -// CHECK:STDOUT: assign %v.var, %.loc7_29 +// CHECK:STDOUT: %.loc9_28.1: @InitFromStructGeneric.%.1 (%.3) = struct_literal (%x.ref) +// CHECK:STDOUT: %.loc9_28.2: ref @InitFromStructGeneric.%T.1 (%T) = class_element_access %v.var, element0 +// CHECK:STDOUT: %.loc9_28.3: init @InitFromStructGeneric.%T.1 (%T) = initialize_from %x.ref to %.loc9_28.2 +// CHECK:STDOUT: %.loc9_28.4: init @InitFromStructGeneric.%Class.1 (%Class.2) = class_init (%.loc9_28.3), %v.var +// CHECK:STDOUT: %.loc9_29: init @InitFromStructGeneric.%Class.1 (%Class.2) = converted %.loc9_28.1, %.loc9_28.4 +// CHECK:STDOUT: assign %v.var, %.loc9_29 // CHECK:STDOUT: %v.ref: ref @InitFromStructGeneric.%Class.1 (%Class.2) = name_ref v, %v -// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%.2 (%.2) = name_ref k, @Class.%.loc3 [template = @Class.%.loc3] -// CHECK:STDOUT: %.loc8_11.1: ref @InitFromStructGeneric.%T.1 (%T) = class_element_access %v.ref, element0 -// CHECK:STDOUT: %.loc8_11.2: @InitFromStructGeneric.%T.1 (%T) = bind_value %.loc8_11.1 -// CHECK:STDOUT: return %.loc8_11.2 +// CHECK:STDOUT: %k.ref: @InitFromStructGeneric.%.2 (%.2) = name_ref k, @Class.%.loc5 [template = @Class.%.loc5] +// CHECK:STDOUT: %.loc10_11.1: ref @InitFromStructGeneric.%T.1 (%T) = class_element_access %v.ref, element0 +// CHECK:STDOUT: %.loc10_11.2: @InitFromStructGeneric.%T.1 (%T) = bind_value %.loc10_11.1 +// CHECK:STDOUT: return %.loc10_11.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @InitFromStructSpecific(%x: i32) -> i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc14_15.2: type = converted %int.make_type_32, %.loc14_15.1 [template = i32] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] +// CHECK:STDOUT: %v.var: ref %Class.3 = var v +// CHECK:STDOUT: %v: ref %Class.3 = bind_name v, %v.var +// CHECK:STDOUT: %x.ref: i32 = name_ref x, %x +// CHECK:STDOUT: %.loc14_30.1: %.7 = struct_literal (%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.4: init %Class.3 = class_init (%.loc14_30.3), %v.var +// CHECK:STDOUT: %.loc14_31: init %Class.3 = converted %.loc14_30.1, %.loc14_30.4 +// CHECK:STDOUT: assign %v.var, %.loc14_31 +// CHECK:STDOUT: %v.ref: ref %Class.3 = name_ref v, %v +// CHECK:STDOUT: %k.ref: %.6 = name_ref k, @Class.%.loc5 [template = @Class.%.loc5] +// CHECK:STDOUT: %.loc15_11.1: ref i32 = class_element_access %v.ref, element0 +// CHECK:STDOUT: %.loc15_11.2: i32 = bind_value %.loc15_11.1 +// CHECK:STDOUT: return %.loc15_11.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %.1 => constants.%.2 +// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T) { @@ -156,47 +213,38 @@ fn InitFromStructSpecific() -> i32 { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_todo_init.carbon +// CHECK:STDOUT: specific @Class(i32) { +// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Class => constants.%Class.3 +// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.3 => constants.%.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- adapt.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] -// CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] +// CHECK:STDOUT: %Adapt.type: type = generic_class_type @Adapt [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] -// CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] -// CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] -// CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] -// CHECK:STDOUT: %.3: type = struct_type {.k: %T} [symbolic] +// CHECK:STDOUT: %Adapt.1: %Adapt.type = struct_value () [template] +// CHECK:STDOUT: %Adapt.2: type = class_type @Adapt, @Adapt(%T) [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %T [symbolic] +// CHECK:STDOUT: %InitFromAdaptedGeneric.type: type = fn_type @InitFromAdaptedGeneric [template] +// CHECK:STDOUT: %InitFromAdaptedGeneric: %InitFromAdaptedGeneric.type = struct_value () [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [template] -// CHECK:STDOUT: %InitFromStructSpecific: %InitFromStructSpecific.type = struct_value () [template] -// CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(i32) [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %Class.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] -// CHECK:STDOUT: %.6: i32 = int_literal 0 [template] -// CHECK:STDOUT: %.7: type = struct_type {.k: i32} [template] -// CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] -// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.8) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.8 = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.11: type = interface_type @ImplicitAs, @ImplicitAs(%T) [symbolic] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%T) [symbolic] -// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Convert.type.2 [symbolic] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.14: %.9 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %InitFromAdaptedSpecific.type: type = fn_type @InitFromAdaptedSpecific [template] +// CHECK:STDOUT: %InitFromAdaptedSpecific: %InitFromAdaptedSpecific.type = struct_value () [template] +// CHECK:STDOUT: %Adapt.3: type = class_type @Adapt, @Adapt(i32) [template] +// CHECK:STDOUT: %.3: = complete_type_witness i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int32 = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.2 +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -206,146 +254,119 @@ fn InitFromStructSpecific() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.14)] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .InitFromStructSpecific = %InitFromStructSpecific.decl +// CHECK:STDOUT: .Adapt = %Adapt.decl +// CHECK:STDOUT: .InitFromAdaptedGeneric = %InitFromAdaptedGeneric.decl +// CHECK:STDOUT: .InitFromAdaptedSpecific = %InitFromAdaptedSpecific.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { +// CHECK:STDOUT: %Adapt.decl: %Adapt.type = class_decl @Adapt [template = constants.%Adapt.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T, runtime_param -// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] +// CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Adapt.%T (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %InitFromStructSpecific.decl: %InitFromStructSpecific.type = fn_decl @InitFromStructSpecific [template = constants.%InitFromStructSpecific] { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc9_32.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc9_32.2: type = converted %int.make_type_32, %.loc9_32.1 [template = i32] -// CHECK:STDOUT: @InitFromStructSpecific.%return: ref i32 = var +// CHECK:STDOUT: %InitFromAdaptedGeneric.decl: %InitFromAdaptedGeneric.type = fn_decl @InitFromAdaptedGeneric [template = constants.%InitFromAdaptedGeneric] { +// CHECK:STDOUT: %T.loc8_27.1: type = param T, runtime_param +// CHECK:STDOUT: @InitFromAdaptedGeneric.%T.loc8: type = bind_symbolic_name T 0, %T.loc8_27.1 [symbolic = @InitFromAdaptedGeneric.%T.1 (constants.%T)] +// CHECK:STDOUT: %T.ref.loc8_40: type = name_ref T, @InitFromAdaptedGeneric.%T.loc8 [symbolic = @InitFromAdaptedGeneric.%T.1 (constants.%T)] +// CHECK:STDOUT: %x.loc8_37.1: @InitFromAdaptedGeneric.%T.1 (%T) = param x, runtime_param0 +// CHECK:STDOUT: @InitFromAdaptedGeneric.%x: @InitFromAdaptedGeneric.%T.1 (%T) = bind_name x, %x.loc8_37.1 +// CHECK:STDOUT: %T.ref.loc8_46: type = name_ref T, @InitFromAdaptedGeneric.%T.loc8 [symbolic = @InitFromAdaptedGeneric.%T.1 (constants.%T)] +// CHECK:STDOUT: @InitFromAdaptedGeneric.%return: ref @InitFromAdaptedGeneric.%T.1 (%T) = var // CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] -// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.8), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.9)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.9) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.10)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .Convert = imports.%import_ref.4 -// CHECK:STDOUT: witness = (imports.%import_ref.5) +// CHECK:STDOUT: %InitFromAdaptedSpecific.decl: %InitFromAdaptedSpecific.type = fn_decl @InitFromAdaptedSpecific [template = constants.%InitFromAdaptedSpecific] { +// CHECK:STDOUT: %int.make_type_32.loc12_31: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc12_31.1: type = value_of_initializer %int.make_type_32.loc12_31 [template = i32] +// CHECK:STDOUT: %.loc12_31.2: type = converted %int.make_type_32.loc12_31, %.loc12_31.1 [template = i32] +// CHECK:STDOUT: %x.loc12_28.1: i32 = param x, runtime_param0 +// CHECK:STDOUT: @InitFromAdaptedSpecific.%x: i32 = bind_name x, %x.loc12_28.1 +// CHECK:STDOUT: %int.make_type_32.loc12_39: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc12_39.1: type = value_of_initializer %int.make_type_32.loc12_39 [template = i32] +// CHECK:STDOUT: %.loc12_39.2: type = converted %int.make_type_32.loc12_39, %.loc12_39.1 [template = i32] +// CHECK:STDOUT: @InitFromAdaptedSpecific.%return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type) { +// CHECK:STDOUT: generic class @Adapt(file.%T.loc4_13.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] -// CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: = complete_type_witness @Adapt.%T (%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc5: @Class.%.1 (%.2) = field_decl k, element0 [template] +// CHECK:STDOUT: adapt_decl %T +// CHECK:STDOUT: %.loc6: = complete_type_witness %T [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Class.2 -// CHECK:STDOUT: .k = %.loc5 +// CHECK:STDOUT: .Self = constants.%Adapt.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @InitFromStructSpecific() -> i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc16_15.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc16_15.2: type = converted %int.make_type_32, %.loc16_15.1 [template = i32] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %v.var: ref %Class.3 = var v -// CHECK:STDOUT: %v: ref %Class.3 = bind_name v, %v.var -// CHECK:STDOUT: %.loc16_29: i32 = int_literal 0 [template = constants.%.6] -// CHECK:STDOUT: %.loc16_30.1: %.7 = struct_literal (%.loc16_29) -// CHECK:STDOUT: %.loc16_30.2: type = interface_type @ImplicitAs, @ImplicitAs(constants.%T) [symbolic = constants.%.11] -// CHECK:STDOUT: %.loc16_30.3: %.12 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%T) [symbolic = constants.%.13] -// CHECK:STDOUT: %Convert.ref: %.12 = name_ref Convert, %.loc16_30.3 [symbolic = constants.%.13] -// CHECK:STDOUT: %.loc16_30.4: %T = converted %.loc16_29, [template = ] -// CHECK:STDOUT: assign %v.var, -// CHECK:STDOUT: %v.ref: ref %Class.3 = name_ref v, %v -// CHECK:STDOUT: %k.ref: %.4 = name_ref k, @Class.%.loc5 [template = @Class.%.loc5] -// CHECK:STDOUT: %.loc17_11.1: ref i32 = class_element_access %v.ref, element0 -// CHECK:STDOUT: %.loc17_11.2: i32 = bind_value %.loc17_11.1 -// CHECK:STDOUT: return %.loc17_11.2 -// CHECK:STDOUT: } +// CHECK:STDOUT: generic fn @InitFromAdaptedGeneric(%T.loc8: type) { +// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.8)) { -// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %Adapt.1: type = class_type @Adapt, @Adapt(%T.1) [symbolic = %Adapt.1 (constants.%Adapt.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); +// CHECK:STDOUT: fn(%T.loc8: type, %x: @InitFromAdaptedGeneric.%T.1 (%T)) -> @InitFromAdaptedGeneric.%T.1 (%T) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: @InitFromAdaptedGeneric.%T.1 (%T) = name_ref x, %x +// CHECK:STDOUT: %Adapt.ref: %Adapt.type = name_ref Adapt, file.%Adapt.decl [template = constants.%Adapt.1] +// CHECK:STDOUT: %T.ref.loc9_22: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %Adapt.loc9: type = class_type @Adapt, @Adapt(constants.%T) [symbolic = %Adapt.1 (constants.%Adapt.2)] +// CHECK:STDOUT: %.loc9_13.1: @InitFromAdaptedGeneric.%Adapt.1 (%Adapt.2) = as_compatible %x.ref +// CHECK:STDOUT: %.loc9_13.2: @InitFromAdaptedGeneric.%Adapt.1 (%Adapt.2) = converted %x.ref, %.loc9_13.1 +// CHECK:STDOUT: %T.ref.loc9_29: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)] +// CHECK:STDOUT: %.loc9_26.1: @InitFromAdaptedGeneric.%T.1 (%T) = as_compatible %.loc9_13.2 +// CHECK:STDOUT: %.loc9_26.2: @InitFromAdaptedGeneric.%T.1 (%T) = converted %.loc9_13.2, %.loc9_26.1 +// CHECK:STDOUT: return %.loc9_26.2 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(constants.%T) { -// CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: } +// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(@Class.%T) { -// CHECK:STDOUT: %T => constants.%T +// CHECK:STDOUT: fn @InitFromAdaptedSpecific(%x: i32) -> i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %x.ref: i32 = name_ref x, %x +// CHECK:STDOUT: %Adapt.ref: %Adapt.type = name_ref Adapt, file.%Adapt.decl [template = constants.%Adapt.1] +// CHECK:STDOUT: %int.make_type_32.loc13_22: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_21.1: type = value_of_initializer %int.make_type_32.loc13_22 [template = i32] +// CHECK:STDOUT: %.loc13_21.2: type = converted %int.make_type_32.loc13_22, %.loc13_21.1 [template = i32] +// CHECK:STDOUT: %Adapt: type = class_type @Adapt, @Adapt(i32) [template = constants.%Adapt.3] +// CHECK:STDOUT: %.loc13_13.1: %Adapt.3 = as_compatible %x.ref +// CHECK:STDOUT: %.loc13_13.2: %Adapt.3 = converted %x.ref, %.loc13_13.1 +// CHECK:STDOUT: %int.make_type_32.loc13_31: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc13_31.1: type = value_of_initializer %int.make_type_32.loc13_31 [template = i32] +// CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] +// CHECK:STDOUT: %.loc13_28.1: i32 = as_compatible %.loc13_13.2 +// CHECK:STDOUT: %.loc13_28.2: i32 = converted %.loc13_13.2, %.loc13_28.1 +// CHECK:STDOUT: return %.loc13_28.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Class(i32) { -// CHECK:STDOUT: %T => i32 +// CHECK:STDOUT: specific @Adapt(constants.%T) { +// CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Class => constants.%Class.3 -// CHECK:STDOUT: %.1 => constants.%.4 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) { -// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: %.1 => constants.%.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) { -// CHECK:STDOUT: %Dest => constants.%Dest +// CHECK:STDOUT: specific @InitFromAdaptedGeneric(constants.%T) { +// CHECK:STDOUT: %T.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { -// CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.8 -// CHECK:STDOUT: %Self => constants.%Self.1 +// CHECK:STDOUT: specific @Adapt(@InitFromAdaptedGeneric.%T.1) { +// CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ImplicitAs(constants.%T) { -// CHECK:STDOUT: %Dest => constants.%T +// CHECK:STDOUT: specific @Adapt(i32) { +// CHECK:STDOUT: %T => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.11 -// CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 -// CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.12 -// CHECK:STDOUT: %.3 => constants.%.13 +// CHECK:STDOUT: %.1 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index 3daafacbadedd..b3c8095b05da6 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -64,23 +64,27 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %GetAddr.type.1: type = fn_type @GetAddr, @Class(%T) [symbolic] // CHECK:STDOUT: %GetAddr.1: %GetAddr.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.5: type = struct_type {.x: %T} [symbolic] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [symbolic] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [symbolic] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(i32) [template] // CHECK:STDOUT: %DirectFieldAccess.type: type = fn_type @DirectFieldAccess [template] // CHECK:STDOUT: %DirectFieldAccess: %DirectFieldAccess.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %Class.3, i32 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %Class.3, i32 [template] // CHECK:STDOUT: %Get.type.2: type = fn_type @Get, @Class(i32) [template] // CHECK:STDOUT: %Get.2: %Get.type.2 = struct_value () [template] // CHECK:STDOUT: %GetAddr.type.2: type = fn_type @GetAddr, @Class(i32) [template] // CHECK:STDOUT: %GetAddr.2: %GetAddr.type.2 = struct_value () [template] +// CHECK:STDOUT: %.9: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] +// CHECK:STDOUT: %.11: type = ptr_type %.9 [template] // CHECK:STDOUT: %MethodCall.type: type = fn_type @MethodCall [template] // CHECK:STDOUT: %MethodCall: %MethodCall.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Class.3 [template] +// CHECK:STDOUT: %.12: type = ptr_type %Class.3 [template] // CHECK:STDOUT: %AddrMethodCall.type: type = fn_type @AddrMethodCall [template] // CHECK:STDOUT: %AddrMethodCall: %AddrMethodCall.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = ptr_type i32 [template] +// CHECK:STDOUT: %.13: type = ptr_type i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -143,9 +147,9 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.loc18_27.1: type = value_of_initializer %int.make_type_32.loc18_28 [template = i32] // CHECK:STDOUT: %.loc18_27.2: type = converted %int.make_type_32.loc18_28, %.loc18_27.1 [template = i32] // CHECK:STDOUT: %Class.loc18: type = class_type @Class, @Class(i32) [template = constants.%Class.3] -// CHECK:STDOUT: %.loc18_32: type = ptr_type %Class.3 [template = constants.%.8] -// CHECK:STDOUT: %p.loc18_19.1: %.8 = param p, runtime_param0 -// CHECK:STDOUT: @AddrMethodCall.%p: %.8 = bind_name p, %p.loc18_19.1 +// CHECK:STDOUT: %.loc18_32: type = ptr_type %Class.3 [template = constants.%.12] +// CHECK:STDOUT: %p.loc18_19.1: %.12 = param p, runtime_param0 +// CHECK:STDOUT: @AddrMethodCall.%p: %.12 = bind_name p, %p.loc18_19.1 // CHECK:STDOUT: %int.make_type_32.loc18_38: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_38.1: type = value_of_initializer %int.make_type_32.loc18_38 [template = i32] // CHECK:STDOUT: %.loc18_38.2: type = converted %int.make_type_32.loc18_38, %.loc18_38.1 [template = i32] @@ -163,6 +167,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Get: @Class.%Get.type (%Get.type.1) = struct_value () [symbolic = %Get (constants.%Get.1)] // CHECK:STDOUT: %GetAddr.type: type = fn_type @GetAddr, @Class(%T) [symbolic = %GetAddr.type (constants.%GetAddr.type.1)] // CHECK:STDOUT: %GetAddr: @Class.%GetAddr.type (%GetAddr.type.1) = struct_value () [symbolic = %GetAddr (constants.%GetAddr.1)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @Class.%T (%T)} [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.5) [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref.loc3: type = name_ref T, file.%T.loc2_13.2 [symbolic = %T (constants.%T)] @@ -186,6 +192,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %.loc7_38: type = ptr_type %T [symbolic = @GetAddr.%.2 (constants.%.4)] // CHECK:STDOUT: %return.var.loc7: ref @GetAddr.%.2 (%.4) = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc8: = complete_type_witness %.5 [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -237,7 +244,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: fn @DirectFieldAccess(%x: %Class.3) -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref.loc11_10: %Class.3 = name_ref x, %x -// CHECK:STDOUT: %x.ref.loc11_11: %.7 = name_ref x, @Class.%.loc3 [template = @Class.%.loc3] +// CHECK:STDOUT: %x.ref.loc11_11: %.8 = name_ref x, @Class.%.loc3 [template = @Class.%.loc3] // CHECK:STDOUT: %.loc11_11.1: ref i32 = class_element_access %x.ref.loc11_10, element0 // CHECK:STDOUT: %.loc11_11.2: i32 = bind_value %.loc11_11.1 // CHECK:STDOUT: return %.loc11_11.2 @@ -255,17 +262,17 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: return %.loc15_17.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddrMethodCall(%p: %.8) -> i32 { +// CHECK:STDOUT: fn @AddrMethodCall(%p: %.12) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p +// CHECK:STDOUT: %p.ref: %.12 = name_ref p, %p // CHECK:STDOUT: %.loc19_12.1: ref %Class.3 = deref %p.ref // CHECK:STDOUT: %.loc19_12.2: %GetAddr.type.2 = specific_constant @Class.%GetAddr.decl, @Class(i32) [template = constants.%GetAddr.2] // CHECK:STDOUT: %GetAddr.ref: %GetAddr.type.2 = name_ref GetAddr, %.loc19_12.2 [template = constants.%GetAddr.2] // CHECK:STDOUT: %.loc19_12.3: = bound_method %.loc19_12.1, %GetAddr.ref -// CHECK:STDOUT: %.loc19_12.4: %.8 = addr_of %.loc19_12.1 -// CHECK:STDOUT: %GetAddr.call: init %.9 = call %.loc19_12.3(%.loc19_12.4) -// CHECK:STDOUT: %.loc19_21.1: %.9 = value_of_initializer %GetAddr.call -// CHECK:STDOUT: %.loc19_21.2: %.9 = converted %GetAddr.call, %.loc19_21.1 +// CHECK:STDOUT: %.loc19_12.4: %.12 = addr_of %.loc19_12.1 +// CHECK:STDOUT: %GetAddr.call: init %.13 = call %.loc19_12.3(%.loc19_12.4) +// CHECK:STDOUT: %.loc19_21.1: %.13 = value_of_initializer %GetAddr.call +// CHECK:STDOUT: %.loc19_21.2: %.13 = converted %GetAddr.call, %.loc19_21.1 // CHECK:STDOUT: %.loc19_10.1: ref i32 = deref %.loc19_21.2 // CHECK:STDOUT: %.loc19_10.2: i32 = bind_value %.loc19_10.1 // CHECK:STDOUT: return %.loc19_10.2 @@ -281,6 +288,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Get => constants.%Get.1 // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type.1 // CHECK:STDOUT: %GetAddr => constants.%GetAddr.1 +// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: %.3 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Get.%T) { @@ -312,11 +321,13 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Class => constants.%Class.3 -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Get.type => constants.%Get.type.2 // CHECK:STDOUT: %Get => constants.%Get.2 // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type.2 // CHECK:STDOUT: %GetAddr => constants.%GetAddr.2 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: %.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Get(i32) { @@ -327,8 +338,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: specific @GetAddr(i32) { // CHECK:STDOUT: %T => i32 // CHECK:STDOUT: %Class => constants.%Class.3 -// CHECK:STDOUT: %.1 => constants.%.8 -// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_static_member_fn_call.carbon @@ -342,26 +353,27 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T) [symbolic] // CHECK:STDOUT: %Make: %Make.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %struct: %Class.2 = struct_value () [symbolic] // CHECK:STDOUT: %StaticMemberFunctionCall.type: type = fn_type @StaticMemberFunctionCall [template] // CHECK:STDOUT: %StaticMemberFunctionCall: %StaticMemberFunctionCall.type = struct_value () [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [symbolic] -// CHECK:STDOUT: %.7: type = interface_type @ImplicitAs, @ImplicitAs(%Class.2) [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%Class.2) [symbolic] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%Class.2) [symbolic] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.2 [symbolic] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [symbolic] -// CHECK:STDOUT: %.10: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.2 [symbolic] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %.11: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -378,7 +390,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)] +// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.11)] // CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -409,12 +421,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.4), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.5) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.5), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.6) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -438,6 +450,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%T) [symbolic = @Make.%Class (constants.%Class.2)] // CHECK:STDOUT: %return.var: ref @Make.%Class (%Class.2) = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -468,10 +481,10 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T.1) [symbolic = %Make.type (constants.%Make.type)] // CHECK:STDOUT: %Make: @StaticMemberFunctionCall.%Make.type (%Make.type) = struct_value () [symbolic = %Make (constants.%Make)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Class.1) [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Class.1) [symbolic = %.1 (constants.%.8)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Class.1) [symbolic = %Convert.type (constants.%Convert.type.2)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @StaticMemberFunctionCall.%.1 (%.7), @StaticMemberFunctionCall.%Convert.type (%Convert.type.2) [symbolic = %.2 (constants.%.8)] -// CHECK:STDOUT: %.3: @StaticMemberFunctionCall.%.2 (%.8) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.9)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @StaticMemberFunctionCall.%.1 (%.8), @StaticMemberFunctionCall.%Convert.type (%Convert.type.2) [symbolic = %.2 (constants.%.9)] +// CHECK:STDOUT: %.3: @StaticMemberFunctionCall.%.2 (%.9) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.10)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%T.loc8: type) -> %return: @StaticMemberFunctionCall.%Class.1 (%Class.2) { // CHECK:STDOUT: !entry: @@ -482,19 +495,19 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Make.ref: @StaticMemberFunctionCall.%Make.type (%Make.type) = name_ref Make, %.loc15_18 [symbolic = %Make (constants.%Make)] // CHECK:STDOUT: %.loc15_23.1: ref @StaticMemberFunctionCall.%Class.1 (%Class.2) = temporary_storage // CHECK:STDOUT: %Make.call: init @StaticMemberFunctionCall.%Class.1 (%Class.2) = call %Make.ref() to %.loc15_23.1 -// CHECK:STDOUT: %.loc15_25.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class.2) [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %.loc15_25.2: @StaticMemberFunctionCall.%.2 (%.8) = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class.2) [symbolic = %.3 (constants.%.9)] -// CHECK:STDOUT: %Convert.ref: @StaticMemberFunctionCall.%.2 (%.8) = name_ref Convert, %.loc15_25.2 [symbolic = %.3 (constants.%.9)] +// CHECK:STDOUT: %.loc15_25.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class.2) [symbolic = %.1 (constants.%.8)] +// CHECK:STDOUT: %.loc15_25.2: @StaticMemberFunctionCall.%.2 (%.9) = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class.2) [symbolic = %.3 (constants.%.10)] +// CHECK:STDOUT: %Convert.ref: @StaticMemberFunctionCall.%.2 (%.9) = name_ref Convert, %.loc15_25.2 [symbolic = %.3 (constants.%.10)] // CHECK:STDOUT: %.loc15_23.2: ref @StaticMemberFunctionCall.%Class.1 (%Class.2) = temporary %.loc15_23.1, %Make.call // CHECK:STDOUT: %.loc15_25.3: @StaticMemberFunctionCall.%Class.1 (%Class.2) = converted %Make.call, [template = ] // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.4)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.5)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -543,7 +556,7 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -551,12 +564,12 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) { // CHECK:STDOUT: %Dest => constants.%Class.2 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.8 -// CHECK:STDOUT: %.3 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: %.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(@StaticMemberFunctionCall.%Class.1) { diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index 1f7be07eaf3f5..f3ea63c4b8061 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -52,7 +52,8 @@ class C(T:! type) { // CHECK:STDOUT: %G: %G.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.n: %T} [symbolic] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -90,6 +91,8 @@ class C(T:! type) { // CHECK:STDOUT: %G: @Class.%G.type (%G.type) = struct_value () [symbolic = %G (constants.%G)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.n: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { @@ -109,6 +112,7 @@ class C(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: %T.ref.loc13: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.loc13: @Class.%.1 (%.2) = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -157,6 +161,8 @@ class C(T:! type) { // CHECK:STDOUT: %G => constants.%G // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %.1 => constants.%.2 +// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { @@ -189,6 +195,7 @@ class C(T:! type) { // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: %.3: type = unbound_element_type %C.2, %.2 [symbolic] // CHECK:STDOUT: %.4: type = struct_type {.data: %.2} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -230,6 +237,7 @@ class C(T:! type) { // CHECK:STDOUT: %.loc11_14.1: %.2 = struct_literal () // CHECK:STDOUT: %.loc11_14.2: type = converted %.loc11_14.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %.loc11_11: @C.%.1 (%.3) = field_decl data, element0 [template] +// CHECK:STDOUT: %.loc12: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index b72eef214b8bb..ae2bbc78473de 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -119,7 +119,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %G: %G.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.n: %T} [symbolic] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -176,6 +177,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %G: @Class.%G.type (%G.type) = struct_value () [symbolic = %G (constants.%G)] // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)] // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.2: type = struct_type {.n: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] { @@ -195,6 +198,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %T.ref.loc7: type = name_ref T, file.%T.loc4_13.2 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %.loc7: @Class.%.1 (%.2) = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc8: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -243,6 +247,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %G => constants.%G // CHECK:STDOUT: %Class => constants.%Class.2 // CHECK:STDOUT: %.1 => constants.%.2 +// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { @@ -277,7 +283,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %F.type: type = fn_type @F, @B(%T, %N) [symbolic] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -332,6 +339,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %N.loc5_11.1: @B.%T (%T) = param N, runtime_param // CHECK:STDOUT: %N.loc5_11.2: @B.%T (%T) = bind_symbolic_name N 1, %N.loc5_11.1 [symbolic = @B.%N (constants.%N)] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc8: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.2 @@ -357,6 +365,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %a.loc6_22.1: @F.%T (%T) = param a, runtime_param1 // CHECK:STDOUT: %a.loc6_22.2: @F.%T (%T) = bind_name a, %a.loc6_22.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B.2 @@ -422,9 +431,10 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -447,7 +457,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NotGeneric.decl: type = class_decl @NotGeneric [template = constants.%NotGeneric] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %T.loc15_15.1: type = param T, runtime_param // CHECK:STDOUT: %T.loc15_15.2: type = bind_symbolic_name T 0, %T.loc15_15.1 [symbolic = @.1.%T (constants.%T)] // CHECK:STDOUT: } @@ -455,6 +465,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: class @NotGeneric { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%NotGeneric @@ -489,8 +500,9 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew, @Generic(%T) [symbolic] // CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -516,7 +528,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc4_15.1: type = param T, runtime_param // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] {} +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Generic(file.%T.loc4_15.2: type) { @@ -528,6 +540,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %TooFew.decl: @Generic.%TooFew.type (%TooFew.type) = fn_decl @TooFew [symbolic = %TooFew (constants.%TooFew)] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Generic.2 @@ -566,9 +579,10 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany, @Generic(%T) [symbolic] // CHECK:STDOUT: %TooMany: %TooMany.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -594,7 +608,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc4_15.1: type = param T, runtime_param // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %T.loc15_12.1: type = param T, runtime_param // CHECK:STDOUT: %T.loc15_12.2: type = bind_symbolic_name T 0, %T.loc15_12.1 [symbolic = @.1.%T (constants.%T)] // CHECK:STDOUT: %U.loc15_22.1: type = param U, runtime_param @@ -611,6 +625,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %TooMany.decl: @Generic.%TooMany.type (%TooMany.type) = fn_decl @TooMany [symbolic = %TooMany (constants.%TooMany)] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Generic.2 @@ -661,9 +676,10 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %WrongType.type: type = fn_type @WrongType, @Generic(%T.1) [symbolic] // CHECK:STDOUT: %WrongType: %WrongType.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T.2: %.1 = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -689,7 +705,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %T.loc4_15.1: type = param T, runtime_param // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T.1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %.loc14_17.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc14_17.2: type = converted %.loc14_17.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %T.loc14_12.1: %.1 = param T, runtime_param @@ -706,6 +722,7 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %WrongType.decl: @Generic.%WrongType.type (%WrongType.type) = fn_decl @WrongType [symbolic = %WrongType (constants.%WrongType)] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Generic.2 diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index d1655f1aee7f1..209d46299e789 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -29,26 +29,27 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template] // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic] // CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic] -// CHECK:STDOUT: %.3: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %.4: type = tuple_type (%T, %U) [symbolic] +// CHECK:STDOUT: %.4: type = tuple_type (type, type) [template] +// CHECK:STDOUT: %.5: type = tuple_type (%T, %U) [symbolic] // CHECK:STDOUT: %Get.type.1: type = fn_type @Get, @Class(%T) [symbolic] // CHECK:STDOUT: %Get.1: %Get.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %GetNoDeduce.type.1: type = fn_type @GetNoDeduce, @Class(%T) [symbolic] // CHECK:STDOUT: %GetNoDeduce.1: %GetNoDeduce.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%A) [template] -// CHECK:STDOUT: %.5: type = tuple_type (%A, %B) [template] +// CHECK:STDOUT: %.6: type = tuple_type (%A, %B) [template] // CHECK:STDOUT: %CallGenericMethod.type: type = fn_type @CallGenericMethod [template] // CHECK:STDOUT: %CallGenericMethod: %CallGenericMethod.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.7: type = tuple_type (%.6, %.6) [template] -// CHECK:STDOUT: %.8: type = ptr_type %.7 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.8: type = tuple_type (%.7, %.7) [template] +// CHECK:STDOUT: %.9: type = ptr_type %.8 [template] // CHECK:STDOUT: %Get.type.2: type = fn_type @Get, @Class(%A) [template] // CHECK:STDOUT: %Get.2: %Get.type.2 = struct_value () [template] // CHECK:STDOUT: %GetNoDeduce.type.2: type = fn_type @GetNoDeduce, @Class(%A) [template] @@ -95,9 +96,9 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: @CallGenericMethod.%c: %Class.3 = bind_name c, %c.loc19_22.1 // CHECK:STDOUT: %A.ref.loc19_39: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %B.ref.loc19: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc19_43.1: %.3 = tuple_literal (%A.ref.loc19_39, %B.ref.loc19) -// CHECK:STDOUT: %.loc19_43.2: type = converted %.loc19_43.1, constants.%.5 [template = constants.%.5] -// CHECK:STDOUT: @CallGenericMethod.%return: ref %.5 = var +// CHECK:STDOUT: %.loc19_43.1: %.4 = tuple_literal (%A.ref.loc19_39, %B.ref.loc19) +// CHECK:STDOUT: %.loc19_43.2: type = converted %.loc19_43.1, constants.%.6 [template = constants.%.6] +// CHECK:STDOUT: @CallGenericMethod.%return: ref %.6 = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallGenericMethodWithNonDeducedParam.decl: %CallGenericMethodWithNonDeducedParam.type = fn_decl @CallGenericMethodWithNonDeducedParam [template = constants.%CallGenericMethodWithNonDeducedParam] { // CHECK:STDOUT: %Class.ref.loc23: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] @@ -107,18 +108,22 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: @CallGenericMethodWithNonDeducedParam.%c: %Class.3 = bind_name c, %c.loc23_41.1 // CHECK:STDOUT: %A.ref.loc23_58: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %B.ref.loc23: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc23_62.1: %.3 = tuple_literal (%A.ref.loc23_58, %B.ref.loc23) -// CHECK:STDOUT: %.loc23_62.2: type = converted %.loc23_62.1, constants.%.5 [template = constants.%.5] -// CHECK:STDOUT: @CallGenericMethodWithNonDeducedParam.%return: ref %.5 = var +// CHECK:STDOUT: %.loc23_62.1: %.4 = tuple_literal (%A.ref.loc23_58, %B.ref.loc23) +// CHECK:STDOUT: %.loc23_62.2: type = converted %.loc23_62.1, constants.%.6 [template = constants.%.6] +// CHECK:STDOUT: @CallGenericMethodWithNonDeducedParam.%return: ref %.6 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } @@ -138,9 +143,9 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %U.loc15_10.2: type = bind_symbolic_name U 1, %U.loc15_10.1 [symbolic = @Get.%U.1 (constants.%U)] // CHECK:STDOUT: %T.ref.loc15: type = name_ref T, file.%T.loc14_13.2 [symbolic = @Get.%T (constants.%T)] // CHECK:STDOUT: %U.ref.loc15: type = name_ref U, %U.loc15_10.2 [symbolic = @Get.%U.1 (constants.%U)] -// CHECK:STDOUT: %.loc15_28.1: %.3 = tuple_literal (%T.ref.loc15, %U.ref.loc15) -// CHECK:STDOUT: %.loc15_28.2: type = converted %.loc15_28.1, constants.%.4 [symbolic = @Get.%.1 (constants.%.4)] -// CHECK:STDOUT: %return.var.loc15: ref @Get.%.1 (%.4) = var +// CHECK:STDOUT: %.loc15_28.1: %.4 = tuple_literal (%T.ref.loc15, %U.ref.loc15) +// CHECK:STDOUT: %.loc15_28.2: type = converted %.loc15_28.1, constants.%.5 [symbolic = @Get.%.1 (constants.%.5)] +// CHECK:STDOUT: %return.var.loc15: ref @Get.%.1 (%.5) = var // CHECK:STDOUT: } // CHECK:STDOUT: %GetNoDeduce.decl: @Class.%GetNoDeduce.type (%GetNoDeduce.type.1) = fn_decl @GetNoDeduce [symbolic = %GetNoDeduce (constants.%GetNoDeduce.1)] { // CHECK:STDOUT: %T.ref.loc16_21: type = name_ref T, file.%T.loc14_13.2 [symbolic = @GetNoDeduce.%T (constants.%T)] @@ -150,10 +155,11 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: %U.loc16_24.2: type = bind_symbolic_name U 1, %U.loc16_24.1 [symbolic = @GetNoDeduce.%U.1 (constants.%U)] // CHECK:STDOUT: %T.ref.loc16_38: type = name_ref T, file.%T.loc14_13.2 [symbolic = @GetNoDeduce.%T (constants.%T)] // CHECK:STDOUT: %U.ref.loc16: type = name_ref U, %U.loc16_24.2 [symbolic = @GetNoDeduce.%U.1 (constants.%U)] -// CHECK:STDOUT: %.loc16_42.1: %.3 = tuple_literal (%T.ref.loc16_38, %U.ref.loc16) -// CHECK:STDOUT: %.loc16_42.2: type = converted %.loc16_42.1, constants.%.4 [symbolic = @GetNoDeduce.%.1 (constants.%.4)] -// CHECK:STDOUT: %return.var.loc16: ref @GetNoDeduce.%.1 (%.4) = var +// CHECK:STDOUT: %.loc16_42.1: %.4 = tuple_literal (%T.ref.loc16_38, %U.ref.loc16) +// CHECK:STDOUT: %.loc16_42.2: type = converted %.loc16_42.1, constants.%.5 [symbolic = @GetNoDeduce.%.1 (constants.%.5)] +// CHECK:STDOUT: %return.var.loc16: ref @GetNoDeduce.%.1 (%.5) = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -165,44 +171,44 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: generic fn @Get(file.%T.loc14_13.2: type, @Class.%U.loc15_10.2: type) { // CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.1: type = tuple_type (@Get.%T (%T), @Get.%U.1 (%U)) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.1: type = tuple_type (@Get.%T (%T), @Get.%U.1 (%U)) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@Class.%U.loc15_10.2: type) -> @Get.%.1 (%.4); +// CHECK:STDOUT: fn(@Class.%U.loc15_10.2: type) -> @Get.%.1 (%.5); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @GetNoDeduce(file.%T.loc14_13.2: type, @Class.%U.loc16_24.2: type) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic = %U.1 (constants.%U)] -// CHECK:STDOUT: %.1: type = tuple_type (@GetNoDeduce.%T (%T), @GetNoDeduce.%U.1 (%U)) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %.1: type = tuple_type (@GetNoDeduce.%T (%T), @GetNoDeduce.%U.1 (%U)) [symbolic = %.1 (constants.%.5)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@Class.%x.loc16_18.2: @GetNoDeduce.%T (%T), @Class.%U.loc16_24.2: type) -> @GetNoDeduce.%.1 (%.4); +// CHECK:STDOUT: fn(@Class.%x.loc16_18.2: @GetNoDeduce.%T (%T), @Class.%U.loc16_24.2: type) -> @GetNoDeduce.%.1 (%.5); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallGenericMethod(%c: %Class.3) -> %return: %.5 { +// CHECK:STDOUT: fn @CallGenericMethod(%c: %Class.3) -> %return: %.6 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.3 = name_ref c, %c // CHECK:STDOUT: %.loc20: %Get.type.2 = specific_constant @Class.%Get.decl, @Class(constants.%A) [template = constants.%Get.2] // CHECK:STDOUT: %Get.ref: %Get.type.2 = name_ref Get, %.loc20 [template = constants.%Get.2] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc19: ref %.5 = splice_block %return {} -// CHECK:STDOUT: %Get.call: init %.5 = call %Get.ref() to %.loc19 +// CHECK:STDOUT: %.loc19: ref %.6 = splice_block %return {} +// CHECK:STDOUT: %Get.call: init %.6 = call %Get.ref() to %.loc19 // CHECK:STDOUT: return %Get.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallGenericMethodWithNonDeducedParam(%c: %Class.3) -> %return: %.5 { +// CHECK:STDOUT: fn @CallGenericMethodWithNonDeducedParam(%c: %Class.3) -> %return: %.6 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %Class.3 = name_ref c, %c // CHECK:STDOUT: %.loc24_11: %GetNoDeduce.type.2 = specific_constant @Class.%GetNoDeduce.decl, @Class(constants.%A) [template = constants.%GetNoDeduce.2] // CHECK:STDOUT: %GetNoDeduce.ref: %GetNoDeduce.type.2 = name_ref GetNoDeduce, %.loc24_11 [template = constants.%GetNoDeduce.2] // CHECK:STDOUT: %.loc24_25.1: %.1 = struct_literal () // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc23: ref %.5 = splice_block %return {} +// CHECK:STDOUT: %.loc23: ref %.6 = splice_block %return {} // CHECK:STDOUT: %.loc24_25.2: ref %A = temporary_storage // CHECK:STDOUT: %.loc24_25.3: init %A = class_init (), %.loc24_25.2 [template = constants.%struct] // CHECK:STDOUT: %.loc24_25.4: ref %A = temporary %.loc24_25.2, %.loc24_25.3 // CHECK:STDOUT: %.loc24_23.1: ref %A = converted %.loc24_25.1, %.loc24_25.4 // CHECK:STDOUT: %.loc24_23.2: %A = bind_value %.loc24_23.1 -// CHECK:STDOUT: %GetNoDeduce.call: init %.5 = call %GetNoDeduce.ref(%.loc24_23.2) to %.loc23 +// CHECK:STDOUT: %GetNoDeduce.call: init %.6 = call %GetNoDeduce.ref(%.loc24_23.2) to %.loc23 // CHECK:STDOUT: return %GetNoDeduce.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -213,13 +219,13 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: specific @Get(constants.%T, constants.%U) { // CHECK:STDOUT: %U.1 => constants.%U // CHECK:STDOUT: %T => constants.%T -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetNoDeduce(constants.%T, constants.%U) { // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %U.1 => constants.%U -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@Class.%T) { @@ -239,12 +245,12 @@ fn CallGenericMethodWithNonDeducedParam(c: Class(A)) -> (A, B) { // CHECK:STDOUT: specific @Get(constants.%A, constants.%B) { // CHECK:STDOUT: %U.1 => constants.%B // CHECK:STDOUT: %T => constants.%A -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @GetNoDeduce(constants.%A, constants.%B) { // CHECK:STDOUT: %T => constants.%A // CHECK:STDOUT: %U.1 => constants.%B -// CHECK:STDOUT: %.1 => constants.%.5 +// CHECK:STDOUT: %.1 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 6aa6592c0b8f0..283a7214bce46 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -95,6 +95,7 @@ class E(U:! type) {} // CHECK:STDOUT: %Generic.1: %Generic.type = struct_value () [template] // CHECK:STDOUT: %Generic.2: type = class_type @Generic, @Generic(%T) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -132,6 +133,8 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Generic.2 // CHECK:STDOUT: } @@ -151,6 +154,7 @@ class E(U:! type) {} // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T) [symbolic] // CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -187,6 +191,8 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } @@ -212,6 +218,7 @@ class E(U:! type) {} // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T, %N.2) [symbolic] // CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -264,6 +271,8 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } @@ -295,6 +304,7 @@ class E(U:! type) {} // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T, %U) [symbolic] // CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -346,6 +356,8 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } @@ -377,6 +389,7 @@ class E(U:! type) {} // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%T.2) [symbolic] // CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -425,6 +438,8 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } @@ -453,6 +468,7 @@ class E(U:! type) {} // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: %.3: type = class_type @.1, @.1(%U) [symbolic] // CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -496,6 +512,8 @@ class E(U:! type) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.4 [template = constants.%.5] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index 0d0a1847ed82f..f9206a55107cc 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -34,7 +34,8 @@ class Class(T:! type) { // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -86,6 +87,7 @@ class Class(T:! type) { // CHECK:STDOUT: %return.var.loc15: ref @MakeClass.%Class (%Class.2) = var // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: @Class.%F.type (%F.type) = fn_decl @F [symbolic = %F (constants.%F)] {} +// CHECK:STDOUT: %.loc20: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index b191aa19cae76..a36a5162adec1 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -27,7 +27,8 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = struct_type {.a: %T} [symbolic] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [symbolic] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -74,6 +75,8 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)] // CHECK:STDOUT: %F.type: type = fn_type @F, @Class(%T) [symbolic = %F.type (constants.%F.type)] // CHECK:STDOUT: %F: @Class.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)] +// CHECK:STDOUT: %.2: type = struct_type {.a: @Class.%T (%T)} [symbolic = %.2 (constants.%.3)] +// CHECK:STDOUT: %.3: = complete_type_witness @Class.%.2 (%.3) [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: %T.ref.loc12: type = name_ref T, file.%T.loc11_13.2 [symbolic = %T (constants.%T)] @@ -87,6 +90,7 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %n.loc13_20.1: @F.%T (%T) = param n, runtime_param1 // CHECK:STDOUT: %n.loc13_20.2: @F.%T (%T) = bind_name n, %n.loc13_20.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [symbolic = %.3 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class.2 @@ -115,6 +119,8 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %.1 => constants.%.2 // CHECK:STDOUT: %F.type => constants.%F.type // CHECK:STDOUT: %F => constants.%F +// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.3 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Class(@F.%T) { diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 0ef5a758720cd..bc69f82f9305c 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -54,16 +54,18 @@ fn Run() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %Empty: type = class_type @Empty [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Field: type = class_type @Field [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = unbound_element_type %Field, i32 [template] -// CHECK:STDOUT: %.4: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.4: type = unbound_element_type %Field, i32 [template] +// CHECK:STDOUT: %.5: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %ForwardDeclared: type = class_type @ForwardDeclared [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %ForwardDeclared [template] +// CHECK:STDOUT: %.7: type = ptr_type %ForwardDeclared [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] @@ -101,6 +103,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Empty // CHECK:STDOUT: } @@ -109,7 +113,8 @@ fn Run() { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32, %.loc8_10.1 [template = i32] -// CHECK:STDOUT: %.loc8_8: %.3 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc8_8: %.4 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc9: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Field @@ -124,11 +129,12 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Self.ref.loc15: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared] -// CHECK:STDOUT: %.loc15_23: type = ptr_type %ForwardDeclared [template = constants.%.5] -// CHECK:STDOUT: %self.loc15_13.1: %.5 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc15_13.3: %.5 = bind_name self, %self.loc15_13.1 -// CHECK:STDOUT: %.loc15_8: %.5 = addr_pattern %self.loc15_13.3 +// CHECK:STDOUT: %.loc15_23: type = ptr_type %ForwardDeclared [template = constants.%.7] +// CHECK:STDOUT: %self.loc15_13.1: %.7 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc15_13.3: %.7 = bind_name self, %self.loc15_13.1 +// CHECK:STDOUT: %.loc15_8: %.7 = addr_pattern %self.loc15_13.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc16: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%ForwardDeclared @@ -142,7 +148,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[@ForwardDeclared.%self.loc14_8.2: %ForwardDeclared](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr @ForwardDeclared.%self.loc15_13.3: %.5](); +// CHECK:STDOUT: fn @G[addr @ForwardDeclared.%self.loc15_13.3: %.7](); // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: @@ -152,15 +158,17 @@ fn Run() { // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: %Empty: type = class_type @Empty [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %struct.1: %Empty = struct_value () [template] // CHECK:STDOUT: %Field: type = class_type @Field [template] -// CHECK:STDOUT: %.4: type = struct_type {.x: i32} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 1 [template] -// CHECK:STDOUT: %struct.2: %Field = struct_value (%.6) [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %Field, i32 [template] -// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.5: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 1 [template] +// CHECK:STDOUT: %struct.2: %Field = struct_value (%.8) [template] +// CHECK:STDOUT: %.9: type = unbound_element_type %Field, i32 [template] +// CHECK:STDOUT: %.10: i32 = int_literal 2 [template] // CHECK:STDOUT: %ForwardDeclared.1: type = class_type @ForwardDeclared.1 [template] // CHECK:STDOUT: %struct.3: %ForwardDeclared.1 = struct_value () [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -168,16 +176,16 @@ fn Run() { // CHECK:STDOUT: %ForwardDeclared.2: type = class_type @ForwardDeclared.2 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = ptr_type %ForwardDeclared.1 [template] +// CHECK:STDOUT: %.11: type = ptr_type %ForwardDeclared.1 [template] // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] -// CHECK:STDOUT: %.10: type = ptr_type %Incomplete [template] +// CHECK:STDOUT: %.12: type = ptr_type %Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+6, loaded [template = constants.%Field] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+22, loaded [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+40, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+8, loaded [template = constants.%Field] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+26, loaded [template = constants.%ForwardDeclared.1] +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+45, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -189,14 +197,14 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+7, unloaded -// CHECK:STDOUT: %import_ref.7: %.7 = import_ref Main//a, inst+18, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+23, unloaded -// CHECK:STDOUT: %import_ref.9: %F.type = import_ref Main//a, inst+28, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.10: %G.type = import_ref Main//a, inst+37, loaded [template = constants.%G] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst+23, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, inst+28, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//a, inst+37, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+9, unloaded +// CHECK:STDOUT: %import_ref.7: %.9 = import_ref Main//a, inst+20, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+27, unloaded +// CHECK:STDOUT: %import_ref.9: %F.type = import_ref Main//a, inst+32, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.10: %G.type = import_ref Main//a, inst+41, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst+27, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, inst+32, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//a, inst+41, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -252,17 +260,17 @@ fn Run() { // CHECK:STDOUT: %Field.ref: type = name_ref Field, imports.%import_ref.2 [template = constants.%Field] // CHECK:STDOUT: %b.var: ref %Field = var b // CHECK:STDOUT: %b: ref %Field = bind_name b, %b.var -// CHECK:STDOUT: %.loc9_24: i32 = int_literal 1 [template = constants.%.6] -// CHECK:STDOUT: %.loc9_25.1: %.4 = struct_literal (%.loc9_24) +// CHECK:STDOUT: %.loc9_24: i32 = int_literal 1 [template = constants.%.8] +// CHECK:STDOUT: %.loc9_25.1: %.5 = struct_literal (%.loc9_24) // CHECK:STDOUT: %.loc9_25.2: ref i32 = class_element_access %b.var, element0 -// CHECK:STDOUT: %.loc9_25.3: init i32 = initialize_from %.loc9_24 to %.loc9_25.2 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_25.3: init i32 = initialize_from %.loc9_24 to %.loc9_25.2 [template = constants.%.8] // CHECK:STDOUT: %.loc9_25.4: init %Field = class_init (%.loc9_25.3), %b.var [template = constants.%struct.2] // CHECK:STDOUT: %.loc9_26: init %Field = converted %.loc9_25.1, %.loc9_25.4 [template = constants.%struct.2] // CHECK:STDOUT: assign %b.var, %.loc9_26 // CHECK:STDOUT: %b.ref: ref %Field = name_ref b, %b -// CHECK:STDOUT: %x.ref: %.7 = name_ref x, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.9 = name_ref x, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc10_4: ref i32 = class_element_access %b.ref, element0 -// CHECK:STDOUT: %.loc10_9: i32 = int_literal 2 [template = constants.%.8] +// CHECK:STDOUT: %.loc10_9: i32 = int_literal 2 [template = constants.%.10] // CHECK:STDOUT: assign %.loc10_4, %.loc10_9 // CHECK:STDOUT: %ForwardDeclared.ref.loc12: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %c.var: ref %ForwardDeclared.1 = var c @@ -279,23 +287,23 @@ fn Run() { // CHECK:STDOUT: %c.ref.loc14: ref %ForwardDeclared.1 = name_ref c, %c // CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.10 [template = constants.%G] // CHECK:STDOUT: %.loc14_4: = bound_method %c.ref.loc14, %G.ref -// CHECK:STDOUT: %.loc14_3: %.9 = addr_of %c.ref.loc14 +// CHECK:STDOUT: %.loc14_3: %.11 = addr_of %c.ref.loc14 // CHECK:STDOUT: %G.call: init %.1 = call %.loc14_4(%.loc14_3) // CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %.loc16_25: type = ptr_type %ForwardDeclared.1 [template = constants.%.9] -// CHECK:STDOUT: %d.var: ref %.9 = var d -// CHECK:STDOUT: %d: ref %.9 = bind_name d, %d.var +// CHECK:STDOUT: %.loc16_25: type = ptr_type %ForwardDeclared.1 [template = constants.%.11] +// CHECK:STDOUT: %d.var: ref %.11 = var d +// CHECK:STDOUT: %d: ref %.11 = bind_name d, %d.var // CHECK:STDOUT: %c.ref.loc16: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %.loc16_29: %.9 = addr_of %c.ref.loc16 +// CHECK:STDOUT: %.loc16_29: %.11 = addr_of %c.ref.loc16 // CHECK:STDOUT: assign %d.var, %.loc16_29 // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.4 [template = constants.%Incomplete] -// CHECK:STDOUT: %.loc18: type = ptr_type %Incomplete [template = constants.%.10] -// CHECK:STDOUT: %e.var: ref %.10 = var e -// CHECK:STDOUT: %e: ref %.10 = bind_name e, %e.var +// CHECK:STDOUT: %.loc18: type = ptr_type %Incomplete [template = constants.%.12] +// CHECK:STDOUT: %e.var: ref %.12 = var e +// CHECK:STDOUT: %e: ref %.12 = bind_name e, %e.var // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self: %ForwardDeclared.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr %self: %.9](); +// CHECK:STDOUT: fn @G[addr %self: %.11](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index d532f9b33c0ae..77acab233f263 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -49,10 +49,12 @@ fn Run() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Base, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: i32, .unused: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Child: type = class_type @Child [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Child, %Base [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Child, %Base [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -100,6 +102,7 @@ fn Run() { // CHECK:STDOUT: %.loc9_15.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] // CHECK:STDOUT: %.loc9_15.2: type = converted %int.make_type_32.loc9, %.loc9_15.1 [template = i32] // CHECK:STDOUT: %.loc9_13: %.2 = field_decl unused, element1 [template] +// CHECK:STDOUT: %.loc10: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -111,7 +114,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Child { // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc13: %.5 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc13: %.6 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Child @@ -134,25 +138,27 @@ fn Run() { // CHECK:STDOUT: %Child: type = class_type @Child [template] // CHECK:STDOUT: %Base: type = class_type @Base [template] // CHECK:STDOUT: %.2: type = struct_type {.x: i32, .unused: i32} [template] -// CHECK:STDOUT: %.3: type = unbound_element_type %Child, %Base [template] -// CHECK:STDOUT: %.4: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %.5} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.4 [template] -// CHECK:STDOUT: %.8: i32 = int_literal 0 [template] -// CHECK:STDOUT: %.9: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.10: type = struct_type {.base: %.2} [template] -// CHECK:STDOUT: %struct.1: %Base = struct_value (%.8, %.9) [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = unbound_element_type %Child, %Base [template] +// CHECK:STDOUT: %.5: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %.7} [template] +// CHECK:STDOUT: %.9: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.10: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.11: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.12: type = struct_type {.base: %.2} [template] +// CHECK:STDOUT: %struct.1: %Base = struct_value (%.10, %.11) [template] // CHECK:STDOUT: %struct.2: %Child = struct_value (%struct.1) [template] -// CHECK:STDOUT: %.11: type = unbound_element_type %Base, i32 [template] -// CHECK:STDOUT: %.12: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.13: type = unbound_element_type %Base, i32 [template] +// CHECK:STDOUT: %.14: i32 = int_literal 2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+37, loaded [template = constants.%Child] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+39, loaded [template = constants.%Child] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -166,10 +172,10 @@ fn Run() { // CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+8, loaded [template = constants.%F] // CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6: %.11 = import_ref Main//a, inst+27, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.6: %.13 = import_ref Main//a, inst+27, loaded [template = %.1] // CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+33, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+38, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+42, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+40, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+44, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -205,26 +211,26 @@ fn Run() { // CHECK:STDOUT: %Child.ref: type = name_ref Child, imports.%import_ref.2 [template = constants.%Child] // CHECK:STDOUT: %a.var: ref %Child = var a // CHECK:STDOUT: %a: ref %Child = bind_name a, %a.var -// CHECK:STDOUT: %.loc7_33: i32 = int_literal 0 [template = constants.%.8] -// CHECK:STDOUT: %.loc7_46: i32 = int_literal 1 [template = constants.%.9] +// CHECK:STDOUT: %.loc7_33: i32 = int_literal 0 [template = constants.%.10] +// CHECK:STDOUT: %.loc7_46: i32 = int_literal 1 [template = constants.%.11] // CHECK:STDOUT: %.loc7_47.1: %.2 = struct_literal (%.loc7_33, %.loc7_46) -// CHECK:STDOUT: %.loc7_48.1: %.10 = struct_literal (%.loc7_47.1) +// CHECK:STDOUT: %.loc7_48.1: %.12 = struct_literal (%.loc7_47.1) // CHECK:STDOUT: %.loc7_48.2: ref %Base = class_element_access %a.var, element0 // CHECK:STDOUT: %.loc7_47.2: ref i32 = class_element_access %.loc7_48.2, element0 -// CHECK:STDOUT: %.loc7_47.3: init i32 = initialize_from %.loc7_33 to %.loc7_47.2 [template = constants.%.8] +// CHECK:STDOUT: %.loc7_47.3: init i32 = initialize_from %.loc7_33 to %.loc7_47.2 [template = constants.%.10] // CHECK:STDOUT: %.loc7_47.4: ref i32 = class_element_access %.loc7_48.2, element1 -// CHECK:STDOUT: %.loc7_47.5: init i32 = initialize_from %.loc7_46 to %.loc7_47.4 [template = constants.%.9] +// CHECK:STDOUT: %.loc7_47.5: init i32 = initialize_from %.loc7_46 to %.loc7_47.4 [template = constants.%.11] // CHECK:STDOUT: %.loc7_47.6: init %Base = class_init (%.loc7_47.3, %.loc7_47.5), %.loc7_48.2 [template = constants.%struct.1] // CHECK:STDOUT: %.loc7_48.3: init %Base = converted %.loc7_47.1, %.loc7_47.6 [template = constants.%struct.1] // CHECK:STDOUT: %.loc7_48.4: init %Child = class_init (%.loc7_48.3), %a.var [template = constants.%struct.2] // CHECK:STDOUT: %.loc7_49: init %Child = converted %.loc7_48.1, %.loc7_48.4 [template = constants.%struct.2] // CHECK:STDOUT: assign %a.var, %.loc7_49 // CHECK:STDOUT: %a.ref.loc8: ref %Child = name_ref a, %a -// CHECK:STDOUT: %x.ref: %.11 = name_ref x, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.13 = name_ref x, imports.%import_ref.6 [template = imports.%.1] // CHECK:STDOUT: %.loc8_4.1: ref %Base = class_element_access %a.ref.loc8, element0 // CHECK:STDOUT: %.loc8_4.2: ref %Base = converted %a.ref.loc8, %.loc8_4.1 // CHECK:STDOUT: %.loc8_4.3: ref i32 = class_element_access %.loc8_4.2, element0 -// CHECK:STDOUT: %.loc8_9: i32 = int_literal 2 [template = constants.%.12] +// CHECK:STDOUT: %.loc8_9: i32 = int_literal 2 [template = constants.%.14] // CHECK:STDOUT: assign %.loc8_4.3, %.loc8_9 // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] diff --git a/toolchain/check/testdata/class/import_forward_decl.carbon b/toolchain/check/testdata/class/import_forward_decl.carbon index 68905fe37abe1..d6ba82284d1e8 100644 --- a/toolchain/check/testdata/class/import_forward_decl.carbon +++ b/toolchain/check/testdata/class/import_forward_decl.carbon @@ -56,6 +56,7 @@ class ForwardDecl { // CHECK:STDOUT: constants { // CHECK:STDOUT: %ForwardDecl: type = class_type @ForwardDecl [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -84,6 +85,8 @@ class ForwardDecl { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDecl { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%ForwardDecl // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index 914f18953639a..c610ae1bec26a 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -105,6 +105,7 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -130,6 +131,8 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -139,10 +142,11 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %C [template] +// CHECK:STDOUT: %.5: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -176,9 +180,9 @@ var ptr: E* = &val; // CHECK:STDOUT: %b_val.var: ref %C = var b_val // CHECK:STDOUT: %b_val: ref %C = bind_name b_val, %b_val.var // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] -// CHECK:STDOUT: %.loc9: type = ptr_type %C [template = constants.%.4] -// CHECK:STDOUT: %b_ptr.var: ref %.4 = var b_ptr -// CHECK:STDOUT: %b_ptr: ref %.4 = bind_name b_ptr, %b_ptr.var +// CHECK:STDOUT: %.loc9: type = ptr_type %C [template = constants.%.5] +// CHECK:STDOUT: %b_ptr.var: ref %.5 = var b_ptr +// CHECK:STDOUT: %b_ptr: ref %.5 = bind_name b_ptr, %b_ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -193,7 +197,7 @@ var ptr: E* = &val; // CHECK:STDOUT: %.loc8_18: init %C = converted %.loc8_17.1, %.loc8_17.2 [template = constants.%struct] // CHECK:STDOUT: assign file.%b_val.var, %.loc8_18 // CHECK:STDOUT: %b_val.ref: ref %C = name_ref b_val, file.%b_val -// CHECK:STDOUT: %.loc9: %.4 = addr_of %b_val.ref +// CHECK:STDOUT: %.loc9: %.5 = addr_of %b_val.ref // CHECK:STDOUT: assign file.%b_ptr.var, %.loc9 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -203,10 +207,11 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %C [template] +// CHECK:STDOUT: %.5: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -240,9 +245,9 @@ var ptr: E* = &val; // CHECK:STDOUT: %c_val.var: ref %C = var c_val // CHECK:STDOUT: %c_val: ref %C = bind_name c_val, %c_val.var // CHECK:STDOUT: %E.ref: type = name_ref E, %E [template = constants.%C] -// CHECK:STDOUT: %.loc9: type = ptr_type %C [template = constants.%.4] -// CHECK:STDOUT: %c_ptr.var: ref %.4 = var c_ptr -// CHECK:STDOUT: %c_ptr: ref %.4 = bind_name c_ptr, %c_ptr.var +// CHECK:STDOUT: %.loc9: type = ptr_type %C [template = constants.%.5] +// CHECK:STDOUT: %c_ptr.var: ref %.5 = var c_ptr +// CHECK:STDOUT: %c_ptr: ref %.5 = bind_name c_ptr, %c_ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -257,7 +262,7 @@ var ptr: E* = &val; // CHECK:STDOUT: %.loc8_18: init %C = converted %.loc8_17.1, %.loc8_17.2 [template = constants.%struct] // CHECK:STDOUT: assign file.%c_val.var, %.loc8_18 // CHECK:STDOUT: %c_val.ref: ref %C = name_ref c_val, file.%c_val -// CHECK:STDOUT: %.loc9: %.4 = addr_of %c_val.ref +// CHECK:STDOUT: %.loc9: %.5 = addr_of %c_val.ref // CHECK:STDOUT: assign file.%c_ptr.var, %.loc9 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -267,17 +272,18 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %C [template] +// CHECK:STDOUT: %.5: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//b, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+15, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//b, inst+25, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//b, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+16, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//b, inst+26, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -307,9 +313,9 @@ var ptr: E* = &val; // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] -// CHECK:STDOUT: %ptr.var: ref %.4 = var ptr -// CHECK:STDOUT: %ptr: ref %.4 = bind_name ptr, %ptr.var +// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.5] +// CHECK:STDOUT: %ptr.var: ref %.5 = var ptr +// CHECK:STDOUT: %ptr: ref %.5 = bind_name ptr, %ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -324,7 +330,7 @@ var ptr: E* = &val; // CHECK:STDOUT: %.loc7_16: init %C = converted %.loc7_15.1, %.loc7_15.2 [template = constants.%struct] // CHECK:STDOUT: assign file.%val.var, %.loc7_16 // CHECK:STDOUT: %val.ref: ref %C = name_ref val, file.%val -// CHECK:STDOUT: %.loc8: %.4 = addr_of %val.ref +// CHECK:STDOUT: %.loc8: %.5 = addr_of %val.ref // CHECK:STDOUT: assign file.%ptr.var, %.loc8 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -334,16 +340,17 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %C [template] +// CHECK:STDOUT: %.5: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+15, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+25, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+16, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+26, unloaded // CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude @@ -374,9 +381,9 @@ var ptr: E* = &val; // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] -// CHECK:STDOUT: %ptr.var: ref %.4 = var ptr -// CHECK:STDOUT: %ptr: ref %.4 = bind_name ptr, %ptr.var +// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.5] +// CHECK:STDOUT: %ptr.var: ref %.5 = var ptr +// CHECK:STDOUT: %ptr: ref %.5 = bind_name ptr, %ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -391,7 +398,7 @@ var ptr: E* = &val; // CHECK:STDOUT: %.loc7_16: init %C = converted %.loc7_15.1, %.loc7_15.2 [template = constants.%struct] // CHECK:STDOUT: assign file.%val.var, %.loc7_16 // CHECK:STDOUT: %val.ref: ref %C = name_ref val, file.%val -// CHECK:STDOUT: %.loc8: %.4 = addr_of %val.ref +// CHECK:STDOUT: %.loc8: %.5 = addr_of %val.ref // CHECK:STDOUT: assign file.%ptr.var, %.loc8 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -401,19 +408,20 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %C [template] +// CHECK:STDOUT: %.5: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+15, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+25, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//c, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//c, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//c, inst+25, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+16, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+26, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//c, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//c, inst+16, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//c, inst+26, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -424,7 +432,7 @@ var ptr: E* = &val; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7 = import_ref Main//b, inst+8, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//b, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -445,9 +453,9 @@ var ptr: E* = &val; // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var // CHECK:STDOUT: %E.ref: type = name_ref E, imports.%import_ref.4 [template = constants.%C] -// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] -// CHECK:STDOUT: %ptr.var: ref %.4 = var ptr -// CHECK:STDOUT: %ptr: ref %.4 = bind_name ptr, %ptr.var +// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.5] +// CHECK:STDOUT: %ptr.var: ref %.5 = var ptr +// CHECK:STDOUT: %ptr: ref %.5 = bind_name ptr, %ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -462,7 +470,7 @@ var ptr: E* = &val; // CHECK:STDOUT: %.loc7_16: init %C = converted %.loc7_15.1, %.loc7_15.2 [template = constants.%struct] // CHECK:STDOUT: assign file.%val.var, %.loc7_16 // CHECK:STDOUT: %val.ref: ref %C = name_ref val, file.%val -// CHECK:STDOUT: %.loc8: %.4 = addr_of %val.ref +// CHECK:STDOUT: %.loc8: %.5 = addr_of %val.ref // CHECK:STDOUT: assign file.%ptr.var, %.loc8 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -472,19 +480,20 @@ var ptr: E* = &val; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %C [template] +// CHECK:STDOUT: %.5: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+15, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+25, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//b, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//b, inst+25, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+16, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+26, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//b, inst+16, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//b, inst+26, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -495,7 +504,7 @@ var ptr: E* = &val; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7 = import_ref Main//b, inst+8, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//b, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -516,9 +525,9 @@ var ptr: E* = &val; // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var // CHECK:STDOUT: %E.ref: type = name_ref E, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] -// CHECK:STDOUT: %ptr.var: ref %.4 = var ptr -// CHECK:STDOUT: %ptr: ref %.4 = bind_name ptr, %ptr.var +// CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.5] +// CHECK:STDOUT: %ptr.var: ref %.5 = var ptr +// CHECK:STDOUT: %ptr: ref %.5 = bind_name ptr, %ptr.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -533,7 +542,7 @@ var ptr: E* = &val; // CHECK:STDOUT: %.loc7_16: init %C = converted %.loc7_15.1, %.loc7_15.2 [template = constants.%struct] // CHECK:STDOUT: assign file.%val.var, %.loc7_16 // CHECK:STDOUT: %val.ref: ref %C = name_ref val, file.%val -// CHECK:STDOUT: %.loc8: %.4 = addr_of %val.ref +// CHECK:STDOUT: %.loc8: %.5 = addr_of %val.ref // CHECK:STDOUT: assign file.%ptr.var, %.loc8 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index 381d513fc1661..d714a010b2cb7 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -33,6 +33,7 @@ fn Run() { // CHECK:STDOUT: %.1: type = ptr_type %Cycle [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Cycle, %.1 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: %.1} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -61,6 +62,7 @@ fn Run() { // CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%Cycle.decl [template = constants.%Cycle] // CHECK:STDOUT: %.loc5_15: type = ptr_type %Cycle [template = constants.%.1] // CHECK:STDOUT: %.loc5_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Cycle @@ -76,6 +78,7 @@ fn Run() { // CHECK:STDOUT: %Cycle: type = class_type @Cycle [template] // CHECK:STDOUT: %.2: type = ptr_type %Cycle [template] // CHECK:STDOUT: %.3: type = struct_type {.a: %.2} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index db2e2ee6c67e0..faeebd04b3252 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -39,6 +39,7 @@ fn Run() { // CHECK:STDOUT: %.2: type = struct_type {.b: %.1} [template] // CHECK:STDOUT: %.3: type = unbound_element_type %Cycle, %.2 [template] // CHECK:STDOUT: %.4: type = struct_type {.c: %.2} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,6 +76,7 @@ fn Run() { // CHECK:STDOUT: %.loc10_20: type = ptr_type %Cycle [template = constants.%.1] // CHECK:STDOUT: %.loc10_21: type = struct_type {.b: %.1} [template = constants.%.2] // CHECK:STDOUT: %.loc10_8: %.3 = field_decl c, element0 [template] +// CHECK:STDOUT: %.loc11: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Cycle @@ -91,8 +93,9 @@ fn Run() { // CHECK:STDOUT: %.2: type = ptr_type %Cycle [template] // CHECK:STDOUT: %.3: type = struct_type {.b: %.2} [template] // CHECK:STDOUT: %.4: type = struct_type {.c: %.3} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %Cycle, %.3 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %Cycle, %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -109,7 +112,7 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Main//a, inst+20, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.4: %.7 = import_ref Main//a, inst+20, loaded [template = %.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -138,7 +141,7 @@ fn Run() { // CHECK:STDOUT: %.loc7_12.1: ref %.2 = struct_access %a.ref.loc7_11, element0 // CHECK:STDOUT: %.loc7_12.2: %.2 = bind_value %.loc7_12.1 // CHECK:STDOUT: %.loc7_10: ref %Cycle = deref %.loc7_12.2 -// CHECK:STDOUT: %c.ref: %.6 = name_ref c, imports.%import_ref.4 [template = imports.%.1] +// CHECK:STDOUT: %c.ref: %.7 = name_ref c, imports.%import_ref.4 [template = imports.%.1] // CHECK:STDOUT: %.loc7_15: ref %.3 = class_element_access %.loc7_10, element0 // CHECK:STDOUT: %.loc7_17.1: ref %.2 = struct_access %.loc7_15, element0 // CHECK:STDOUT: %.loc7_17.2: %.2 = bind_value %.loc7_17.1 diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index fd40435d811db..0f209057f110c 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -235,17 +235,19 @@ class B { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Shape, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: i32, .y: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Circle: type = class_type @Circle [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Circle, %Shape [template] -// CHECK:STDOUT: %.6: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %.7: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Circle, %Shape [template] +// CHECK:STDOUT: %.7: type = tuple_type (type, type) [template] +// CHECK:STDOUT: %.8: type = tuple_type (i32, i32) [template] // CHECK:STDOUT: %GetPosition.type: type = fn_type @GetPosition [template] // CHECK:STDOUT: %GetPosition: %GetPosition.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = struct_type {.base: %Shape} [template] -// CHECK:STDOUT: %.9: type = ptr_type %.7 [template] -// CHECK:STDOUT: %.10: type = struct_type {.base: %.4} [template] +// CHECK:STDOUT: %.9: type = struct_type {.base: %Shape} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] // CHECK:STDOUT: %.11: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.12: type = struct_type {.base: %.5} [template] +// CHECK:STDOUT: %.13: type = ptr_type %.9 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -283,6 +285,7 @@ class B { // CHECK:STDOUT: %.loc6_20.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_20.2: type = converted %int.make_type_32.loc6, %.loc6_20.1 [template = i32] // CHECK:STDOUT: %.loc6_18: %.2 = field_decl y, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Shape @@ -292,21 +295,22 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Circle { // CHECK:STDOUT: %Shape.ref: type = name_ref Shape, file.%Shape.decl [template = constants.%Shape] -// CHECK:STDOUT: %.loc10: %.5 = base_decl %Shape, element0 [template] +// CHECK:STDOUT: %.loc10: %.6 = base_decl %Shape, element0 [template] // CHECK:STDOUT: %GetPosition.decl: %GetPosition.type = fn_decl @GetPosition [template = constants.%GetPosition] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Circle [template = constants.%Circle] // CHECK:STDOUT: %self.loc12_18.1: %Circle = param self, runtime_param0 // CHECK:STDOUT: %self.loc12_18.2: %Circle = bind_name self, %self.loc12_18.1 // CHECK:STDOUT: %int.make_type_32.loc12_36: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc12_41: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc12_44.1: %.6 = tuple_literal (%int.make_type_32.loc12_36, %int.make_type_32.loc12_41) +// CHECK:STDOUT: %.loc12_44.1: %.7 = tuple_literal (%int.make_type_32.loc12_36, %int.make_type_32.loc12_41) // CHECK:STDOUT: %.loc12_44.2: type = value_of_initializer %int.make_type_32.loc12_36 [template = i32] // CHECK:STDOUT: %.loc12_44.3: type = converted %int.make_type_32.loc12_36, %.loc12_44.2 [template = i32] // CHECK:STDOUT: %.loc12_44.4: type = value_of_initializer %int.make_type_32.loc12_41 [template = i32] // CHECK:STDOUT: %.loc12_44.5: type = converted %int.make_type_32.loc12_41, %.loc12_44.4 [template = i32] -// CHECK:STDOUT: %.loc12_44.6: type = converted %.loc12_44.1, constants.%.7 [template = constants.%.7] -// CHECK:STDOUT: %return.var: ref %.7 = var +// CHECK:STDOUT: %.loc12_44.6: type = converted %.loc12_44.1, constants.%.8 [template = constants.%.8] +// CHECK:STDOUT: %return.var: ref %.8 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc15: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Circle @@ -317,7 +321,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GetPosition[@Circle.%self.loc12_18.2: %Circle]() -> @Circle.%return.var: %.7 { +// CHECK:STDOUT: fn @GetPosition[@Circle.%self.loc12_18.2: %Circle]() -> @Circle.%return.var: %.8 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref.loc13_13: %Circle = name_ref self, @Circle.%self.loc12_18.2 // CHECK:STDOUT: %x.ref: %.2 = name_ref x, @Shape.%.loc5_18 [template = @Shape.%.loc5_18] @@ -329,15 +333,15 @@ class B { // CHECK:STDOUT: %.loc13_25.1: ref %Shape = class_element_access %self.ref.loc13_21, element0 // CHECK:STDOUT: %.loc13_25.2: ref %Shape = converted %self.ref.loc13_21, %.loc13_25.1 // CHECK:STDOUT: %.loc13_25.3: ref i32 = class_element_access %.loc13_25.2, element1 -// CHECK:STDOUT: %.loc13_27.1: %.7 = tuple_literal (%.loc13_17.3, %.loc13_25.3) +// CHECK:STDOUT: %.loc13_27.1: %.8 = tuple_literal (%.loc13_17.3, %.loc13_25.3) // CHECK:STDOUT: %.loc13_17.4: i32 = bind_value %.loc13_17.3 // CHECK:STDOUT: %.loc13_27.2: ref i32 = tuple_access @Circle.%return.var, element0 // CHECK:STDOUT: %.loc13_27.3: init i32 = initialize_from %.loc13_17.4 to %.loc13_27.2 // CHECK:STDOUT: %.loc13_25.4: i32 = bind_value %.loc13_25.3 // CHECK:STDOUT: %.loc13_27.4: ref i32 = tuple_access @Circle.%return.var, element1 // CHECK:STDOUT: %.loc13_27.5: init i32 = initialize_from %.loc13_25.4 to %.loc13_27.4 -// CHECK:STDOUT: %.loc13_27.6: init %.7 = tuple_init (%.loc13_27.3, %.loc13_27.5) to @Circle.%return.var -// CHECK:STDOUT: %.loc13_28: init %.7 = converted %.loc13_27.1, %.loc13_27.6 +// CHECK:STDOUT: %.loc13_27.6: init %.8 = tuple_init (%.loc13_27.3, %.loc13_27.5) to @Circle.%return.var +// CHECK:STDOUT: %.loc13_28: init %.8 = converted %.loc13_27.1, %.loc13_27.6 // CHECK:STDOUT: return %.loc13_28 to @Circle.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: @@ -349,23 +353,26 @@ class B { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %.3} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] -// CHECK:STDOUT: %.8: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %.4} [template] +// CHECK:STDOUT: %.9: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.10: type = unbound_element_type %C, %B [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = struct_type {.base: %B} [template] -// CHECK:STDOUT: %.10: type = struct_type {.base: %.7} [template] -// CHECK:STDOUT: %.11: type = ptr_type %.9 [template] +// CHECK:STDOUT: %.11: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.12: = complete_type_witness %.11 [template] +// CHECK:STDOUT: %.13: type = struct_type {.base: %.9} [template] +// CHECK:STDOUT: %.14: type = ptr_type %.11 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -399,6 +406,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -407,13 +415,14 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc9: %.4 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc9: %.5 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_21.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc10_21.2: type = converted %int.make_type_32, %.loc10_21.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc11: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -424,7 +433,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc14: %.8 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc14: %.10 = base_decl %B, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %self.loc15_8.1: %C = param self, runtime_param0 @@ -433,6 +442,7 @@ class B { // CHECK:STDOUT: %.loc15_26.2: type = converted %.loc15_26.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return.var: ref %.1 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc16: = complete_type_witness %.11 [template = constants.%.12] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -470,14 +480,16 @@ class B { // CHECK:STDOUT: %SomeProtectedFunction.type: type = fn_type @SomeProtectedFunction [template] // CHECK:STDOUT: %SomeProtectedFunction: %SomeProtectedFunction.type = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -518,6 +530,7 @@ class B { // CHECK:STDOUT: %.loc6_43.2: type = converted %int.make_type_32.loc6, %.loc6_43.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc9: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -527,7 +540,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc12: %.5 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc12: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] @@ -540,6 +553,7 @@ class B { // CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_32.loc18, %.loc18_13.1 [template = i32] // CHECK:STDOUT: %return.var.loc18: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc21: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -583,14 +597,16 @@ class B { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Shape, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.y: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Square: type = class_type @Square [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Square, %Shape [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Square, %Shape [template] // CHECK:STDOUT: %GetPosition.type: type = fn_type @GetPosition [template] // CHECK:STDOUT: %GetPosition: %GetPosition.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %Shape} [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %.4} [template] -// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %Shape} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.9: type = struct_type {.base: %.5} [template] +// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -624,6 +640,7 @@ class B { // CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_32, %.loc5_18.1 [template = i32] // CHECK:STDOUT: %.loc5_16: %.2 = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Shape @@ -632,7 +649,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @Square { // CHECK:STDOUT: %Shape.ref: type = name_ref Shape, file.%Shape.decl [template = constants.%Shape] -// CHECK:STDOUT: %.loc9: %.5 = base_decl %Shape, element0 [template] +// CHECK:STDOUT: %.loc9: %.6 = base_decl %Shape, element0 [template] // CHECK:STDOUT: %GetPosition.decl: %GetPosition.type = fn_decl @GetPosition [template = constants.%GetPosition] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Square [template = constants.%Square] // CHECK:STDOUT: %self.loc11_18.1: %Square = param self, runtime_param0 @@ -642,6 +659,7 @@ class B { // CHECK:STDOUT: %.loc11_35.2: type = converted %int.make_type_32, %.loc11_35.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc21: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Square @@ -669,7 +687,8 @@ class B { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -697,6 +716,7 @@ class B { // CHECK:STDOUT: class @C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -727,7 +747,8 @@ class B { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -755,6 +776,7 @@ class B { // CHECK:STDOUT: class @C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -783,14 +805,16 @@ class B { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %C, %B [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %B} [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %.3} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %.4} [template] +// CHECK:STDOUT: %.9: type = ptr_type %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -819,6 +843,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -827,8 +852,9 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc9: %.4 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc9: %.5 = base_decl %B, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %.loc18: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -857,14 +883,16 @@ class B { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %C, %B [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %C, %B [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = struct_type {.base: %B} [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %.3} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.6: type = struct_type {.base: %B} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %.4} [template] +// CHECK:STDOUT: %.9: type = ptr_type %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -893,6 +921,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -901,8 +930,9 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc9: %.4 = base_decl %B, element0 [template] +// CHECK:STDOUT: %.loc9: %.5 = base_decl %B, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %.loc11: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -933,17 +963,19 @@ class B { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: i32 = int_literal 5 [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Internal: type = class_type @Internal [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %Internal [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %Internal [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %SomeFunc.type: type = fn_type @SomeFunc [template] // CHECK:STDOUT: %SomeFunc: %SomeFunc.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.internal: %Internal} [template] -// CHECK:STDOUT: %.7: type = struct_type {.internal: %.4} [template] -// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.7: type = struct_type {.internal: %Internal} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.9: type = struct_type {.internal: %.5} [template] +// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -985,6 +1017,7 @@ class B { // CHECK:STDOUT: %.loc6_38.2: type = converted %int.make_type_32.loc6, %.loc6_38.1 [template = i32] // CHECK:STDOUT: %.loc6_44: i32 = int_literal 5 [template = constants.%.2] // CHECK:STDOUT: %SOME_PRIVATE_CONSTANT: i32 = bind_name SOME_PRIVATE_CONSTANT, %.loc6_44 +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -998,6 +1031,7 @@ class B { // CHECK:STDOUT: %.loc10_36.2: type = converted %int.make_type_32, %.loc10_36.1 [template = i32] // CHECK:STDOUT: %.loc10_42: i32 = int_literal 5 [template = constants.%.2] // CHECK:STDOUT: %INTERNAL_CONSTANT: i32 = bind_name INTERNAL_CONSTANT, %.loc10_42 +// CHECK:STDOUT: %.loc11: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Internal @@ -1006,7 +1040,7 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %Internal.ref: type = name_ref Internal, file.%Internal.decl [template = constants.%Internal] -// CHECK:STDOUT: %.loc14: %.5 = field_decl internal, element0 [template] +// CHECK:STDOUT: %.loc14: %.6 = field_decl internal, element0 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] @@ -1022,6 +1056,7 @@ class B { // CHECK:STDOUT: %.loc36_32.2: type = converted %int.make_type_32.loc36, %.loc36_32.1 [template = i32] // CHECK:STDOUT: %return.var.loc36: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc46: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -1044,7 +1079,7 @@ class B { // CHECK:STDOUT: fn @SomeFunc[@B.%self.loc36_15.2: %B]() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %self.ref: %B = name_ref self, @B.%self.loc36_15.2 -// CHECK:STDOUT: %internal.ref: %.5 = name_ref internal, @B.%.loc14 [template = @B.%.loc14] +// CHECK:STDOUT: %internal.ref: %.6 = name_ref internal, @B.%.loc14 [template = @B.%.loc14] // CHECK:STDOUT: %.loc44_16.1: ref %Internal = class_element_access %self.ref, element0 // CHECK:STDOUT: %.loc44_16.2: %Internal = bind_value %.loc44_16.1 // CHECK:STDOUT: %INTERNAL_CONSTANT.ref: = name_ref INTERNAL_CONSTANT, [template = ] @@ -1060,14 +1095,16 @@ class B { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %A, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %.4} [template] -// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.9: type = struct_type {.base: %.5} [template] +// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1101,6 +1138,7 @@ class B { // CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_32, %.loc5_18.1 [template = i32] // CHECK:STDOUT: %.loc5_16: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -1109,12 +1147,13 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc9: %.5 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc9: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %self.loc10_8.1: %B = param self, runtime_param0 // CHECK:STDOUT: %self.loc10_8.2: %B = bind_name self, %self.loc10_8.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -1142,14 +1181,16 @@ class B { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %A, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %B, %A [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %B, %A [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = struct_type {.base: %A} [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %.4} [template] -// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.7: type = struct_type {.base: %A} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] +// CHECK:STDOUT: %.9: type = struct_type {.base: %.5} [template] +// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1183,6 +1224,7 @@ class B { // CHECK:STDOUT: %.loc5_20.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc5_20.2: type = converted %int.make_type_32, %.loc5_20.1 [template = i32] // CHECK:STDOUT: %.loc5_18: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -1191,12 +1233,13 @@ class B { // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc9: %.5 = base_decl %A, element0 [template] +// CHECK:STDOUT: %.loc9: %.6 = base_decl %A, element0 [template] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [template = constants.%B] // CHECK:STDOUT: %self.loc11_8.1: %B = param self, runtime_param0 // CHECK:STDOUT: %self.loc11_8.2: %B = bind_name self, %self.loc11_8.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc14: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index c953b3a5b3ecd..72352c312a46f 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -32,12 +32,13 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %.3: type = ptr_type %Class [template] // CHECK:STDOUT: %.4: type = unbound_element_type %Class, %.3 [template] // CHECK:STDOUT: %.5: type = struct_type {.n: i32, .next: %.3} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %Make.type: type = fn_type @Make [template] // CHECK:STDOUT: %Make: %Make.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %MakeReorder.type: type = fn_type @MakeReorder [template] // CHECK:STDOUT: %MakeReorder: %MakeReorder.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = struct_type {.next: %.3, .n: i32} [template] +// CHECK:STDOUT: %.8: type = struct_type {.next: %.3, .n: i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -100,6 +101,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc13_18: type = ptr_type %Class [template = constants.%.3] // CHECK:STDOUT: %.loc13_11: %.4 = field_decl next, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -127,7 +129,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %next.ref: %.3 = name_ref next, %next // CHECK:STDOUT: %n.ref: i32 = name_ref n, %n -// CHECK:STDOUT: %.loc21_31.1: %.7 = struct_literal (%next.ref, %n.ref) +// CHECK:STDOUT: %.loc21_31.1: %.8 = struct_literal (%next.ref, %n.ref) // CHECK:STDOUT: %.loc21_31.2: ref i32 = class_element_access %return, element1 // CHECK:STDOUT: %.loc21_31.3: init i32 = initialize_from %n.ref to %.loc21_31.2 // CHECK:STDOUT: %.loc21_31.4: ref %.3 = class_element_access %return, element0 diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index d42d8ae61e34c..6057f0f4fed71 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -100,11 +100,13 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %AdaptC: type = class_type @AdaptC [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] -// CHECK:STDOUT: %struct: %C = struct_value (%.5, %.6) [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: = complete_type_witness %C [template] +// CHECK:STDOUT: %.7: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] +// CHECK:STDOUT: %struct: %C = struct_value (%.7, %.8) [template] // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [template] // CHECK:STDOUT: %MakeC: %MakeC.type = struct_value () [template] // CHECK:STDOUT: %MakeAdaptC.type: type = fn_type @MakeAdaptC [template] @@ -170,6 +172,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] // CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -180,6 +183,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: class @AdaptC { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: adapt_decl %C +// CHECK:STDOUT: %.loc11: = complete_type_witness %C [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptC @@ -193,14 +197,14 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_18: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc13_26: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_18: i32 = int_literal 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_26: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: %.loc13_27.1: %.3 = struct_literal (%.loc13_18, %.loc13_26) // CHECK:STDOUT: %.loc13_27.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.3: ref i32 = class_element_access %.loc13_27.2, element0 -// CHECK:STDOUT: %.loc13_27.4: init i32 = initialize_from %.loc13_18 to %.loc13_27.3 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_27.4: init i32 = initialize_from %.loc13_18 to %.loc13_27.3 [template = constants.%.7] // CHECK:STDOUT: %.loc13_27.5: ref i32 = class_element_access %.loc13_27.2, element1 -// CHECK:STDOUT: %.loc13_27.6: init i32 = initialize_from %.loc13_26 to %.loc13_27.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_27.6: init i32 = initialize_from %.loc13_26 to %.loc13_27.5 [template = constants.%.8] // CHECK:STDOUT: %.loc13_27.7: init %C = class_init (%.loc13_27.4, %.loc13_27.6), %.loc13_27.2 [template = constants.%struct] // CHECK:STDOUT: %.loc13_27.8: ref %C = temporary %.loc13_27.2, %.loc13_27.7 // CHECK:STDOUT: %.loc13_28.1: ref %C = converted %.loc13_27.1, %.loc13_27.8 @@ -242,32 +246,34 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %AdaptC: type = class_type @AdaptC [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] -// CHECK:STDOUT: %struct: %C = struct_value (%.5, %.6) [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: = complete_type_witness %C [template] +// CHECK:STDOUT: %.7: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] +// CHECK:STDOUT: %struct: %C = struct_value (%.7, %.8) [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.7: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.7) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.9: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.9) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.9 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.10: type = interface_type @ImplicitAs, @ImplicitAs(%AdaptC) [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.12: type = interface_type @ImplicitAs, @ImplicitAs(%AdaptC) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%AdaptC) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %Convert.type.2 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.13: %.8 = assoc_entity element0, imports.%import_ref.7 [symbolic] -// CHECK:STDOUT: %.14: type = interface_type @ImplicitAs, @ImplicitAs(%C) [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.12, %Convert.type.2 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.15: %.10 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.16: type = interface_type @ImplicitAs, @ImplicitAs(%C) [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert, @ImplicitAs(%C) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %.14, %Convert.type.3 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %.16, %Convert.type.3 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [template] // CHECK:STDOUT: %MakeC: %MakeC.type = struct_value () [template] // CHECK:STDOUT: %MakeAdaptC.type: type = fn_type @MakeAdaptC [template] @@ -290,7 +296,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.8) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.13)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -335,12 +341,12 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.7), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.8)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.8) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.9)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.9), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.10) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -359,6 +365,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32] // CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -369,6 +376,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: class @AdaptC { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: adapt_decl %C +// CHECK:STDOUT: %.loc11: = complete_type_witness %C [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%AdaptC @@ -376,10 +384,10 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.7)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.9)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.7)] -// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -390,46 +398,46 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13_18: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc13_26: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_18: i32 = int_literal 1 [template = constants.%.7] +// CHECK:STDOUT: %.loc13_26: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: %.loc13_27.1: %.3 = struct_literal (%.loc13_18, %.loc13_26) // CHECK:STDOUT: %.loc13_27.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.3: ref i32 = class_element_access %.loc13_27.2, element0 -// CHECK:STDOUT: %.loc13_27.4: init i32 = initialize_from %.loc13_18 to %.loc13_27.3 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_27.4: init i32 = initialize_from %.loc13_18 to %.loc13_27.3 [template = constants.%.7] // CHECK:STDOUT: %.loc13_27.5: ref i32 = class_element_access %.loc13_27.2, element1 -// CHECK:STDOUT: %.loc13_27.6: init i32 = initialize_from %.loc13_26 to %.loc13_27.5 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_27.6: init i32 = initialize_from %.loc13_26 to %.loc13_27.5 [template = constants.%.8] // CHECK:STDOUT: %.loc13_27.7: init %C = class_init (%.loc13_27.4, %.loc13_27.6), %.loc13_27.2 [template = constants.%struct] // CHECK:STDOUT: %.loc13_27.8: ref %C = temporary %.loc13_27.2, %.loc13_27.7 // CHECK:STDOUT: %.loc13_28.1: ref %C = converted %.loc13_27.1, %.loc13_27.8 // CHECK:STDOUT: %.loc13_28.2: %C = bind_value %.loc13_28.1 // CHECK:STDOUT: %a: %C = bind_name a, %.loc13_28.2 // CHECK:STDOUT: %a.ref: %C = name_ref a, %a -// CHECK:STDOUT: %.loc24_18.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%AdaptC) [template = constants.%.10] -// CHECK:STDOUT: %.loc24_18.2: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%AdaptC) [template = constants.%.12] -// CHECK:STDOUT: %Convert.ref.loc24: %.11 = name_ref Convert, %.loc24_18.2 [template = constants.%.12] +// CHECK:STDOUT: %.loc24_18.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%AdaptC) [template = constants.%.12] +// CHECK:STDOUT: %.loc24_18.2: %.13 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%AdaptC) [template = constants.%.14] +// CHECK:STDOUT: %Convert.ref.loc24: %.13 = name_ref Convert, %.loc24_18.2 [template = constants.%.14] // CHECK:STDOUT: %.loc24_18.3: %AdaptC = converted %a.ref, [template = ] // CHECK:STDOUT: %b: %AdaptC = bind_name b, // CHECK:STDOUT: %b.ref: %AdaptC = name_ref b, %b -// CHECK:STDOUT: %.loc33_13.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.14] -// CHECK:STDOUT: %.loc33_13.2: %.15 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%C) [template = constants.%.16] -// CHECK:STDOUT: %Convert.ref.loc33: %.15 = name_ref Convert, %.loc33_13.2 [template = constants.%.16] +// CHECK:STDOUT: %.loc33_13.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.16] +// CHECK:STDOUT: %.loc33_13.2: %.17 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%C) [template = constants.%.18] +// CHECK:STDOUT: %Convert.ref.loc33: %.17 = name_ref Convert, %.loc33_13.2 [template = constants.%.18] // CHECK:STDOUT: %.loc33_13.3: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %c: %C = bind_name c, // CHECK:STDOUT: %MakeC.ref: %MakeC.type = name_ref MakeC, file.%MakeC.decl [template = constants.%MakeC] // CHECK:STDOUT: %.loc46_22.1: ref %C = temporary_storage // CHECK:STDOUT: %MakeC.call: init %C = call %MakeC.ref() to %.loc46_22.1 -// CHECK:STDOUT: %.loc46_24.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%AdaptC) [template = constants.%.10] -// CHECK:STDOUT: %.loc46_24.2: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%AdaptC) [template = constants.%.12] -// CHECK:STDOUT: %Convert.ref.loc46: %.11 = name_ref Convert, %.loc46_24.2 [template = constants.%.12] +// CHECK:STDOUT: %.loc46_24.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%AdaptC) [template = constants.%.12] +// CHECK:STDOUT: %.loc46_24.2: %.13 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%AdaptC) [template = constants.%.14] +// CHECK:STDOUT: %Convert.ref.loc46: %.13 = name_ref Convert, %.loc46_24.2 [template = constants.%.14] // CHECK:STDOUT: %.loc46_22.2: ref %C = temporary %.loc46_22.1, %MakeC.call // CHECK:STDOUT: %.loc46_24.3: %AdaptC = converted %MakeC.call, [template = ] // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: %MakeAdaptC.ref: %MakeAdaptC.type = name_ref MakeAdaptC, file.%MakeAdaptC.decl [template = constants.%MakeAdaptC] // CHECK:STDOUT: %.loc54_22.1: ref %AdaptC = temporary_storage // CHECK:STDOUT: %MakeAdaptC.call: init %AdaptC = call %MakeAdaptC.ref() to %.loc54_22.1 -// CHECK:STDOUT: %.loc54_24.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.14] -// CHECK:STDOUT: %.loc54_24.2: %.15 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%C) [template = constants.%.16] -// CHECK:STDOUT: %Convert.ref.loc54: %.15 = name_ref Convert, %.loc54_24.2 [template = constants.%.16] +// CHECK:STDOUT: %.loc54_24.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.16] +// CHECK:STDOUT: %.loc54_24.2: %.17 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%C) [template = constants.%.18] +// CHECK:STDOUT: %Convert.ref.loc54: %.17 = name_ref Convert, %.loc54_24.2 [template = constants.%.18] // CHECK:STDOUT: %.loc54_22.2: ref %AdaptC = temporary %.loc54_22.1, %MakeAdaptC.call // CHECK:STDOUT: %.loc54_24.3: %C = converted %MakeAdaptC.call, [template = ] // CHECK:STDOUT: assign file.%e.var, @@ -450,7 +458,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -458,23 +466,23 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Dest => constants.%AdaptC // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.11 -// CHECK:STDOUT: %.3 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.13 +// CHECK:STDOUT: %.3 => constants.%.14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%C) { // CHECK:STDOUT: %Dest => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.14 +// CHECK:STDOUT: %.1 => constants.%.16 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 // CHECK:STDOUT: %Convert => constants.%Convert.3 -// CHECK:STDOUT: %.2 => constants.%.15 -// CHECK:STDOUT: %.3 => constants.%.16 +// CHECK:STDOUT: %.2 => constants.%.17 +// CHECK:STDOUT: %.3 => constants.%.18 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index c39ac5daa9fcd..bd8dad4c8c9b1 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -26,12 +26,13 @@ fn F() -> i32 { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.6: type = ptr_type %.3 [template] -// CHECK:STDOUT: %struct: %Class = struct_value (%.4, %.5) [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.3 [template] +// CHECK:STDOUT: %struct: %Class = struct_value (%.5, %.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -74,6 +75,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -85,15 +87,15 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_17: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc17_25: i32 = int_literal 2 [template = constants.%.5] +// CHECK:STDOUT: %.loc17_17: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc17_25: i32 = int_literal 2 [template = constants.%.6] // CHECK:STDOUT: %.loc17_26.1: %.3 = struct_literal (%.loc17_17, %.loc17_25) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc17_26.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc17_26.3: ref i32 = class_element_access %.loc17_26.2, element0 -// CHECK:STDOUT: %.loc17_26.4: init i32 = initialize_from %.loc17_17 to %.loc17_26.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc17_26.4: init i32 = initialize_from %.loc17_17 to %.loc17_26.3 [template = constants.%.5] // CHECK:STDOUT: %.loc17_26.5: ref i32 = class_element_access %.loc17_26.2, element1 -// CHECK:STDOUT: %.loc17_26.6: init i32 = initialize_from %.loc17_25 to %.loc17_26.5 [template = constants.%.5] +// CHECK:STDOUT: %.loc17_26.6: init i32 = initialize_from %.loc17_25 to %.loc17_26.5 [template = constants.%.6] // CHECK:STDOUT: %.loc17_26.7: init %Class = class_init (%.loc17_26.4, %.loc17_26.6), %.loc17_26.2 [template = constants.%struct] // CHECK:STDOUT: %.loc17_26.8: ref %Class = temporary %.loc17_26.2, %.loc17_26.7 // CHECK:STDOUT: %.loc17_28: ref %Class = converted %.loc17_26.1, %.loc17_26.8 diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index 8f182238657a2..5ae8cf37f317a 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -33,17 +33,19 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Inner, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %MakeInner.type: type = fn_type @MakeInner [template] // CHECK:STDOUT: %MakeInner: %MakeInner.type = struct_value () [template] // CHECK:STDOUT: %Outer: type = class_type @Outer [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Outer, %Inner [template] -// CHECK:STDOUT: %.6: type = struct_type {.c: %Inner, .d: %Inner} [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Outer, %Inner [template] +// CHECK:STDOUT: %.7: type = struct_type {.c: %Inner, .d: %Inner} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: %MakeOuter.type: type = fn_type @MakeOuter [template] // CHECK:STDOUT: %MakeOuter: %MakeOuter.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = struct_type {.c: %.4, .d: %.4} [template] -// CHECK:STDOUT: %.8: type = ptr_type %.7 [template] -// CHECK:STDOUT: %.9: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.9: type = struct_type {.c: %.5, .d: %.5} [template] +// CHECK:STDOUT: %.10: type = ptr_type %.9 [template] +// CHECK:STDOUT: %.11: type = ptr_type %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -91,6 +93,7 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner @@ -100,9 +103,10 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { // CHECK:STDOUT: %Inner.ref.loc19: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %.loc19: %.5 = field_decl c, element0 [template] +// CHECK:STDOUT: %.loc19: %.6 = field_decl c, element0 [template] // CHECK:STDOUT: %Inner.ref.loc20: type = name_ref Inner, file.%Inner.decl [template = constants.%Inner] -// CHECK:STDOUT: %.loc20: %.5 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc20: %.6 = field_decl d, element1 [template] +// CHECK:STDOUT: %.loc21: = complete_type_witness %.7 [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer @@ -122,7 +126,7 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: %MakeInner.ref.loc24_34: %MakeInner.type = name_ref MakeInner, file.%MakeInner.decl [template = constants.%MakeInner] // CHECK:STDOUT: %.loc24_45.2: ref %Inner = class_element_access %return, element1 // CHECK:STDOUT: %MakeInner.call.loc24_43: init %Inner = call %MakeInner.ref.loc24_34() to %.loc24_45.2 -// CHECK:STDOUT: %.loc24_45.3: %.6 = struct_literal (%MakeInner.call.loc24_25, %MakeInner.call.loc24_43) +// CHECK:STDOUT: %.loc24_45.3: %.7 = struct_literal (%MakeInner.call.loc24_25, %MakeInner.call.loc24_43) // CHECK:STDOUT: %.loc24_45.4: init %Outer = class_init (%MakeInner.call.loc24_25, %MakeInner.call.loc24_43), %return // CHECK:STDOUT: %.loc24_46: init %Outer = converted %.loc24_45.3, %.loc24_45.4 // CHECK:STDOUT: return %.loc24_46 to %return diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 89b01e88b6ee8..329936bfb253d 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -72,15 +72,16 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.3: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.4: type = struct_type {.k: i32} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.4 [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] // CHECK:STDOUT: %CallAlias.type: type = fn_type @CallAlias [template] // CHECK:STDOUT: %CallAlias: %CallAlias.type = struct_value () [template] // CHECK:STDOUT: %CallOnConstBoundMethod.type: type = fn_type @CallOnConstBoundMethod [template] // CHECK:STDOUT: %CallOnConstBoundMethod: %CallOnConstBoundMethod.type = struct_value () [template] -// CHECK:STDOUT: %.6: i32 = int_literal 1 [template] -// CHECK:STDOUT: %struct: %Class = struct_value (%.6) [template] +// CHECK:STDOUT: %.7: i32 = int_literal 1 [template] +// CHECK:STDOUT: %struct: %Class = struct_value (%.7) [template] // CHECK:STDOUT: %CallWithAddr.type: type = fn_type @CallWithAddr [template] // CHECK:STDOUT: %CallWithAddr: %CallWithAddr.type = struct_value () [template] // CHECK:STDOUT: %CallFThroughPointer.type: type = fn_type @CallFThroughPointer [template] @@ -230,6 +231,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc17_10.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_10.2: type = converted %int.make_type_32.loc17, %.loc17_10.1 [template = i32] // CHECK:STDOUT: %.loc17_8: %.3 = field_decl k, element0 [template] +// CHECK:STDOUT: %.loc18: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -276,12 +278,12 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @CallOnConstBoundMethod() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc35_17: i32 = int_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc35_17: i32 = int_literal 1 [template = constants.%.7] // CHECK:STDOUT: %.loc35_18.1: %.4 = struct_literal (%.loc35_17) // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc35_18.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc35_18.3: ref i32 = class_element_access %.loc35_18.2, element0 -// CHECK:STDOUT: %.loc35_18.4: init i32 = initialize_from %.loc35_17 to %.loc35_18.3 [template = constants.%.6] +// CHECK:STDOUT: %.loc35_18.4: init i32 = initialize_from %.loc35_17 to %.loc35_18.3 [template = constants.%.7] // CHECK:STDOUT: %.loc35_18.5: init %Class = class_init (%.loc35_18.4), %.loc35_18.2 [template = constants.%struct] // CHECK:STDOUT: %.loc35_18.6: ref %Class = temporary %.loc35_18.2, %.loc35_18.5 // CHECK:STDOUT: %.loc35_20.1: ref %Class = converted %.loc35_18.1, %.loc35_18.6 diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index 5d07c8698b1ce..aa8f11dbc9908 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -64,13 +64,15 @@ fn F(a: Outer*) { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.6: type = struct_type {.pi: %.2, .po: %.4, .qi: %.2} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %H.type: type = fn_type @H [template] // CHECK:STDOUT: %H: %H.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = unbound_element_type %Outer, %.4 [template] -// CHECK:STDOUT: %.8: type = unbound_element_type %Outer, %.2 [template] -// CHECK:STDOUT: %.9: type = struct_type {.po: %.4, .qo: %.4, .pi: %.2} [template] -// CHECK:STDOUT: %.10: type = ptr_type %.9 [template] -// CHECK:STDOUT: %.11: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %Outer, %.4 [template] +// CHECK:STDOUT: %.9: type = unbound_element_type %Outer, %.2 [template] +// CHECK:STDOUT: %.10: type = struct_type {.po: %.4, .qo: %.4, .pi: %.2} [template] +// CHECK:STDOUT: %.11: = complete_type_witness %.10 [template] +// CHECK:STDOUT: %.12: type = ptr_type %.10 [template] +// CHECK:STDOUT: %.13: type = ptr_type %.6 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: } @@ -110,13 +112,14 @@ fn F(a: Outer*) { // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Outer [template = constants.%Outer] // CHECK:STDOUT: %.loc36_15: type = ptr_type %Outer [template = constants.%.4] -// CHECK:STDOUT: %.loc36_9: %.7 = field_decl po, element0 [template] +// CHECK:STDOUT: %.loc36_9: %.8 = field_decl po, element0 [template] // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, file.%Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %.loc37_16: type = ptr_type %Outer [template = constants.%.4] -// CHECK:STDOUT: %.loc37_9: %.7 = field_decl qo, element1 [template] +// CHECK:STDOUT: %.loc37_9: %.8 = field_decl qo, element1 [template] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner.decl [template = constants.%Inner] // CHECK:STDOUT: %.loc38_16: type = ptr_type %Inner [template = constants.%.2] -// CHECK:STDOUT: %.loc38_9: %.8 = field_decl pi, element2 [template] +// CHECK:STDOUT: %.loc38_9: %.9 = field_decl pi, element2 [template] +// CHECK:STDOUT: %.loc39: = complete_type_witness %.10 [template = constants.%.11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer @@ -139,6 +142,7 @@ fn F(a: Outer*) { // CHECK:STDOUT: %.loc21_18: type = ptr_type %Inner [template = constants.%.2] // CHECK:STDOUT: %.loc21_11: %.3 = field_decl qi, element2 [template] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} +// CHECK:STDOUT: %.loc28: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner @@ -188,29 +192,29 @@ fn F(a: Outer*) { // CHECK:STDOUT: %.loc42_21: type = ptr_type %Inner [template = constants.%.2] // CHECK:STDOUT: %a.ref.loc42: %.4 = name_ref a, %a // CHECK:STDOUT: %.loc42_26: ref %Outer = deref %a.ref.loc42 -// CHECK:STDOUT: %pi.ref.loc42: %.8 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] +// CHECK:STDOUT: %pi.ref.loc42: %.9 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] // CHECK:STDOUT: %.loc42_29.1: ref %.2 = class_element_access %.loc42_26, element2 // CHECK:STDOUT: %.loc42_29.2: %.2 = bind_value %.loc42_29.1 // CHECK:STDOUT: %b: %.2 = bind_name b, %.loc42_29.2 // CHECK:STDOUT: %a.ref.loc44_3: %.4 = name_ref a, %a // CHECK:STDOUT: %.loc44_4.1: ref %Outer = deref %a.ref.loc44_3 -// CHECK:STDOUT: %po.ref.loc44: %.7 = name_ref po, @Outer.%.loc36_9 [template = @Outer.%.loc36_9] +// CHECK:STDOUT: %po.ref.loc44: %.8 = name_ref po, @Outer.%.loc36_9 [template = @Outer.%.loc36_9] // CHECK:STDOUT: %.loc44_4.2: ref %.4 = class_element_access %.loc44_4.1, element0 // CHECK:STDOUT: %a.ref.loc44_11: %.4 = name_ref a, %a // CHECK:STDOUT: assign %.loc44_4.2, %a.ref.loc44_11 // CHECK:STDOUT: %a.ref.loc45_3: %.4 = name_ref a, %a // CHECK:STDOUT: %.loc45_4.1: ref %Outer = deref %a.ref.loc45_3 -// CHECK:STDOUT: %qo.ref: %.7 = name_ref qo, @Outer.%.loc37_9 [template = @Outer.%.loc37_9] +// CHECK:STDOUT: %qo.ref: %.8 = name_ref qo, @Outer.%.loc37_9 [template = @Outer.%.loc37_9] // CHECK:STDOUT: %.loc45_4.2: ref %.4 = class_element_access %.loc45_4.1, element1 // CHECK:STDOUT: %a.ref.loc45_11: %.4 = name_ref a, %a // CHECK:STDOUT: assign %.loc45_4.2, %a.ref.loc45_11 // CHECK:STDOUT: %a.ref.loc46_3: %.4 = name_ref a, %a // CHECK:STDOUT: %.loc46_4.1: ref %Outer = deref %a.ref.loc46_3 -// CHECK:STDOUT: %pi.ref.loc46_4: %.8 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] +// CHECK:STDOUT: %pi.ref.loc46_4: %.9 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] // CHECK:STDOUT: %.loc46_4.2: ref %.2 = class_element_access %.loc46_4.1, element2 // CHECK:STDOUT: %a.ref.loc46_11: %.4 = name_ref a, %a // CHECK:STDOUT: %.loc46_12.1: ref %Outer = deref %a.ref.loc46_11 -// CHECK:STDOUT: %pi.ref.loc46_12: %.8 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] +// CHECK:STDOUT: %pi.ref.loc46_12: %.9 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] // CHECK:STDOUT: %.loc46_12.2: ref %.2 = class_element_access %.loc46_12.1, element2 // CHECK:STDOUT: %.loc46_12.3: %.2 = bind_value %.loc46_12.2 // CHECK:STDOUT: assign %.loc46_4.2, %.loc46_12.3 @@ -226,7 +230,7 @@ fn F(a: Outer*) { // CHECK:STDOUT: %.loc48_4.2: ref %.2 = class_element_access %.loc48_4.1, element0 // CHECK:STDOUT: %a.ref.loc48: %.4 = name_ref a, %a // CHECK:STDOUT: %.loc48_12.1: ref %Outer = deref %a.ref.loc48 -// CHECK:STDOUT: %pi.ref.loc48_12: %.8 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] +// CHECK:STDOUT: %pi.ref.loc48_12: %.9 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] // CHECK:STDOUT: %.loc48_12.2: ref %.2 = class_element_access %.loc48_12.1, element2 // CHECK:STDOUT: %.loc48_12.3: %.2 = bind_value %.loc48_12.2 // CHECK:STDOUT: assign %.loc48_4.2, %.loc48_12.3 @@ -236,7 +240,7 @@ fn F(a: Outer*) { // CHECK:STDOUT: %.loc49_4.2: ref %.2 = class_element_access %.loc49_4.1, element2 // CHECK:STDOUT: %a.ref.loc49: %.4 = name_ref a, %a // CHECK:STDOUT: %.loc49_12.1: ref %Outer = deref %a.ref.loc49 -// CHECK:STDOUT: %pi.ref.loc49: %.8 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] +// CHECK:STDOUT: %pi.ref.loc49: %.9 = name_ref pi, @Outer.%.loc38_9 [template = @Outer.%.loc38_9] // CHECK:STDOUT: %.loc49_12.2: ref %.2 = class_element_access %.loc49_12.1, element2 // CHECK:STDOUT: %.loc49_12.3: %.2 = bind_value %.loc49_12.2 // CHECK:STDOUT: assign %.loc49_4.2, %.loc49_12.3 diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 885938e7d528c..18f72393a5205 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -32,11 +32,13 @@ fn G(o: Outer) { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Inner, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.4: type = struct_type {} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.3 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } @@ -84,6 +86,7 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} +// CHECK:STDOUT: %.loc15: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Outer @@ -95,6 +98,7 @@ fn G(o: Outer) { // CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc13_12.2: type = converted %int.make_type_32, %.loc13_12.1 [template = i32] // CHECK:STDOUT: %.loc13_10: %.2 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Inner diff --git a/toolchain/check/testdata/class/no_prelude/export_name.carbon b/toolchain/check/testdata/class/no_prelude/export_name.carbon index b8ca11ae30763..d1ba2d4135429 100644 --- a/toolchain/check/testdata/class/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/class/no_prelude/export_name.carbon @@ -43,6 +43,7 @@ var c: C = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -53,6 +54,8 @@ var c: C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -62,6 +65,7 @@ var c: C = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -87,14 +91,15 @@ var c: C = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+6, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+8, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index 5421238e5c033..fcf09803fbb94 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -363,6 +363,7 @@ extern class C; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -373,6 +374,8 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -403,6 +406,7 @@ extern class C; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -413,6 +417,8 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -455,6 +461,7 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -466,6 +473,7 @@ extern class C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: %.loc10: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -479,6 +487,7 @@ extern class C; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -490,6 +499,8 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -626,6 +637,7 @@ extern class C; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -651,6 +663,7 @@ extern class C; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon index 60dce3ed76797..b0b7a288d719e 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -58,8 +58,9 @@ fn F(T:! type) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %NotGenericNoParams: type = class_type @NotGenericNoParams [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %NotGenericButParams.type: type = generic_class_type @NotGenericButParams [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %NotGenericButParams.1: %NotGenericButParams.type = struct_value () [template] // CHECK:STDOUT: %NotGenericButParams.2: type = class_type @NotGenericButParams [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] @@ -76,7 +77,7 @@ fn F(T:! type) { // CHECK:STDOUT: %GenericAndParams.3: %GenericAndParams.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %GenericAndParams.4: type = class_type @GenericAndParams.2, @GenericAndParams.2(%T, %U) [symbolic] // CHECK:STDOUT: %X: type = class_type @X [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct.1: %NotGenericNoParams = struct_value () [template] // CHECK:STDOUT: %struct.2: %NotGenericButParams.2 = struct_value () [template] // CHECK:STDOUT: %GenericAndParams.5: type = class_type @GenericAndParams.1, @GenericAndParams.1(%X) [template] @@ -143,11 +144,15 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NotGenericNoParams { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%NotGenericNoParams // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NotGenericButParams { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%NotGenericButParams.2 // CHECK:STDOUT: } @@ -158,6 +163,8 @@ fn F(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%GenericAndParams.2 // CHECK:STDOUT: } @@ -176,6 +183,7 @@ fn F(T:! type) { // CHECK:STDOUT: %U.loc10_26.1: type = param U, runtime_param // CHECK:STDOUT: %U.loc10_26.2: type = bind_symbolic_name U 1, %U.loc10_26.1 [symbolic = @GenericAndParams.2.%U (constants.%U)] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -188,6 +196,8 @@ fn F(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc9: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%GenericNoParams.2 // CHECK:STDOUT: } @@ -199,12 +209,16 @@ fn F(T:! type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc10: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%GenericAndParams.4 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { +// CHECK:STDOUT: %.loc13: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: } @@ -280,6 +294,7 @@ fn F(T:! type) { // CHECK:STDOUT: %A.1: %A.type = struct_value () [template] // CHECK:STDOUT: %A.2: type = class_type @A [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -293,6 +308,8 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc8: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.2 // CHECK:STDOUT: } @@ -305,6 +322,7 @@ fn F(T:! type) { // CHECK:STDOUT: %A.1: %A.type = struct_value () [template] // CHECK:STDOUT: %A.2: type = class_type @A [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -326,6 +344,8 @@ fn F(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc7: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index 77307c43beaaa..44c49dbf2332d 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -106,6 +106,7 @@ class B {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -122,6 +123,8 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -131,6 +134,7 @@ class B {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -141,6 +145,8 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -150,6 +156,7 @@ class B {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -176,6 +183,7 @@ class B {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -186,6 +194,8 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -195,7 +205,8 @@ class B {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = class_type @.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = class_type @.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -209,7 +220,7 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.2] {} +// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -218,8 +229,10 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { +// CHECK:STDOUT: %.loc14: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.2 +// CHECK:STDOUT: .Self = constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- def_alias.carbon @@ -246,6 +259,7 @@ class B {} // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = class_type @.1 [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -266,6 +280,8 @@ class B {} // CHECK:STDOUT: class @C; // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { +// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%.1 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index b432566e05058..3d6b864e31dc1 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -140,6 +140,7 @@ private class Redecl {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %Def: type = class_type @Def [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -150,6 +151,8 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Def { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Def // CHECK:STDOUT: } @@ -159,6 +162,7 @@ private class Redecl {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %ForwardWithDef: type = class_type @ForwardWithDef [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -170,6 +174,8 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardWithDef { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%ForwardWithDef // CHECK:STDOUT: } @@ -194,8 +200,9 @@ private class Redecl {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %Def: type = class_type @Def [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %Def = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -289,8 +296,9 @@ private class Redecl {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %ForwardWithDef: type = class_type @ForwardWithDef [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %ForwardWithDef = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -388,6 +396,7 @@ private class Redecl {} // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -411,6 +420,8 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Forward { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Forward // CHECK:STDOUT: } @@ -485,6 +496,7 @@ private class Redecl {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %Redecl: type = class_type @Redecl [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -496,6 +508,8 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Redecl { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Redecl // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon index af61a15e308da..c4d9c9ba1828c 100644 --- a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +++ b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon @@ -108,6 +108,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -119,6 +120,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: %.loc6: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -148,6 +150,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -173,7 +176,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: --- d.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//c, inst+8, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//c, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -189,12 +192,13 @@ var x: () = D.C.F(); // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+6, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+7, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -209,6 +213,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: class @D { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %C: type = bind_alias C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %.loc8: = complete_type_witness %.1 [template = constants.%.2] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -240,7 +245,8 @@ var x: () = D.C.F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -286,15 +292,16 @@ var x: () = D.C.F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+6, unloaded -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//c, inst+7, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+7, unloaded +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//c, inst+8, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -332,15 +339,16 @@ var x: () = D.C.F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+6, unloaded -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//c, inst+7, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+7, unloaded +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//c, inst+8, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -378,7 +386,8 @@ var x: () = D.C.F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -387,9 +396,9 @@ var x: () = D.C.F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//e, inst+3, loaded [template = constants.%D] // CHECK:STDOUT: %import_ref.2 = import_ref Main//e, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//e, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//e, inst+8, unloaded -// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//e, inst+9, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//e, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//e, inst+9, unloaded +// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//e, inst+10, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -434,7 +443,8 @@ var x: () = D.C.F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -443,9 +453,9 @@ var x: () = D.C.F(); // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//e, inst+3, loaded [template = constants.%D] // CHECK:STDOUT: %import_ref.2 = import_ref Main//e, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//e, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//e, inst+8, unloaded -// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//e, inst+9, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//e, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//e, inst+9, unloaded +// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//e, inst+10, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon index 0c80529c8859c..cb0c445c21dfa 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon @@ -91,6 +91,7 @@ class D; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -108,6 +109,8 @@ class D; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index a644a09c81671..43ab03d5e8210 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -184,9 +184,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [template] @@ -227,6 +228,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -237,6 +240,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc8: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Foo.2 // CHECK:STDOUT: } @@ -248,6 +253,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc11: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Bar.2 // CHECK:STDOUT: } @@ -266,9 +273,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: } @@ -292,6 +300,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -302,6 +312,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc7: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Foo.2 // CHECK:STDOUT: } @@ -316,14 +328,15 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = class_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = class_type @.1, @.1(%a) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -337,7 +350,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.loc6_11.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a 0, %a.loc6_11.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc14_11.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc14_11.2: %C = bind_symbolic_name a 0, %a.loc14_11.1 [symbolic = @.1.%a (constants.%a)] @@ -345,6 +358,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -361,8 +376,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc14: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.4 +// CHECK:STDOUT: .Self = constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -379,9 +396,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: } @@ -405,6 +423,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -415,6 +435,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc7: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Foo.2 // CHECK:STDOUT: } @@ -429,9 +451,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [template] @@ -462,6 +485,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -491,9 +516,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [template] @@ -503,9 +529,9 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+5, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+10, loaded [template = constants.%Foo.1] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+19, loaded [template = constants.%Bar.1] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+12, loaded [template = constants.%Foo.1] +// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+21, loaded [template = constants.%Bar.1] // CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -541,6 +567,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Foo.2 // CHECK:STDOUT: } @@ -552,6 +580,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Bar.2 // CHECK:STDOUT: } @@ -570,15 +600,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %b: %C = bind_symbolic_name b 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = class_type @.1, @.1(%b) [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = class_type @.1, @.1(%b) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -595,7 +626,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %b.loc15_11.1: %C = param b, runtime_param // CHECK:STDOUT: %b.loc15_11.2: %C = bind_symbolic_name b 0, %b.loc15_11.1 [symbolic = @.1.%b (constants.%b)] @@ -603,6 +634,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -619,8 +652,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.4 +// CHECK:STDOUT: .Self = constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -637,14 +672,15 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = class_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = class_type @.1, @.1(%a) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -661,7 +697,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %a.loc15_11.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc15_11.2: %C = bind_symbolic_name a 0, %a.loc15_11.1 [symbolic = @.1.%a (constants.%a)] @@ -669,6 +705,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -685,8 +723,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.4 +// CHECK:STDOUT: .Self = constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -703,14 +743,15 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = class_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = class_type @.1, @.1(%a) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -727,7 +768,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %a.loc7_11.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a 0, %a.loc7_11.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %a.loc15_11.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc15_11.2: %C = bind_symbolic_name a 0, %a.loc15_11.1 [symbolic = @.1.%a (constants.%a)] @@ -735,6 +776,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -751,8 +794,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.4 +// CHECK:STDOUT: .Self = constants.%.5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -769,9 +814,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: } @@ -790,6 +836,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -809,16 +857,17 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+8, loaded [template = constants.%Foo.1] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+10, loaded [template = constants.%Foo.1] // CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -850,6 +899,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Foo.2 // CHECK:STDOUT: } @@ -864,15 +915,16 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = const_type %C [template] -// CHECK:STDOUT: %a: %.2 = bind_symbolic_name a 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = const_type %C [template] +// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Foo.1: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Foo.2: type = class_type @Foo, @Foo(%a) [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.4: %.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = class_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %.5: %.type = struct_value () [template] +// CHECK:STDOUT: %.6: type = class_type @.1, @.1(%a) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -883,38 +935,42 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [template = constants.%Foo.1] { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.2] -// CHECK:STDOUT: %a.loc6_11.1: %.2 = param a, runtime_param -// CHECK:STDOUT: %a.loc6_11.2: %.2 = bind_symbolic_name a 0, %a.loc6_11.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.3] +// CHECK:STDOUT: %a.loc6_11.1: %.3 = param a, runtime_param +// CHECK:STDOUT: %a.loc6_11.2: %.3 = bind_symbolic_name a 0, %a.loc6_11.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.5] { // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc18_22: type = const_type %C [template = constants.%.2] -// CHECK:STDOUT: %.loc18_15: type = const_type %.2 [template = constants.%.2] -// CHECK:STDOUT: %a.loc18_11.1: %.2 = param a, runtime_param -// CHECK:STDOUT: %a.loc18_11.2: %.2 = bind_symbolic_name a 0, %a.loc18_11.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %.loc18_22: type = const_type %C [template = constants.%.3] +// CHECK:STDOUT: %.loc18_15: type = const_type %.3 [template = constants.%.3] +// CHECK:STDOUT: %a.loc18_11.1: %.3 = param a, runtime_param +// CHECK:STDOUT: %a.loc18_11.2: %.3 = bind_symbolic_name a 0, %a.loc18_11.1 [symbolic = @.1.%a (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @Foo(file.%a.loc6_11.2: %.2) { -// CHECK:STDOUT: %a: %.2 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @Foo(file.%a.loc6_11.2: %.3) { +// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: class; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @.1(file.%a.loc18_11.2: %.2) { -// CHECK:STDOUT: %a: %.2 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic class @.1(file.%a.loc18_11.2: %.3) { +// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc18: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.5 +// CHECK:STDOUT: .Self = constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -936,9 +992,10 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.4: type = struct_type {.a: %.1} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.5: %.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.6: %.type = struct_value () [template] +// CHECK:STDOUT: %.7: type = ptr_type %.4 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -947,7 +1004,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.6] { // CHECK:STDOUT: %Base.ref: type = name_ref Base, %Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc16_26: type = ptr_type %Base [template = constants.%.3] // CHECK:STDOUT: %self.loc16_16.1: %.3 = param self, runtime_param0 @@ -967,6 +1024,7 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: %self.loc7_13.3: %.3 = bind_name self, %self.loc7_13.1 // CHECK:STDOUT: %.loc7_8: %.3 = addr_pattern %self.loc7_13.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc8: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 1c7d8fd8de130..c56f663577cc4 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -38,8 +38,9 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.5: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.6: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.6 [template] -// CHECK:STDOUT: %.8: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.9: type = ptr_type %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -133,6 +134,7 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14, %.loc14_10.1 [template = i32] // CHECK:STDOUT: %.loc14_8: %.5 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc15: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/raw_self_type.carbon b/toolchain/check/testdata/class/raw_self_type.carbon index 6ebe4923591bd..3c4026560bcb8 100644 --- a/toolchain/check/testdata/class/raw_self_type.carbon +++ b/toolchain/check/testdata/class/raw_self_type.carbon @@ -31,8 +31,9 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %Class [template] -// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %Class [template] +// CHECK:STDOUT: %.5: type = ptr_type %.2 [template] // CHECK:STDOUT: %MemberNamedSelf: type = class_type @MemberNamedSelf [template] // CHECK:STDOUT: %Self: type = class_type @Self [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] @@ -73,6 +74,7 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: // CHECK:STDOUT: class @Class { // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} +// CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -89,6 +91,7 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %y.loc21_17.1: %Self = param y, runtime_param1 // CHECK:STDOUT: %y.loc21_17.2: %Self = bind_name y, %y.loc21_17.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc22: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%MemberNamedSelf @@ -97,6 +100,8 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Self { +// CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Self // CHECK:STDOUT: } @@ -104,15 +109,15 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: fn @F.1() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %.loc13: type = ptr_type %Class [template = constants.%.3] -// CHECK:STDOUT: %Self.var: ref %.3 = var r#Self -// CHECK:STDOUT: %Self: ref %.3 = bind_name r#Self, %Self.var +// CHECK:STDOUT: %.loc13: type = ptr_type %Class [template = constants.%.4] +// CHECK:STDOUT: %Self.var: ref %.4 = var r#Self +// CHECK:STDOUT: %Self: ref %.4 = bind_name r#Self, %Self.var // CHECK:STDOUT: %Self.ref.loc14_12: type = name_ref Self, constants.%Class [template = constants.%Class] -// CHECK:STDOUT: %.loc14_16: type = ptr_type %Class [template = constants.%.3] -// CHECK:STDOUT: %p.var: ref %.3 = var p -// CHECK:STDOUT: %p: ref %.3 = bind_name p, %p.var -// CHECK:STDOUT: %Self.ref.loc14_20: ref %.3 = name_ref r#Self, %Self -// CHECK:STDOUT: %.loc14_20: %.3 = bind_value %Self.ref.loc14_20 +// CHECK:STDOUT: %.loc14_16: type = ptr_type %Class [template = constants.%.4] +// CHECK:STDOUT: %p.var: ref %.4 = var p +// CHECK:STDOUT: %p: ref %.4 = bind_name p, %p.var +// CHECK:STDOUT: %Self.ref.loc14_20: ref %.4 = name_ref r#Self, %Self +// CHECK:STDOUT: %.loc14_20: %.4 = bind_value %Self.ref.loc14_20 // CHECK:STDOUT: assign %p.var, %.loc14_20 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index 7d337161032ec..842826f1f56a7 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -26,7 +26,8 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,6 +76,7 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %b.loc14_20.1: bool = param b, runtime_param1 // CHECK:STDOUT: %b.loc14_20.2: bool = bind_name b, %b.loc14_20.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc15: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/redeclaration_introducer.carbon b/toolchain/check/testdata/class/redeclaration_introducer.carbon index 035d2baab0cf1..d28b33987edad 100644 --- a/toolchain/check/testdata/class/redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/redeclaration_introducer.carbon @@ -23,6 +23,7 @@ abstract class C {} // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -55,16 +56,22 @@ abstract class C {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc16: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc17: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index 2e49f2d8dd6d5..db0159d3863b3 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -30,7 +30,8 @@ fn Class.F() -> i32 { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -76,6 +77,7 @@ fn Class.F() -> i32 { // CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] // CHECK:STDOUT: %return.var.loc13: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index 6ec5ce3cdcd3f..c897c9a6d6360 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -30,8 +30,9 @@ class Class { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -71,6 +72,7 @@ class Class { // CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32.loc16, %.loc16_13.1 [template = i32] // CHECK:STDOUT: %return.var.loc16: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -92,7 +94,7 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17: i32 = int_literal 1 [template = constants.%.4] +// CHECK:STDOUT: %.loc17: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: return %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index cbdffc537557e..049df4cd76078 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -59,33 +59,37 @@ class A { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %B, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %DF.type: type = fn_type @DF [template] // CHECK:STDOUT: %DF: %DF.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %D, i32 [template] -// CHECK:STDOUT: %.5: type = struct_type {.d: i32} [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %D, i32 [template] +// CHECK:STDOUT: %.6: type = struct_type {.d: i32} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %CF.type: type = fn_type @CF [template] // CHECK:STDOUT: %CF: %CF.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %C, i32 [template] -// CHECK:STDOUT: %.7: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %.8: type = unbound_element_type %C, i32 [template] +// CHECK:STDOUT: %.9: type = struct_type {.c: i32} [template] +// CHECK:STDOUT: %.10: = complete_type_witness %.9 [template] // CHECK:STDOUT: %AF.type: type = fn_type @AF [template] // CHECK:STDOUT: %AF: %AF.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = unbound_element_type %A, i32 [template] -// CHECK:STDOUT: %.9: type = struct_type {.a: i32} [template] -// CHECK:STDOUT: %.10: type = ptr_type %.9 [template] -// CHECK:STDOUT: %.11: i32 = int_literal 1 [template] -// CHECK:STDOUT: %struct.1: %A = struct_value (%.11) [template] -// CHECK:STDOUT: %.12: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.13: i32 = int_literal 2 [template] -// CHECK:STDOUT: %struct.2: %B = struct_value (%.13) [template] -// CHECK:STDOUT: %.14: type = ptr_type %.7 [template] -// CHECK:STDOUT: %.15: i32 = int_literal 3 [template] -// CHECK:STDOUT: %struct.3: %C = struct_value (%.15) [template] -// CHECK:STDOUT: %.16: type = ptr_type %.5 [template] -// CHECK:STDOUT: %.17: i32 = int_literal 4 [template] -// CHECK:STDOUT: %struct.4: %D = struct_value (%.17) [template] +// CHECK:STDOUT: %.11: type = unbound_element_type %A, i32 [template] +// CHECK:STDOUT: %.12: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.13: = complete_type_witness %.12 [template] +// CHECK:STDOUT: %.14: type = ptr_type %.12 [template] +// CHECK:STDOUT: %.15: i32 = int_literal 1 [template] +// CHECK:STDOUT: %struct.1: %A = struct_value (%.15) [template] +// CHECK:STDOUT: %.16: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.17: i32 = int_literal 2 [template] +// CHECK:STDOUT: %struct.2: %B = struct_value (%.17) [template] +// CHECK:STDOUT: %.18: type = ptr_type %.9 [template] +// CHECK:STDOUT: %.19: i32 = int_literal 3 [template] +// CHECK:STDOUT: %struct.3: %C = struct_value (%.19) [template] +// CHECK:STDOUT: %.20: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.21: i32 = int_literal 4 [template] +// CHECK:STDOUT: %struct.4: %D = struct_value (%.21) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -119,7 +123,8 @@ class A { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc46_10.2: type = converted %int.make_type_32, %.loc46_10.1 [template = i32] -// CHECK:STDOUT: %.loc46_8: %.8 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc46_8: %.11 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc47: = complete_type_witness %.12 [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A @@ -135,6 +140,7 @@ class A { // CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc16_12.2: type = converted %int.make_type_32, %.loc16_12.1 [template = i32] // CHECK:STDOUT: %.loc16_10: %.2 = field_decl b, element0 [template] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B @@ -150,7 +156,8 @@ class A { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc42_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc42_12.2: type = converted %int.make_type_32, %.loc42_12.1 [template = i32] -// CHECK:STDOUT: %.loc42_10: %.6 = field_decl c, element0 [template] +// CHECK:STDOUT: %.loc42_10: %.8 = field_decl c, element0 [template] +// CHECK:STDOUT: %.loc43: = complete_type_witness %.9 [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -165,7 +172,8 @@ class A { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_14.2: type = converted %int.make_type_32, %.loc24_14.1 [template = i32] -// CHECK:STDOUT: %.loc24_12: %.4 = field_decl d, element0 [template] +// CHECK:STDOUT: %.loc24_12: %.5 = field_decl d, element0 [template] +// CHECK:STDOUT: %.loc25: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -185,40 +193,40 @@ class A { // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var -// CHECK:STDOUT: %.loc29_24: i32 = int_literal 1 [template = constants.%.11] -// CHECK:STDOUT: %.loc29_25.1: %.9 = struct_literal (%.loc29_24) +// CHECK:STDOUT: %.loc29_24: i32 = int_literal 1 [template = constants.%.15] +// CHECK:STDOUT: %.loc29_25.1: %.12 = struct_literal (%.loc29_24) // CHECK:STDOUT: %.loc29_25.2: ref i32 = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc29_25.3: init i32 = initialize_from %.loc29_24 to %.loc29_25.2 [template = constants.%.11] +// CHECK:STDOUT: %.loc29_25.3: init i32 = initialize_from %.loc29_24 to %.loc29_25.2 [template = constants.%.15] // CHECK:STDOUT: %.loc29_25.4: init %A = class_init (%.loc29_25.3), %a.var [template = constants.%struct.1] // CHECK:STDOUT: %.loc29_26: init %A = converted %.loc29_25.1, %.loc29_25.4 [template = constants.%struct.1] // CHECK:STDOUT: assign %a.var, %.loc29_26 // CHECK:STDOUT: %B.ref: type = name_ref B, @A.%B.decl [template = constants.%B] // CHECK:STDOUT: %b.var: ref %B = var b // CHECK:STDOUT: %b: ref %B = bind_name b, %b.var -// CHECK:STDOUT: %.loc30_24: i32 = int_literal 2 [template = constants.%.13] +// CHECK:STDOUT: %.loc30_24: i32 = int_literal 2 [template = constants.%.17] // CHECK:STDOUT: %.loc30_25.1: %.3 = struct_literal (%.loc30_24) // CHECK:STDOUT: %.loc30_25.2: ref i32 = class_element_access %b.var, element0 -// CHECK:STDOUT: %.loc30_25.3: init i32 = initialize_from %.loc30_24 to %.loc30_25.2 [template = constants.%.13] +// CHECK:STDOUT: %.loc30_25.3: init i32 = initialize_from %.loc30_24 to %.loc30_25.2 [template = constants.%.17] // CHECK:STDOUT: %.loc30_25.4: init %B = class_init (%.loc30_25.3), %b.var [template = constants.%struct.2] // CHECK:STDOUT: %.loc30_26: init %B = converted %.loc30_25.1, %.loc30_25.4 [template = constants.%struct.2] // CHECK:STDOUT: assign %b.var, %.loc30_26 // CHECK:STDOUT: %C.ref: type = name_ref C, @B.%C.decl [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %.loc31_24: i32 = int_literal 3 [template = constants.%.15] -// CHECK:STDOUT: %.loc31_25.1: %.7 = struct_literal (%.loc31_24) +// CHECK:STDOUT: %.loc31_24: i32 = int_literal 3 [template = constants.%.19] +// CHECK:STDOUT: %.loc31_25.1: %.9 = struct_literal (%.loc31_24) // CHECK:STDOUT: %.loc31_25.2: ref i32 = class_element_access %c.var, element0 -// CHECK:STDOUT: %.loc31_25.3: init i32 = initialize_from %.loc31_24 to %.loc31_25.2 [template = constants.%.15] +// CHECK:STDOUT: %.loc31_25.3: init i32 = initialize_from %.loc31_24 to %.loc31_25.2 [template = constants.%.19] // CHECK:STDOUT: %.loc31_25.4: init %C = class_init (%.loc31_25.3), %c.var [template = constants.%struct.3] // CHECK:STDOUT: %.loc31_26: init %C = converted %.loc31_25.1, %.loc31_25.4 [template = constants.%struct.3] // CHECK:STDOUT: assign %c.var, %.loc31_26 // CHECK:STDOUT: %D.ref: type = name_ref D, @C.%D.decl [template = constants.%D] // CHECK:STDOUT: %d.var: ref %D = var d // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var -// CHECK:STDOUT: %.loc32_24: i32 = int_literal 4 [template = constants.%.17] -// CHECK:STDOUT: %.loc32_25.1: %.5 = struct_literal (%.loc32_24) +// CHECK:STDOUT: %.loc32_24: i32 = int_literal 4 [template = constants.%.21] +// CHECK:STDOUT: %.loc32_25.1: %.6 = struct_literal (%.loc32_24) // CHECK:STDOUT: %.loc32_25.2: ref i32 = class_element_access %d.var, element0 -// CHECK:STDOUT: %.loc32_25.3: init i32 = initialize_from %.loc32_24 to %.loc32_25.2 [template = constants.%.17] +// CHECK:STDOUT: %.loc32_25.3: init i32 = initialize_from %.loc32_24 to %.loc32_25.2 [template = constants.%.21] // CHECK:STDOUT: %.loc32_25.4: init %D = class_init (%.loc32_25.3), %d.var [template = constants.%struct.4] // CHECK:STDOUT: %.loc32_26: init %D = converted %.loc32_25.1, %.loc32_25.4 [template = constants.%struct.4] // CHECK:STDOUT: assign %d.var, %.loc32_26 diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 515747629706d..598a142389fcf 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -39,13 +39,14 @@ fn Run() { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -94,6 +95,7 @@ fn Run() { // CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32.loc16, %.loc16_13.1 [template = i32] // CHECK:STDOUT: %return.var.loc16: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class @@ -105,7 +107,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13: i32 = int_literal 1 [template = constants.%.3] +// CHECK:STDOUT: %.loc13: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: return %.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -120,7 +122,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.2() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc22: i32 = int_literal 2 [template = constants.%.4] +// CHECK:STDOUT: %.loc22: i32 = int_literal 2 [template = constants.%.5] // CHECK:STDOUT: return %.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index d00fd3206a98a..889eedafac602 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -37,7 +37,8 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.3: type = unbound_element_type %Class, i32 [template] // CHECK:STDOUT: %.4: type = struct_type {.n: i32} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -109,6 +110,7 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_10.2: type = converted %int.make_type_32.loc15, %.loc15_10.1 [template = i32] // CHECK:STDOUT: %.loc15_8: %.3 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc16: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index d79de6b1e8c0d..d49727e7360d5 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -41,21 +41,23 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Base, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %Derived: type = class_type @Derived [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: type = unbound_element_type %Derived, %Base [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: type = unbound_element_type %Derived, %Base [template] // CHECK:STDOUT: %SelfBase.type: type = fn_type @SelfBase [template] // CHECK:STDOUT: %SelfBase: %SelfBase.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %Base [template] +// CHECK:STDOUT: %.7: type = ptr_type %Base [template] // CHECK:STDOUT: %AddrSelfBase.type: type = fn_type @AddrSelfBase [template] // CHECK:STDOUT: %AddrSelfBase: %AddrSelfBase.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = struct_type {.base: %Base} [template] -// CHECK:STDOUT: %.8: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.9: type = ptr_type %Derived [template] +// CHECK:STDOUT: %.8: type = struct_type {.base: %Base} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] +// CHECK:STDOUT: %.10: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.11: type = ptr_type %Derived [template] // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = struct_type {.base: %.4} [template] -// CHECK:STDOUT: %.11: type = ptr_type %.7 [template] +// CHECK:STDOUT: %.12: type = struct_type {.base: %.5} [template] +// CHECK:STDOUT: %.13: type = ptr_type %.8 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -94,16 +96,16 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { // CHECK:STDOUT: %Base.ref.loc26: type = name_ref Base, %Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc26_40: type = ptr_type %Base [template = constants.%.6] -// CHECK:STDOUT: %self.loc26_30.1: %.6 = param self, runtime_param0 -// CHECK:STDOUT: @AddrSelfBase.%self: %.6 = bind_name self, %self.loc26_30.1 -// CHECK:STDOUT: @AddrSelfBase.%.loc26: %.6 = addr_pattern @AddrSelfBase.%self +// CHECK:STDOUT: %.loc26_40: type = ptr_type %Base [template = constants.%.7] +// CHECK:STDOUT: %self.loc26_30.1: %.7 = param self, runtime_param0 +// CHECK:STDOUT: @AddrSelfBase.%self: %.7 = bind_name self, %self.loc26_30.1 +// CHECK:STDOUT: @AddrSelfBase.%.loc26: %.7 = addr_pattern @AddrSelfBase.%self // CHECK:STDOUT: } // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, %Derived.decl [template = constants.%Derived] -// CHECK:STDOUT: %.loc30_19: type = ptr_type %Derived [template = constants.%.9] -// CHECK:STDOUT: %p.loc30_9.1: %.9 = param p, runtime_param0 -// CHECK:STDOUT: @Call.%p: %.9 = bind_name p, %p.loc30_9.1 +// CHECK:STDOUT: %.loc30_19: type = ptr_type %Derived [template = constants.%.11] +// CHECK:STDOUT: %p.loc30_9.1: %.11 = param p, runtime_param0 +// CHECK:STDOUT: @Call.%p: %.11 = bind_name p, %p.loc30_9.1 // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc30_25.1: type = value_of_initializer %int.make_type_32.loc30 [template = i32] // CHECK:STDOUT: %.loc30_25.2: type = converted %int.make_type_32.loc30, %.loc30_25.1 [template = i32] @@ -116,6 +118,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl a, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -124,7 +127,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: %Base.ref.loc16: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc16: %.5 = base_decl %Base, element0 [template] +// CHECK:STDOUT: %.loc16: %.6 = base_decl %Base, element0 [template] // CHECK:STDOUT: %SelfBase.decl: %SelfBase.type = fn_decl @SelfBase [template = constants.%SelfBase] { // CHECK:STDOUT: %Base.ref.loc18: type = name_ref Base, file.%Base.decl [template = constants.%Base] // CHECK:STDOUT: %self.loc18_15.1: %Base = param self, runtime_param0 @@ -136,11 +139,12 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %AddrSelfBase.decl: %AddrSelfBase.type = fn_decl @AddrSelfBase [template = constants.%AddrSelfBase] { // CHECK:STDOUT: %Base.ref.loc19: type = name_ref Base, file.%Base.decl [template = constants.%Base] -// CHECK:STDOUT: %.loc19_34: type = ptr_type %Base [template = constants.%.6] -// CHECK:STDOUT: %self.loc19_24.1: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc19_24.3: %.6 = bind_name self, %self.loc19_24.1 -// CHECK:STDOUT: %.loc19_19: %.6 = addr_pattern %self.loc19_24.3 +// CHECK:STDOUT: %.loc19_34: type = ptr_type %Base [template = constants.%.7] +// CHECK:STDOUT: %self.loc19_24.1: %.7 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc19_24.3: %.7 = bind_name self, %self.loc19_24.1 +// CHECK:STDOUT: %.loc19_19: %.7 = addr_pattern %self.loc19_24.3 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc20: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived @@ -161,30 +165,30 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: return %.loc23_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @AddrSelfBase[addr %self: %.6]() { +// CHECK:STDOUT: fn @AddrSelfBase[addr %self: %.7]() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %.6 = name_ref self, %self +// CHECK:STDOUT: %self.ref: %.7 = name_ref self, %self // CHECK:STDOUT: %.loc27_4: ref %Base = deref %self.ref // CHECK:STDOUT: %a.ref: %.2 = name_ref a, @Base.%.loc12_8 [template = @Base.%.loc12_8] // CHECK:STDOUT: %.loc27_10: ref i32 = class_element_access %.loc27_4, element0 -// CHECK:STDOUT: %.loc27_15: i32 = int_literal 1 [template = constants.%.8] +// CHECK:STDOUT: %.loc27_15: i32 = int_literal 1 [template = constants.%.10] // CHECK:STDOUT: assign %.loc27_10, %.loc27_15 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Call(%p: %.9) -> i32 { +// CHECK:STDOUT: fn @Call(%p: %.11) -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %p.ref.loc31: %.9 = name_ref p, %p +// CHECK:STDOUT: %p.ref.loc31: %.11 = name_ref p, %p // CHECK:STDOUT: %.loc31_4.1: ref %Derived = deref %p.ref.loc31 // CHECK:STDOUT: %AddrSelfBase.ref: %AddrSelfBase.type = name_ref AddrSelfBase, @Derived.%AddrSelfBase.decl [template = constants.%AddrSelfBase] // CHECK:STDOUT: %.loc31_7: = bound_method %.loc31_4.1, %AddrSelfBase.ref -// CHECK:STDOUT: %.loc31_4.2: %.9 = addr_of %.loc31_4.1 +// CHECK:STDOUT: %.loc31_4.2: %.11 = addr_of %.loc31_4.1 // CHECK:STDOUT: %.loc31_20.1: ref %Derived = deref %.loc31_4.2 // CHECK:STDOUT: %.loc31_20.2: ref %Base = class_element_access %.loc31_20.1, element0 -// CHECK:STDOUT: %.loc31_20.3: %.6 = addr_of %.loc31_20.2 -// CHECK:STDOUT: %.loc31_20.4: %.6 = converted %.loc31_4.2, %.loc31_20.3 +// CHECK:STDOUT: %.loc31_20.3: %.7 = addr_of %.loc31_20.2 +// CHECK:STDOUT: %.loc31_20.4: %.7 = converted %.loc31_4.2, %.loc31_20.3 // CHECK:STDOUT: %AddrSelfBase.call: init %.1 = call %.loc31_7(%.loc31_20.4) -// CHECK:STDOUT: %p.ref.loc32: %.9 = name_ref p, %p +// CHECK:STDOUT: %p.ref.loc32: %.11 = name_ref p, %p // CHECK:STDOUT: %.loc32_11: ref %Derived = deref %p.ref.loc32 // CHECK:STDOUT: %SelfBase.ref: %SelfBase.type = name_ref SelfBase, @Derived.%SelfBase.decl [template = constants.%SelfBase] // CHECK:STDOUT: %.loc32_14: = bound_method %.loc32_11, %SelfBase.ref diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 77801b288d445..a6f2f8319fd9f 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -36,7 +36,8 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %.2: type = ptr_type %Class [template] // CHECK:STDOUT: %.3: type = unbound_element_type %Class, %.2 [template] // CHECK:STDOUT: %.4: type = struct_type {.p: %.2} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -89,6 +90,7 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc18_14: type = ptr_type %Class [template = constants.%.2] // CHECK:STDOUT: %.loc18_8: %.3 = field_decl p, element0 [template] +// CHECK:STDOUT: %.loc19: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index b6a285753ffbc..a38da15d23734 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -27,9 +27,10 @@ fn Run() -> i32 { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %Run.type: type = fn_type @Run [template] // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -70,6 +71,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32, %.loc12_13.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 916657295225c..030056713c835 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -39,8 +39,9 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%a) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: i32 = int_literal 1000 [template] -// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.3) [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: i32 = int_literal 1000 [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.4) [template] // CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b 0 [symbolic] // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] // CHECK:STDOUT: %D.1: %D.type = struct_value () [template] @@ -78,15 +79,15 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc3: %D.type = class_decl @D [template = constants.%D.1] { // CHECK:STDOUT: %C.ref.loc3: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc3: i32 = int_literal 1000 [template = constants.%.3] -// CHECK:STDOUT: %C.loc3: type = class_type @C, @C(constants.%.3) [template = constants.%C.3] +// CHECK:STDOUT: %.loc3: i32 = int_literal 1000 [template = constants.%.4] +// CHECK:STDOUT: %C.loc3: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] // CHECK:STDOUT: %b.loc3_9.1: %C.3 = param b, runtime_param // CHECK:STDOUT: %b.loc3_9.2: %C.3 = bind_symbolic_name b 0, %b.loc3_9.1 [symbolic = @D.%b (constants.%b)] // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl.loc4: %D.type = class_decl @D [template = constants.%D.1] { // CHECK:STDOUT: %C.ref.loc4: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc4: i32 = int_literal 1000 [template = constants.%.3] -// CHECK:STDOUT: %C.loc4: type = class_type @C, @C(constants.%.3) [template = constants.%C.3] +// CHECK:STDOUT: %.loc4: i32 = int_literal 1000 [template = constants.%.4] +// CHECK:STDOUT: %C.loc4: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] // CHECK:STDOUT: %b.loc4_9.1: %C.3 = param b, runtime_param // CHECK:STDOUT: %b.loc4_9.2: %C.3 = bind_symbolic_name b 0, %b.loc4_9.1 [symbolic = constants.%b] // CHECK:STDOUT: } @@ -98,6 +99,8 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc2: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 // CHECK:STDOUT: } @@ -109,6 +112,8 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D.2 // CHECK:STDOUT: } @@ -120,8 +125,8 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %a => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.3) { -// CHECK:STDOUT: %a => constants.%.3 +// CHECK:STDOUT: specific @C(constants.%.4) { +// CHECK:STDOUT: %a => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { @@ -139,15 +144,16 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%a) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: i32 = int_literal 1000 [template] -// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.3) [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: i32 = int_literal 1000 [template] +// CHECK:STDOUT: %C.3: type = class_type @C, @C(%.4) [template] // CHECK:STDOUT: %b: %C.3 = bind_symbolic_name b 0 [symbolic] // CHECK:STDOUT: %D.type: type = generic_class_type @D [template] // CHECK:STDOUT: %D.1: %D.type = struct_value () [template] // CHECK:STDOUT: %D.2: type = class_type @D, @D(%b) [symbolic] // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template] -// CHECK:STDOUT: %.4: %.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = class_type @.1, @.1(%b) [symbolic] +// CHECK:STDOUT: %.5: %.type = struct_value () [template] +// CHECK:STDOUT: %.6: type = class_type @.1, @.1(%b) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -181,15 +187,15 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.1] { // CHECK:STDOUT: %C.ref.loc3: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc3: i32 = int_literal 1000 [template = constants.%.3] -// CHECK:STDOUT: %C.loc3: type = class_type @C, @C(constants.%.3) [template = constants.%C.3] +// CHECK:STDOUT: %.loc3: i32 = int_literal 1000 [template = constants.%.4] +// CHECK:STDOUT: %C.loc3: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] // CHECK:STDOUT: %b.loc3_9.1: %C.3 = param b, runtime_param // CHECK:STDOUT: %b.loc3_9.2: %C.3 = bind_symbolic_name b 0, %b.loc3_9.1 [symbolic = @D.%b (constants.%b)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.4] { +// CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.5] { // CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc10: i32 = int_literal 1000 [template = constants.%.3] -// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%.3) [template = constants.%C.3] +// CHECK:STDOUT: %.loc10: i32 = int_literal 1000 [template = constants.%.4] +// CHECK:STDOUT: %C.loc10: type = class_type @C, @C(constants.%.4) [template = constants.%C.3] // CHECK:STDOUT: %b.loc10_9.1: %C.3 = param b, runtime_param // CHECK:STDOUT: %b.loc10_9.2: %C.3 = bind_symbolic_name b 0, %b.loc10_9.1 [symbolic = @.1.%b (constants.%b)] // CHECK:STDOUT: } @@ -201,6 +207,8 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc2: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 // CHECK:STDOUT: } @@ -218,8 +226,10 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc10: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%.5 +// CHECK:STDOUT: .Self = constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -229,8 +239,8 @@ class D(b:! C(1_000)) {} // CHECK:STDOUT: %a => constants.%a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @C(constants.%.3) { -// CHECK:STDOUT: %a => constants.%.3 +// CHECK:STDOUT: specific @C(constants.%.4) { +// CHECK:STDOUT: %a => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @D(constants.%b) { diff --git a/toolchain/check/testdata/class/todo_access_modifiers.carbon b/toolchain/check/testdata/class/todo_access_modifiers.carbon index 3a9ca04efee4a..d09cf7de23abe 100644 --- a/toolchain/check/testdata/class/todo_access_modifiers.carbon +++ b/toolchain/check/testdata/class/todo_access_modifiers.carbon @@ -32,6 +32,7 @@ class Access { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %Access, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.k: i32, .l: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -69,6 +70,7 @@ class Access { // CHECK:STDOUT: %.loc19_20.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] // CHECK:STDOUT: %.loc19_20.2: type = converted %int.make_type_32.loc19, %.loc19_20.1 [template = i32] // CHECK:STDOUT: %.loc19_18: %.2 = field_decl l, element1 [template] +// CHECK:STDOUT: %.loc20: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Access diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index efab3db1bb1ed..02774942abe2f 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -33,6 +33,7 @@ abstract class Abstract { // CHECK:STDOUT: %I.type: type = fn_type @I [template] // CHECK:STDOUT: %I: %I.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %Abstract: type = class_type @Abstract [template] // CHECK:STDOUT: %J.type: type = fn_type @J [template] // CHECK:STDOUT: %J: %J.type = struct_value () [template] @@ -69,6 +70,7 @@ abstract class Abstract { // CHECK:STDOUT: class @Base { // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} // CHECK:STDOUT: %I.decl: %I.type = fn_decl @I [template = constants.%I] {} +// CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Base @@ -80,6 +82,7 @@ abstract class Abstract { // CHECK:STDOUT: %J.decl: %J.type = fn_decl @J [template = constants.%J] {} // CHECK:STDOUT: %K.decl: %K.type = fn_decl @K [template = constants.%K] {} // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [template = constants.%L] {} +// CHECK:STDOUT: %.loc24: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Abstract diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index 9a95b88289831..9c3ca969936d9 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -161,6 +161,7 @@ class C { // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -177,6 +178,7 @@ class C { // CHECK:STDOUT: %self.loc13_15.1: %C = param self, runtime_param0 // CHECK:STDOUT: %self.loc13_15.2: %C = bind_name self, %self.loc13_15.1 // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc14: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index 536848dd469ca..fc3c0f4bf0290 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -108,6 +108,7 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %Call.type: type = fn_type @Call [template] // CHECK:STDOUT: %Call: %Call.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -145,6 +146,8 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: class @C; // CHECK:STDOUT: // CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc37: = complete_type_witness %.2 [template = constants.%.3] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } @@ -181,7 +184,8 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %ReturnDUnused: %ReturnDUnused.type = struct_value () [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %ReturnDUsed.type: type = fn_type @ReturnDUsed [template] // CHECK:STDOUT: %ReturnDUsed: %ReturnDUsed.type = struct_value () [template] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index 59c7859848eee..010d81d25e3fb 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -173,10 +173,11 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %Bar.type: type = fn_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] // CHECK:STDOUT: } @@ -214,6 +215,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -233,10 +236,11 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -258,6 +262,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -272,12 +278,13 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -291,7 +298,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.loc6_8.1: %C = param a, runtime_param0 // CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc6_8.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc14_8.1: %C = param a, runtime_param0 // CHECK:STDOUT: @.1.%a: %C = bind_name a, %a.loc14_8.1 @@ -299,6 +306,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -315,10 +324,11 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -340,6 +350,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -354,8 +366,9 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Bar.type: type = fn_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] @@ -384,6 +397,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -397,19 +412,20 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %Bar.type: type = fn_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+5, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+9, loaded [template = constants.%Foo] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+16, loaded [template = constants.%Bar] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+11, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+18, loaded [template = constants.%Bar] // CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -454,12 +470,13 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -476,7 +493,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 // CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_8.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %b.loc15_8.1: %C = param b, runtime_param0 // CHECK:STDOUT: @.1.%b: %C = bind_name b, %b.loc15_8.1 @@ -484,6 +501,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -500,12 +519,13 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -522,7 +542,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 // CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_8.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %a.loc15_8.1: %C = param a, runtime_param0 // CHECK:STDOUT: @.1.%a: %C = bind_name a, %a.loc15_8.1 @@ -530,6 +550,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -546,12 +568,13 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -568,7 +591,7 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %a.loc7_8.1: %C = param a, runtime_param0 // CHECK:STDOUT: @Foo.%a: %C = bind_name a, %a.loc7_8.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %a.loc15_8.1: %C = param a, runtime_param0 // CHECK:STDOUT: @.1.%a: %C = bind_name a, %a.loc15_8.1 @@ -576,6 +599,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -592,10 +617,11 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -619,6 +645,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -636,8 +664,9 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -655,6 +684,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -666,15 +697,16 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+7, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+9, loaded [template = constants.%Foo] // CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -710,13 +742,14 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = const_type %C [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = const_type %C [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = fn_type @.1 [template] -// CHECK:STDOUT: %.4: %.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: %.type = struct_value () [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -727,27 +760,29 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.2] -// CHECK:STDOUT: %a.loc6_8.1: %.2 = param a, runtime_param0 -// CHECK:STDOUT: @Foo.%a: %.2 = bind_name a, %a.loc6_8.1 +// CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.3] +// CHECK:STDOUT: %a.loc6_8.1: %.3 = param a, runtime_param0 +// CHECK:STDOUT: @Foo.%a: %.3 = bind_name a, %a.loc6_8.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { +// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc17_18: type = const_type %C [template = constants.%.2] -// CHECK:STDOUT: %.loc17_11: type = const_type %.2 [template = constants.%.2] -// CHECK:STDOUT: %a.loc17_8.1: %.2 = param a, runtime_param0 -// CHECK:STDOUT: @.1.%a: %.2 = bind_name a, %a.loc17_8.1 +// CHECK:STDOUT: %.loc17_18: type = const_type %C [template = constants.%.3] +// CHECK:STDOUT: %.loc17_11: type = const_type %.3 [template = constants.%.3] +// CHECK:STDOUT: %a.loc17_8.1: %.3 = param a, runtime_param0 +// CHECK:STDOUT: @.1.%a: %.3 = bind_name a, %a.loc17_8.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%a: %.2); +// CHECK:STDOUT: fn @Foo(%a: %.3); // CHECK:STDOUT: -// CHECK:STDOUT: fn @.1(%a: %.2) { +// CHECK:STDOUT: fn @.1(%a: %.3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index b1eb1e616ea4e..eb70a284ee289 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -249,14 +249,15 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] -// CHECK:STDOUT: %.2: type = ptr_type %T [symbolic] +// CHECK:STDOUT: %.3: type = ptr_type %T [symbolic] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.type: type = fn_type @ExplicitAndAlsoDeduced [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %ExplicitAndAlsoDeduced: %ExplicitAndAlsoDeduced.type = struct_value () [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type i32 [template] +// CHECK:STDOUT: %.5: type = ptr_type i32 [template] // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.type: type = fn_type @CallExplicitAndAlsoDeduced [template] // CHECK:STDOUT: %CallExplicitAndAlsoDeduced: %CallExplicitAndAlsoDeduced.type = struct_value () [template] // CHECK:STDOUT: } @@ -292,8 +293,8 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %x.loc6_37.1: @ExplicitAndAlsoDeduced.%T.1 (%T) = param x, runtime_param0 // CHECK:STDOUT: @ExplicitAndAlsoDeduced.%x: @ExplicitAndAlsoDeduced.%T.1 (%T) = bind_name x, %x.loc6_37.1 // CHECK:STDOUT: %T.ref.loc6_46: type = name_ref T, @ExplicitAndAlsoDeduced.%T.loc6 [symbolic = @ExplicitAndAlsoDeduced.%T.1 (constants.%T)] -// CHECK:STDOUT: %.loc6: type = ptr_type %T [symbolic = @ExplicitAndAlsoDeduced.%.1 (constants.%.2)] -// CHECK:STDOUT: @ExplicitAndAlsoDeduced.%return: ref @ExplicitAndAlsoDeduced.%.1 (%.2) = var +// CHECK:STDOUT: %.loc6: type = ptr_type %T [symbolic = @ExplicitAndAlsoDeduced.%.1 (constants.%.3)] +// CHECK:STDOUT: @ExplicitAndAlsoDeduced.%return: ref @ExplicitAndAlsoDeduced.%.1 (%.3) = var // CHECK:STDOUT: } // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.decl: %CallExplicitAndAlsoDeduced.type = fn_decl @CallExplicitAndAlsoDeduced [template = constants.%CallExplicitAndAlsoDeduced] { // CHECK:STDOUT: %int.make_type_32.loc9_34: init type = call constants.%Int32() [template = i32] @@ -304,26 +305,28 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: %int.make_type_32.loc9_42: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_45.1: type = value_of_initializer %int.make_type_32.loc9_42 [template = i32] // CHECK:STDOUT: %.loc9_45.2: type = converted %int.make_type_32.loc9_42, %.loc9_45.1 [template = i32] -// CHECK:STDOUT: %.loc9_45.3: type = ptr_type i32 [template = constants.%.4] -// CHECK:STDOUT: @CallExplicitAndAlsoDeduced.%return: ref %.4 = var +// CHECK:STDOUT: %.loc9_45.3: type = ptr_type i32 [template = constants.%.5] +// CHECK:STDOUT: @CallExplicitAndAlsoDeduced.%return: ref %.5 = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @ExplicitAndAlsoDeduced(%T.loc6: type) { // CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)] -// CHECK:STDOUT: %.1: type = ptr_type @ExplicitAndAlsoDeduced.%T.1 (%T) [symbolic = %.1 (constants.%.2)] +// CHECK:STDOUT: %.1: type = ptr_type @ExplicitAndAlsoDeduced.%T.1 (%T) [symbolic = %.1 (constants.%.3)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc6: type, %x: @ExplicitAndAlsoDeduced.%T.1 (%T)) -> @ExplicitAndAlsoDeduced.%.1 (%.2); +// CHECK:STDOUT: fn(%T.loc6: type, %x: @ExplicitAndAlsoDeduced.%T.1 (%T)) -> @ExplicitAndAlsoDeduced.%.1 (%.3); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @CallExplicitAndAlsoDeduced(%n: i32) -> %.4 { +// CHECK:STDOUT: fn @CallExplicitAndAlsoDeduced(%n: i32) -> %.5 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %ExplicitAndAlsoDeduced.ref: %ExplicitAndAlsoDeduced.type = name_ref ExplicitAndAlsoDeduced, file.%ExplicitAndAlsoDeduced.decl [template = constants.%ExplicitAndAlsoDeduced] // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [template = constants.%A] @@ -333,7 +336,7 @@ fn CallImplicitNotDeducible() { // CHECK:STDOUT: // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%T) { // CHECK:STDOUT: %T.1 => constants.%T -// CHECK:STDOUT: %.1 => constants.%.2 +// CHECK:STDOUT: %.1 => constants.%.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- deduce_implicit.carbon diff --git a/toolchain/check/testdata/function/generic/no_prelude/call.carbon b/toolchain/check/testdata/function/generic/no_prelude/call.carbon index fb75b685fb5af..9fbb78680aa0d 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/call.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/call.carbon @@ -66,9 +66,10 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %CallGenericPtr: %CallGenericPtr.type = struct_value () [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %CallSpecific.type: type = fn_type @CallSpecific [template] // CHECK:STDOUT: %CallSpecific: %CallSpecific.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -119,6 +120,8 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc16: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -216,9 +219,10 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: %CallGenericPtr: %CallGenericPtr.type = struct_value () [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %CallSpecific.type: type = fn_type @CallSpecific [template] // CHECK:STDOUT: %CallSpecific: %CallSpecific.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -269,6 +273,8 @@ fn CallSpecific(x: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc16: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index 9812224df91e3..35a98df859765 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -31,25 +31,27 @@ fn G() { // CHECK:STDOUT: %Make.type.1: type = fn_type @Make, @Wrap(%T) [symbolic] // CHECK:STDOUT: %Make.1: %Make.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.3: i32 = int_literal 100 [template] -// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] -// CHECK:STDOUT: %.6: type = unbound_element_type %C, %.4 [template] -// CHECK:STDOUT: %.7: type = struct_type {.arr: %.4} [template] +// CHECK:STDOUT: %.4: i32 = int_literal 100 [template] +// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.7: type = unbound_element_type %C, %.5 [template] +// CHECK:STDOUT: %.8: type = struct_type {.arr: %.5} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %Wrap.3: type = class_type @Wrap, @Wrap(i32) [template] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make, @Wrap(i32) [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.10: type = ptr_type %.2 [template] // CHECK:STDOUT: %Wrap.4: type = class_type @Wrap, @Wrap(%.1) [template] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make, @Wrap(%.1) [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] -// CHECK:STDOUT: %.9: type = struct_type {.arr: %.5} [template] -// CHECK:STDOUT: %.10: type = ptr_type %.7 [template] +// CHECK:STDOUT: %.11: type = struct_type {.arr: %.6} [template] +// CHECK:STDOUT: %.12: type = ptr_type %.8 [template] // CHECK:STDOUT: %Wrap.5: type = class_type @Wrap, @Wrap(%C) [template] // CHECK:STDOUT: %Make.type.4: type = fn_type @Make, @Wrap(%C) [template] // CHECK:STDOUT: %Make.4: %Make.type.4 = struct_value () [template] @@ -98,6 +100,7 @@ fn G() { // CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc11_12.2 [symbolic = @Make.%T (constants.%T)] // CHECK:STDOUT: %return.var: ref @Make.%T (%T) = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc13: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Wrap.2 @@ -107,11 +110,12 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc15_26: i32 = int_literal 100 [template = constants.%.3] +// CHECK:STDOUT: %.loc15_26: i32 = int_literal 100 [template = constants.%.4] // CHECK:STDOUT: %.loc15_21.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_21.2: type = converted %int.make_type_32, %.loc15_21.1 [template = i32] -// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26, i32 [template = constants.%.4] -// CHECK:STDOUT: %.loc15_18: %.6 = field_decl arr, element0 [template] +// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26, i32 [template = constants.%.5] +// CHECK:STDOUT: %.loc15_18: %.7 = field_decl arr, element0 [template] +// CHECK:STDOUT: %.loc15_32: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/global/class_obj.carbon b/toolchain/check/testdata/global/class_obj.carbon index c8ed987d5745e..d4ce876eb495b 100644 --- a/toolchain/check/testdata/global/class_obj.carbon +++ b/toolchain/check/testdata/global/class_obj.carbon @@ -16,8 +16,9 @@ var a: A = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %A = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -48,6 +49,8 @@ var a: A = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc10: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/class_with_fun.carbon b/toolchain/check/testdata/global/class_with_fun.carbon index 22f4918de2f77..68f803320152e 100644 --- a/toolchain/check/testdata/global/class_with_fun.carbon +++ b/toolchain/check/testdata/global/class_with_fun.carbon @@ -20,10 +20,11 @@ var a: A = {}; // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %ret_a.type: type = fn_type @ret_a [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %ret_a: %ret_a.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %A = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -59,6 +60,8 @@ var a: A = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc10: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 830aa74e819a2..e209099aad768 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -52,6 +52,7 @@ class C { // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %.6: type = unbound_element_type %C, i32 [template] // CHECK:STDOUT: %.7: type = struct_type {.n: i32} [template] +// CHECK:STDOUT: %.8: = complete_type_witness %.7 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index d178cc9fa832b..30a3c2fdf28c2 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -38,9 +38,10 @@ fn G(c: C) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: = interface_witness (%F.2) [template] // CHECK:STDOUT: %.6: type = struct_type {} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -97,6 +98,7 @@ fn G(c: C) { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index 02c5b6d3ebc80..2eaedb74a934a 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -39,6 +39,7 @@ class C { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: = interface_witness (%F.2) [template] // CHECK:STDOUT: %.6: type = struct_type {} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -116,6 +117,7 @@ class C { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc19_23.2 [symbolic = constants.%T] // CHECK:STDOUT: %.loc19: type = interface_type @GenericInterface, @GenericInterface(constants.%T) [symbolic = constants.%.2] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc22: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index 7b5a8f794723c..32f64437de5c3 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -50,6 +50,7 @@ class E { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.3: = interface_witness () [template] // CHECK:STDOUT: %.4: type = struct_type {} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %E: type = class_type @E [template] // CHECK:STDOUT: } @@ -115,6 +116,7 @@ class E { // CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_32, %.loc18_15.1 [template = i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc19: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -126,6 +128,7 @@ class E { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc30: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -137,6 +140,7 @@ class E { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%E [template = constants.%E] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc40: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%E diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index 3c35a83709f7b..cd633b481096d 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -23,6 +23,7 @@ class C { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -57,6 +58,7 @@ class C { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc16: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index ee546450a6aee..d39ca356061cf 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -28,6 +28,7 @@ interface I { // CHECK:STDOUT: %C.1: type = class_type @C [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%Self) [symbolic] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -71,6 +72,7 @@ interface I { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc20: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index c9f943a96232b..f28a57f0e91ea 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -26,6 +26,7 @@ class C { // CHECK:STDOUT: %.1: type = interface_type @I [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -60,6 +61,7 @@ class C { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc21: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index 25048fef4c16d..a47b0dce6f199 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -225,6 +225,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %NoF: type = class_type @NoF [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %FNotFunction: type = class_type @FNotFunction [template] // CHECK:STDOUT: %F.2: type = class_type @F.16 [template] // CHECK:STDOUT: %PossiblyF.type: type = fn_type @PossiblyF [template] @@ -241,12 +242,12 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FExtraReturnType: type = class_type @FExtraReturnType [template] // CHECK:STDOUT: %F.type.4: type = fn_type @F.4 [template] // CHECK:STDOUT: %F.5: %F.type.4 = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @J [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.7: type = interface_type @J [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %F.type.5: type = fn_type @F.5 [template] // CHECK:STDOUT: %F.6: %F.type.5 = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.6, %F.type.5 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, @J.%F.decl [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %F.type.5 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, @J.%F.decl [template] // CHECK:STDOUT: %FMissingParam: type = class_type @FMissingParam [template] // CHECK:STDOUT: %F.type.6: type = fn_type @F.6 [template] // CHECK:STDOUT: %F.7: %F.type.6 = struct_value () [template] @@ -268,36 +269,36 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FDifferentParamName: type = class_type @FDifferentParamName [template] // CHECK:STDOUT: %F.type.12: type = fn_type @F.12 [template] // CHECK:STDOUT: %F.13: %F.type.12 = struct_value () [template] -// CHECK:STDOUT: %.9: type = interface_type @SelfNested [template] -// CHECK:STDOUT: %Self.3: %.9 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.10: type = ptr_type %Self.3 [symbolic] +// CHECK:STDOUT: %.10: type = interface_type @SelfNested [template] +// CHECK:STDOUT: %Self.3: %.10 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.11: type = ptr_type %Self.3 [symbolic] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] -// CHECK:STDOUT: %.11: type = struct_type {.x: %Self.3, .y: i32} [symbolic] -// CHECK:STDOUT: %.12: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %.13: type = tuple_type (%.10, %.11) [symbolic] -// CHECK:STDOUT: %.14: i32 = int_literal 4 [template] -// CHECK:STDOUT: %.15: type = array_type %.14, %Self.3 [symbolic] +// CHECK:STDOUT: %.12: type = struct_type {.x: %Self.3, .y: i32} [symbolic] +// CHECK:STDOUT: %.13: type = tuple_type (type, type) [template] +// CHECK:STDOUT: %.14: type = tuple_type (%.11, %.12) [symbolic] +// CHECK:STDOUT: %.15: i32 = int_literal 4 [template] +// CHECK:STDOUT: %.16: type = array_type %.15, %Self.3 [symbolic] // CHECK:STDOUT: %F.type.13: type = fn_type @F.13 [template] // CHECK:STDOUT: %F.14: %F.type.13 = struct_value () [template] -// CHECK:STDOUT: %.16: type = assoc_entity_type %.9, %F.type.13 [template] -// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, @SelfNested.%F.decl [template] +// CHECK:STDOUT: %.17: type = assoc_entity_type %.10, %F.type.13 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, @SelfNested.%F.decl [template] // CHECK:STDOUT: %SelfNestedBadParam: type = class_type @SelfNestedBadParam [template] -// CHECK:STDOUT: %.18: type = ptr_type %SelfNestedBadParam [template] -// CHECK:STDOUT: %.19: type = struct_type {.x: i32, .y: i32} [template] -// CHECK:STDOUT: %.20: type = tuple_type (%.18, %.19) [template] -// CHECK:STDOUT: %.21: type = array_type %.14, %SelfNestedBadParam [template] +// CHECK:STDOUT: %.19: type = ptr_type %SelfNestedBadParam [template] +// CHECK:STDOUT: %.20: type = struct_type {.x: i32, .y: i32} [template] +// CHECK:STDOUT: %.21: type = tuple_type (%.19, %.20) [template] +// CHECK:STDOUT: %.22: type = array_type %.15, %SelfNestedBadParam [template] // CHECK:STDOUT: %F.type.14: type = fn_type @F.14 [template] // CHECK:STDOUT: %F.15: %F.type.14 = struct_value () [template] -// CHECK:STDOUT: %.22: type = struct_type {.x: %SelfNestedBadParam, .y: i32} [template] -// CHECK:STDOUT: %.23: type = tuple_type (%.18, %.22) [template] +// CHECK:STDOUT: %.23: type = struct_type {.x: %SelfNestedBadParam, .y: i32} [template] +// CHECK:STDOUT: %.24: type = tuple_type (%.19, %.23) [template] // CHECK:STDOUT: %SelfNestedBadReturnType: type = class_type @SelfNestedBadReturnType [template] -// CHECK:STDOUT: %.24: type = ptr_type %SelfNestedBadReturnType [template] -// CHECK:STDOUT: %.25: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template] -// CHECK:STDOUT: %.26: type = tuple_type (%.24, %.25) [template] +// CHECK:STDOUT: %.25: type = ptr_type %SelfNestedBadReturnType [template] +// CHECK:STDOUT: %.26: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template] +// CHECK:STDOUT: %.27: type = tuple_type (%.25, %.26) [template] // CHECK:STDOUT: %F.type.15: type = fn_type @F.15 [template] // CHECK:STDOUT: %F.16: %F.type.15 = struct_value () [template] -// CHECK:STDOUT: %.27: type = array_type %.14, %SelfNestedBadReturnType [template] +// CHECK:STDOUT: %.28: type = array_type %.15, %SelfNestedBadReturnType [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -349,7 +350,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FExtraParam.decl: type = class_decl @FExtraParam [template = constants.%FExtraParam] {} // CHECK:STDOUT: %FExtraImplicitParam.decl: type = class_decl @FExtraImplicitParam [template = constants.%FExtraImplicitParam] {} // CHECK:STDOUT: %FExtraReturnType.decl: type = class_decl @FExtraReturnType [template = constants.%FExtraReturnType] {} -// CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.6] {} +// CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.7] {} // CHECK:STDOUT: %FMissingParam.decl: type = class_decl @FMissingParam [template = constants.%FMissingParam] {} // CHECK:STDOUT: %FMissingImplicitParam.decl: type = class_decl @FMissingImplicitParam [template = constants.%FMissingImplicitParam] {} // CHECK:STDOUT: %FMissingReturnType.decl: type = class_decl @FMissingReturnType [template = constants.%FMissingReturnType] {} @@ -357,7 +358,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %FDifferentImplicitParamType.decl: type = class_decl @FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] {} // CHECK:STDOUT: %FDifferentReturnType.decl: type = class_decl @FDifferentReturnType [template = constants.%FDifferentReturnType] {} // CHECK:STDOUT: %FDifferentParamName.decl: type = class_decl @FDifferentParamName [template = constants.%FDifferentParamName] {} -// CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.9] {} +// CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.10] {} // CHECK:STDOUT: %SelfNestedBadParam.decl: type = class_decl @SelfNestedBadParam [template = constants.%SelfNestedBadParam] {} // CHECK:STDOUT: %SelfNestedBadReturnType.decl: type = class_decl @SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] {} // CHECK:STDOUT: } @@ -374,7 +375,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @J { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] // CHECK:STDOUT: %F.decl: %F.type.5 = fn_decl @F.5 [template = constants.%F.6] { // CHECK:STDOUT: %bool.make_type.loc93_26: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc93_26.1: type = value_of_initializer %bool.make_type.loc93_26 [template = bool] @@ -391,7 +392,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.loc93_44.2: type = converted %bool.make_type.loc93_44, %.loc93_44.1 [template = bool] // CHECK:STDOUT: %return.var: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc93_48: %.7 = assoc_entity element0, %F.decl [template = constants.%.8] +// CHECK:STDOUT: %.loc93_48: %.8 = assoc_entity element0, %F.decl [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -400,31 +401,31 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @SelfNested { -// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 0 [symbolic = constants.%Self.3] +// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 0 [symbolic = constants.%Self.3] // CHECK:STDOUT: %F.decl: %F.type.13 = fn_decl @F.13 [template = constants.%F.14] { -// CHECK:STDOUT: %Self.ref.loc188_12: %.9 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] +// CHECK:STDOUT: %Self.ref.loc188_12: %.10 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_16.1: type = facet_type_access %Self.ref.loc188_12 [symbolic = @F.13.%Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_16.2: type = converted %Self.ref.loc188_12, %.loc188_16.1 [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_16.3: type = ptr_type %Self.3 [symbolic = @F.13.%.1 (constants.%.10)] -// CHECK:STDOUT: %Self.ref.loc188_24: %.9 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] +// CHECK:STDOUT: %.loc188_16.3: type = ptr_type %Self.3 [symbolic = @F.13.%.1 (constants.%.11)] +// CHECK:STDOUT: %Self.ref.loc188_24: %.10 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_24.1: type = facet_type_access %Self.ref.loc188_24 [symbolic = @F.13.%Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_24.2: type = converted %Self.ref.loc188_24, %.loc188_24.1 [symbolic = @F.13.%Self (constants.%Self.3)] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc188_34.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc188_34.2: type = converted %int.make_type_32, %.loc188_34.1 [template = i32] -// CHECK:STDOUT: %.loc188_37: type = struct_type {.x: %Self.3, .y: i32} [symbolic = @F.13.%.2 (constants.%.11)] -// CHECK:STDOUT: %.loc188_38.1: %.12 = tuple_literal (%.loc188_16.3, %.loc188_37) -// CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%.13 [symbolic = @F.13.%.3 (constants.%.13)] -// CHECK:STDOUT: %x.loc188_8.1: @F.13.%.3 (%.13) = param x, runtime_param0 -// CHECK:STDOUT: %x.loc188_8.2: @F.13.%.3 (%.13) = bind_name x, %x.loc188_8.1 -// CHECK:STDOUT: %Self.ref.loc188_45: %.9 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_51: i32 = int_literal 4 [template = constants.%.14] +// CHECK:STDOUT: %.loc188_37: type = struct_type {.x: %Self.3, .y: i32} [symbolic = @F.13.%.2 (constants.%.12)] +// CHECK:STDOUT: %.loc188_38.1: %.13 = tuple_literal (%.loc188_16.3, %.loc188_37) +// CHECK:STDOUT: %.loc188_38.2: type = converted %.loc188_38.1, constants.%.14 [symbolic = @F.13.%.3 (constants.%.14)] +// CHECK:STDOUT: %x.loc188_8.1: @F.13.%.3 (%.14) = param x, runtime_param0 +// CHECK:STDOUT: %x.loc188_8.2: @F.13.%.3 (%.14) = bind_name x, %x.loc188_8.1 +// CHECK:STDOUT: %Self.ref.loc188_45: %.10 = name_ref Self, %Self [symbolic = @F.13.%Self (constants.%Self.3)] +// CHECK:STDOUT: %.loc188_51: i32 = int_literal 4 [template = constants.%.15] // CHECK:STDOUT: %.loc188_45.1: type = facet_type_access %Self.ref.loc188_45 [symbolic = @F.13.%Self (constants.%Self.3)] // CHECK:STDOUT: %.loc188_45.2: type = converted %Self.ref.loc188_45, %.loc188_45.1 [symbolic = @F.13.%Self (constants.%Self.3)] -// CHECK:STDOUT: %.loc188_52: type = array_type %.loc188_51, %Self.3 [symbolic = @F.13.%.4 (constants.%.15)] -// CHECK:STDOUT: %return.var: ref @F.13.%.4 (%.15) = var +// CHECK:STDOUT: %.loc188_52: type = array_type %.loc188_51, %Self.3 [symbolic = @F.13.%.4 (constants.%.16)] +// CHECK:STDOUT: %return.var: ref @F.13.%.4 (%.16) = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc188_53: %.16 = assoc_entity element0, %F.decl [template = constants.%.17] +// CHECK:STDOUT: %.loc188_53: %.17 = assoc_entity element0, %F.decl [template = constants.%.18] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -500,7 +501,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc81 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: %FMissingParam as %.6 { +// CHECK:STDOUT: impl @impl.7: %FMissingParam as %.7 { // CHECK:STDOUT: %F.decl: %F.type.6 = fn_decl @F.6 [template = constants.%F.7] { // CHECK:STDOUT: %bool.make_type.loc104_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc104_16.1: type = value_of_initializer %bool.make_type.loc104_16 [template = bool] @@ -519,7 +520,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc96 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.8: %FMissingImplicitParam as %.6 { +// CHECK:STDOUT: impl @impl.8: %FMissingImplicitParam as %.7 { // CHECK:STDOUT: %F.decl: %F.type.7 = fn_decl @F.7 [template = constants.%F.8] { // CHECK:STDOUT: %bool.make_type.loc117_13: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc117_13.1: type = value_of_initializer %bool.make_type.loc117_13 [template = bool] @@ -538,7 +539,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc109 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.9: %FMissingReturnType as %.6 { +// CHECK:STDOUT: impl @impl.9: %FMissingReturnType as %.7 { // CHECK:STDOUT: %F.decl: %F.type.8 = fn_decl @F.8 [template = constants.%F.9] { // CHECK:STDOUT: %bool.make_type.loc130_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc130_16.1: type = value_of_initializer %bool.make_type.loc130_16 [template = bool] @@ -558,7 +559,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc122 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.10: %FDifferentParamType as %.6 { +// CHECK:STDOUT: impl @impl.10: %FDifferentParamType as %.7 { // CHECK:STDOUT: %F.decl: %F.type.9 = fn_decl @F.9 [template = constants.%F.10] { // CHECK:STDOUT: %bool.make_type.loc143_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc143_16.1: type = value_of_initializer %bool.make_type.loc143_16 [template = bool] @@ -580,7 +581,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc135 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.11: %FDifferentImplicitParamType as %.6 { +// CHECK:STDOUT: impl @impl.11: %FDifferentImplicitParamType as %.7 { // CHECK:STDOUT: %F.decl: %F.type.10 = fn_decl @F.10 [template = constants.%F.11] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] // CHECK:STDOUT: %self.loc156_10.1: %FDifferentImplicitParamType = param self, runtime_param0 @@ -602,7 +603,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc148 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.12: %FDifferentReturnType as %.6 { +// CHECK:STDOUT: impl @impl.12: %FDifferentReturnType as %.7 { // CHECK:STDOUT: %F.decl: %F.type.11 = fn_decl @F.11 [template = constants.%F.12] { // CHECK:STDOUT: %bool.make_type.loc169_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc169_16.1: type = value_of_initializer %bool.make_type.loc169_16 [template = bool] @@ -624,7 +625,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc161 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.13: %FDifferentParamName as %.6 { +// CHECK:STDOUT: impl @impl.13: %FDifferentParamName as %.7 { // CHECK:STDOUT: %F.decl: %F.type.12 = fn_decl @F.12 [template = constants.%F.13] { // CHECK:STDOUT: %bool.make_type.loc183_16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc183_16.1: type = value_of_initializer %bool.make_type.loc183_16 [template = bool] @@ -648,25 +649,25 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc175 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.14: %SelfNestedBadParam as %.9 { +// CHECK:STDOUT: impl @impl.14: %SelfNestedBadParam as %.10 { // CHECK:STDOUT: %F.decl: %F.type.14 = fn_decl @F.14 [template = constants.%F.15] { // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_14: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.18] +// CHECK:STDOUT: %.loc200_32: type = ptr_type %SelfNestedBadParam [template = constants.%.19] // CHECK:STDOUT: %int.make_type_32.loc200_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc200_40.1: type = value_of_initializer %int.make_type_32.loc200_40 [template = i32] // CHECK:STDOUT: %.loc200_40.2: type = converted %int.make_type_32.loc200_40, %.loc200_40.1 [template = i32] // CHECK:STDOUT: %int.make_type_32.loc200_49: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc200_49.1: type = value_of_initializer %int.make_type_32.loc200_49 [template = i32] // CHECK:STDOUT: %.loc200_49.2: type = converted %int.make_type_32.loc200_49, %.loc200_49.1 [template = i32] -// CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.19] -// CHECK:STDOUT: %.loc200_53.1: %.12 = tuple_literal (%.loc200_32, %.loc200_52) -// CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%.20 [template = constants.%.20] -// CHECK:STDOUT: %x.loc200_10.1: %.20 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc200_10.2: %.20 = bind_name x, %x.loc200_10.1 +// CHECK:STDOUT: %.loc200_52: type = struct_type {.x: i32, .y: i32} [template = constants.%.20] +// CHECK:STDOUT: %.loc200_53.1: %.13 = tuple_literal (%.loc200_32, %.loc200_52) +// CHECK:STDOUT: %.loc200_53.2: type = converted %.loc200_53.1, constants.%.21 [template = constants.%.21] +// CHECK:STDOUT: %x.loc200_10.1: %.21 = param x, runtime_param0 +// CHECK:STDOUT: %x.loc200_10.2: %.21 = bind_name x, %x.loc200_10.1 // CHECK:STDOUT: %SelfNestedBadParam.ref.loc200_60: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc200_80: i32 = int_literal 4 [template = constants.%.14] -// CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.21] -// CHECK:STDOUT: %return.var: ref %.21 = var +// CHECK:STDOUT: %.loc200_80: i32 = int_literal 4 [template = constants.%.15] +// CHECK:STDOUT: %.loc200_81: type = array_type %.loc200_80, %SelfNestedBadParam [template = constants.%.22] +// CHECK:STDOUT: %return.var: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc192: = interface_witness () [template = ] // CHECK:STDOUT: @@ -675,23 +676,23 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: witness = %.loc192 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.15: %SelfNestedBadReturnType as %.9 { +// CHECK:STDOUT: impl @impl.15: %SelfNestedBadReturnType as %.10 { // CHECK:STDOUT: %F.decl: %F.type.15 = fn_decl @F.15 [template = constants.%F.16] { // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_14: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] -// CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.24] +// CHECK:STDOUT: %.loc212_37: type = ptr_type %SelfNestedBadReturnType [template = constants.%.25] // CHECK:STDOUT: %SelfNestedBadReturnType.ref.loc212_45: type = name_ref SelfNestedBadReturnType, file.%SelfNestedBadReturnType.decl [template = constants.%SelfNestedBadReturnType] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc212_74.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc212_74.2: type = converted %int.make_type_32, %.loc212_74.1 [template = i32] -// CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.25] -// CHECK:STDOUT: %.loc212_78.1: %.12 = tuple_literal (%.loc212_37, %.loc212_77) -// CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%.26 [template = constants.%.26] -// CHECK:STDOUT: %x.loc212_10.1: %.26 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc212_10.2: %.26 = bind_name x, %x.loc212_10.1 +// CHECK:STDOUT: %.loc212_77: type = struct_type {.x: %SelfNestedBadReturnType, .y: i32} [template = constants.%.26] +// CHECK:STDOUT: %.loc212_78.1: %.13 = tuple_literal (%.loc212_37, %.loc212_77) +// CHECK:STDOUT: %.loc212_78.2: type = converted %.loc212_78.1, constants.%.27 [template = constants.%.27] +// CHECK:STDOUT: %x.loc212_10.1: %.27 = param x, runtime_param0 +// CHECK:STDOUT: %x.loc212_10.2: %.27 = bind_name x, %x.loc212_10.1 // CHECK:STDOUT: %SelfNestedBadParam.ref: type = name_ref SelfNestedBadParam, file.%SelfNestedBadParam.decl [template = constants.%SelfNestedBadParam] -// CHECK:STDOUT: %.loc212_105: i32 = int_literal 4 [template = constants.%.14] -// CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.21] -// CHECK:STDOUT: %return.var: ref %.21 = var +// CHECK:STDOUT: %.loc212_105: i32 = int_literal 4 [template = constants.%.15] +// CHECK:STDOUT: %.loc212_106: type = array_type %.loc212_105, %SelfNestedBadParam [template = constants.%.22] +// CHECK:STDOUT: %return.var: ref %.22 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc205: = interface_witness () [template = ] // CHECK:STDOUT: @@ -704,6 +705,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc22: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%NoF @@ -713,6 +715,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc35: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FNotFunction @@ -724,6 +727,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl_decl @impl.3 { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc51: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FAlias @@ -733,6 +737,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl_decl @impl.4 { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc64: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FExtraParam @@ -742,6 +747,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl_decl @impl.5 { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc77: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FExtraImplicitParam @@ -751,6 +757,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: impl_decl @impl.6 { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc91: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FExtraReturnType @@ -758,8 +765,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @FMissingParam { // CHECK:STDOUT: impl_decl @impl.7 { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.6] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc106: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FMissingParam @@ -767,8 +775,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @FMissingImplicitParam { // CHECK:STDOUT: impl_decl @impl.8 { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.6] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc119: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FMissingImplicitParam @@ -776,8 +785,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @FMissingReturnType { // CHECK:STDOUT: impl_decl @impl.9 { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.6] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc132: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FMissingReturnType @@ -785,8 +795,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @FDifferentParamType { // CHECK:STDOUT: impl_decl @impl.10 { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.6] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc145: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FDifferentParamType @@ -794,8 +805,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @FDifferentImplicitParamType { // CHECK:STDOUT: impl_decl @impl.11 { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.6] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc158: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FDifferentImplicitParamType @@ -803,8 +815,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @FDifferentReturnType { // CHECK:STDOUT: impl_decl @impl.12 { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.6] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc171: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FDifferentReturnType @@ -812,8 +825,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @FDifferentParamName { // CHECK:STDOUT: impl_decl @impl.13 { -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.6] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [template = constants.%.7] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc185: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%FDifferentParamName @@ -821,8 +835,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @SelfNestedBadParam { // CHECK:STDOUT: impl_decl @impl.14 { -// CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.9] +// CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc202: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SelfNestedBadParam @@ -830,8 +845,9 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: class @SelfNestedBadReturnType { // CHECK:STDOUT: impl_decl @impl.15 { -// CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.9] +// CHECK:STDOUT: %SelfNested.ref: type = name_ref SelfNested, file.%SelfNested.decl [template = constants.%.10] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc214: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%SelfNestedBadReturnType @@ -852,7 +868,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: fn @F.4() -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.5(@J.%Self: %.6) { +// CHECK:STDOUT: generic fn @F.5(@J.%Self: %.7) { // CHECK:STDOUT: // CHECK:STDOUT: fn[@J.%self.loc93_20.2: bool](@J.%b.loc93_32.2: bool) -> bool; // CHECK:STDOUT: } @@ -873,19 +889,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.13(@SelfNested.%Self: %.9) { -// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %.1: type = ptr_type @F.13.%Self (%Self.3) [symbolic = %.1 (constants.%.10)] -// CHECK:STDOUT: %.2: type = struct_type {.x: @F.13.%Self (%Self.3), .y: i32} [symbolic = %.2 (constants.%.11)] -// CHECK:STDOUT: %.3: type = tuple_type (@F.13.%.1 (%.10), @F.13.%.2 (%.11)) [symbolic = %.3 (constants.%.13)] -// CHECK:STDOUT: %.4: type = array_type constants.%.14, @F.13.%Self (%Self.3) [symbolic = %.4 (constants.%.15)] +// CHECK:STDOUT: generic fn @F.13(@SelfNested.%Self: %.10) { +// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.1: type = ptr_type @F.13.%Self (%Self.3) [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @F.13.%Self (%Self.3), .y: i32} [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %.3: type = tuple_type (@F.13.%.1 (%.11), @F.13.%.2 (%.12)) [symbolic = %.3 (constants.%.14)] +// CHECK:STDOUT: %.4: type = array_type constants.%.15, @F.13.%Self (%Self.3) [symbolic = %.4 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@SelfNested.%x.loc188_8.2: @F.13.%.3 (%.13)) -> @F.13.%.4 (%.15); +// CHECK:STDOUT: fn(@SelfNested.%x.loc188_8.2: @F.13.%.3 (%.14)) -> @F.13.%.4 (%.16); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.14(@impl.14.%x.loc200_10.2: %.20) -> %.21; +// CHECK:STDOUT: fn @F.14(@impl.14.%x.loc200_10.2: %.21) -> %.22; // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.15(@impl.15.%x.loc212_10.2: %.26) -> %.21; +// CHECK:STDOUT: fn @F.15(@impl.15.%x.loc212_10.2: %.27) -> %.22; // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.1) {} // CHECK:STDOUT: @@ -913,25 +929,25 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.13(constants.%Self.3) { // CHECK:STDOUT: %Self => constants.%Self.3 -// CHECK:STDOUT: %.1 => constants.%.10 -// CHECK:STDOUT: %.2 => constants.%.11 -// CHECK:STDOUT: %.3 => constants.%.13 -// CHECK:STDOUT: %.4 => constants.%.15 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: %.3 => constants.%.14 +// CHECK:STDOUT: %.4 => constants.%.16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.13(constants.%SelfNestedBadParam) { // CHECK:STDOUT: %Self => constants.%SelfNestedBadParam -// CHECK:STDOUT: %.1 => constants.%.18 -// CHECK:STDOUT: %.2 => constants.%.22 -// CHECK:STDOUT: %.3 => constants.%.23 -// CHECK:STDOUT: %.4 => constants.%.21 +// CHECK:STDOUT: %.1 => constants.%.19 +// CHECK:STDOUT: %.2 => constants.%.23 +// CHECK:STDOUT: %.3 => constants.%.24 +// CHECK:STDOUT: %.4 => constants.%.22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.13(constants.%SelfNestedBadReturnType) { // CHECK:STDOUT: %Self => constants.%SelfNestedBadReturnType -// CHECK:STDOUT: %.1 => constants.%.24 -// CHECK:STDOUT: %.2 => constants.%.25 -// CHECK:STDOUT: %.3 => constants.%.26 -// CHECK:STDOUT: %.4 => constants.%.27 +// CHECK:STDOUT: %.1 => constants.%.25 +// CHECK:STDOUT: %.2 => constants.%.26 +// CHECK:STDOUT: %.3 => constants.%.27 +// CHECK:STDOUT: %.4 => constants.%.28 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index cc4c36206353f..716f291378530 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -36,7 +36,8 @@ class C { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: = interface_witness (%F.2) [template] // CHECK:STDOUT: %.6: type = struct_type {} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,6 +89,7 @@ class C { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, file.%Simple.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc22: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index 73ba2e16e0101..d905b6b784039 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -37,12 +37,13 @@ fn G(c: C) { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -92,7 +93,7 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} -// CHECK:STDOUT: %.loc19: = interface_witness (%F.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc19: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -103,6 +104,7 @@ fn G(c: C) { // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%HasF.decl [template = constants.%.1] // CHECK:STDOUT: %F.ref: %.3 = name_ref F, @HasF.%.loc12 [template = constants.%.4] // CHECK:STDOUT: %G: %.3 = bind_alias G, @HasF.%.loc12 [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon index 37172c9869f2d..30754ddd64b99 100644 --- a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon @@ -40,9 +40,10 @@ fn F(c: C) { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -90,6 +91,7 @@ fn F(c: C) { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: %F.ref: %.3 = name_ref F, @I.%.loc12 [template = constants.%.4] // CHECK:STDOUT: %F: %.3 = bind_alias F, @I.%.loc12 [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 60f95741d66a6..24150ca5965aa 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -40,14 +40,15 @@ impl C as I { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @I.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.7: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %.8: = interface_witness (%F.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -100,7 +101,7 @@ impl C as I { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} -// CHECK:STDOUT: %.loc27: = interface_witness (%F.decl) [template = constants.%.7] +// CHECK:STDOUT: %.loc27: = interface_witness (%F.decl) [template = constants.%.8] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -111,6 +112,7 @@ impl C as I { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc17: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index a1df36d788418..914a261bdab7e 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -42,9 +42,10 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -88,7 +89,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} -// CHECK:STDOUT: %.loc10: = interface_witness (%F.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc10: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -96,6 +97,8 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc8: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -119,19 +122,20 @@ fn G(c: Impl.C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @HasF [template] -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @HasF [template] +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.2, %F.type.1 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.3, %F.type.1 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.8: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -152,11 +156,11 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref Impl//default, inst+15, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Impl//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.5 = import_ref Impl//default, inst+12, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Impl//default, inst+12, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.4 = import_ref Impl//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Impl//default, inst+23, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5: = import_ref Impl//default, inst+25, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.6: type = import_ref Impl//default, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.7: type = import_ref Impl//default, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7: type = import_ref Impl//default, inst+3, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.8 = import_ref Impl//default, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -183,7 +187,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = imports.%import_ref.5 // CHECK:STDOUT: } @@ -197,14 +201,14 @@ fn G(c: Impl.C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] -// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.2] -// CHECK:STDOUT: %F.ref: %.5 = name_ref F, imports.%import_ref.3 [template = constants.%.6] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.3] +// CHECK:STDOUT: %F.ref: %.6 = name_ref F, imports.%import_ref.3 [template = constants.%.7] // CHECK:STDOUT: %.loc5: %F.type.1 = interface_witness_access imports.%import_ref.5, element0 [template = constants.%F.2] -// CHECK:STDOUT: %F.call: init %.3 = call %.loc5() +// CHECK:STDOUT: %F.call: init %.4 = call %.loc5() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%Self: %.2) { +// CHECK:STDOUT: generic fn @F.1(constants.%Self: %.3) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 27d12030f844f..5d9b0656866e6 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -41,9 +41,10 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: = interface_witness (%F.2) [template] // CHECK:STDOUT: %.6: type = struct_type {} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -125,6 +126,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc21: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index 45439134cbc72..aad01da1bf5e0 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -42,9 +42,10 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @HasF.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -73,7 +74,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} -// CHECK:STDOUT: %.loc10: = interface_witness (%F.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc10: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -81,6 +82,8 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc8: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -104,19 +107,20 @@ fn G(c: Impl.C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @HasF [template] -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @HasF [template] +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.2, %F.type.1 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.3, %F.type.1 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.8: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -127,11 +131,11 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref Impl//default, inst+13, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Impl//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.5 = import_ref Impl//default, inst+10, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Impl//default, inst+10, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.4 = import_ref Impl//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref Impl//default, inst+21, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5: = import_ref Impl//default, inst+23, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.6: type = import_ref Impl//default, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.7: type = import_ref Impl//default, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7: type = import_ref Impl//default, inst+1, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.8 = import_ref Impl//default, inst+5, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -156,7 +160,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = imports.%import_ref.5 // CHECK:STDOUT: } @@ -170,14 +174,14 @@ fn G(c: Impl.C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] -// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.2] -// CHECK:STDOUT: %F.ref: %.5 = name_ref F, imports.%import_ref.3 [template = constants.%.6] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.3] +// CHECK:STDOUT: %F.ref: %.6 = name_ref F, imports.%import_ref.3 [template = constants.%.7] // CHECK:STDOUT: %.loc5: %F.type.1 = interface_witness_access imports.%import_ref.5, element0 [template = constants.%F.2] -// CHECK:STDOUT: %F.call: init %.3 = call %.loc5() +// CHECK:STDOUT: %F.call: init %.4 = call %.loc5() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%Self: %.2) { +// CHECK:STDOUT: generic fn @F.1(constants.%Self: %.3) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/basic.carbon b/toolchain/check/testdata/impl/no_prelude/basic.carbon index 716e20c3cb6b4..774ef61a0661c 100644 --- a/toolchain/check/testdata/impl/no_prelude/basic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/basic.carbon @@ -30,9 +30,10 @@ impl C as Simple { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @Simple.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -61,7 +62,7 @@ impl C as Simple { // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.1 { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} -// CHECK:STDOUT: %.loc17: = interface_witness (%F.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc17: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -69,6 +70,8 @@ impl C as Simple { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index c7960491d75d1..91d56bce6c9b8 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -93,19 +93,20 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @Action.%Op.decl [symbolic] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.6: type = interface_type @Action, @Action(%B) [template] +// CHECK:STDOUT: %.7: type = interface_type @Action, @Action(%B) [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.1, @Action(%B) [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.6, %Op.type.3 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, @Action.%Op.decl [template] -// CHECK:STDOUT: %.9: = interface_witness (%Op.2) [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Op.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, @Action.%Op.decl [template] +// CHECK:STDOUT: %.10: = interface_witness (%Op.2) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.11: type = ptr_type %.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -127,7 +128,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %A.ref.loc12: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %Action.ref: %Action.type = name_ref Action, %Action.decl [template = constants.%Action] // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc12: type = interface_type @Action, @Action(constants.%B) [template = constants.%.6] +// CHECK:STDOUT: %.loc12: type = interface_type @Action, @Action(constants.%B) [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %A.ref.loc16: type = name_ref A, %A.decl [template = constants.%A] @@ -159,9 +160,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %A as %.6 { +// CHECK:STDOUT: impl @impl: %A as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] {} -// CHECK:STDOUT: %.loc12: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc12: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -169,16 +170,22 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc8: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc9: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc10: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -198,9 +205,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Action.ref: %Action.type = name_ref Action, file.%Action.decl [template = constants.%Action] // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc16_23: type = interface_type @Action, @Action(constants.%B) [template = constants.%.6] -// CHECK:STDOUT: %.loc16_26: %.7 = specific_constant @Action.%.loc5, @Action(constants.%B) [template = constants.%.8] -// CHECK:STDOUT: %Op.ref: %.7 = name_ref Op, %.loc16_26 [template = constants.%.8] +// CHECK:STDOUT: %.loc16_23: type = interface_type @Action, @Action(constants.%B) [template = constants.%.7] +// CHECK:STDOUT: %.loc16_26: %.8 = specific_constant @Action.%.loc5, @Action(constants.%B) [template = constants.%.9] +// CHECK:STDOUT: %Op.ref: %.8 = name_ref Op, %.loc16_26 [template = constants.%.9] // CHECK:STDOUT: %.loc16_15: %Op.type.3 = interface_witness_access @impl.%.loc12, element0 [template = constants.%Op.2] // CHECK:STDOUT: %Op.call: init %.1 = call %.loc16_15() // CHECK:STDOUT: return @@ -220,12 +227,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.1 => constants.%.7 // CHECK:STDOUT: %Self.2 => constants.%Self // CHECK:STDOUT: %Op.type => constants.%Op.type.3 // CHECK:STDOUT: %Op => constants.%Op.3 -// CHECK:STDOUT: %.2 => constants.%.7 -// CHECK:STDOUT: %.3 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.3 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%B, constants.%A) {} @@ -235,46 +242,47 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %Action.type: type = generic_interface_type @Action [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Action: %Action.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] -// CHECK:STDOUT: %.3: type = interface_type @Action, @Action(%T) [symbolic] -// CHECK:STDOUT: %Self.1: @Action.%.1 (%.3) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @Action, @Action(%B) [template] -// CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: type = interface_type @Action, @Action(%T) [symbolic] +// CHECK:STDOUT: %Self.1: @Action.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @Action, @Action(%B) [template] +// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1, @Action(%T) [symbolic] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.3, %Op.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.11 [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.4, %Op.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [symbolic] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.1, @Action(%B) [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.4, %Op.type.2 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.5, %Op.type.2 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.12 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.10: %.5 = assoc_entity element0, imports.%import_ref.14 [symbolic] +// CHECK:STDOUT: %.10: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.11: %.6 = assoc_entity element0, imports.%import_ref.14 [symbolic] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] -// CHECK:STDOUT: %.11: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.12: = interface_witness (%Op.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Action.type = import_ref Main//action, inst+4, loaded [template = constants.%Action] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+24, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, inst+27, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//action, inst+29, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+50, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, inst+29, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//action, inst+32, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+54, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+25, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+28, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+30, unloaded // CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+10, unloaded -// CHECK:STDOUT: %import_ref.9: @Action.%.2 (%.5) = import_ref Main//action, inst+16, loaded [symbolic = @Action.%.3 (constants.%.10)] +// CHECK:STDOUT: %import_ref.9: @Action.%.2 (%.6) = import_ref Main//action, inst+16, loaded [symbolic = @Action.%.3 (constants.%.11)] // CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+12, unloaded // CHECK:STDOUT: %import_ref.11 = import_ref Main//action, inst+12, unloaded // CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+12, unloaded -// CHECK:STDOUT: %import_ref.13: = import_ref Main//action, inst+44, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.13: = import_ref Main//action, inst+48, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -300,12 +308,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Action, @Action(%T) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @Action, @Action(%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @Action(%T) [symbolic = %Op.type (constants.%Op.type.1)] // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.1) = struct_value () [symbolic = %Op (constants.%Op.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @Action.%.1 (%.3), @Action.%Op.type (%Op.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @Action.%.2 (%.5) = assoc_entity element0, imports.%import_ref.11 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @Action.%.1 (%.4), @Action.%Op.type (%Op.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @Action.%.2 (%.6) = assoc_entity element0, imports.%import_ref.11 [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -315,7 +323,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %A as %.4 { +// CHECK:STDOUT: impl @impl: %A as %.5 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } @@ -330,7 +338,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(constants.%T: type, constants.%Self.1: @Action.%.1 (%.3)) { +// CHECK:STDOUT: generic fn @Op.1(constants.%T: type, constants.%Self.1: @Action.%.1 (%.4)) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } @@ -340,11 +348,11 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Action.ref: %Action.type = name_ref Action, imports.%import_ref.1 [template = constants.%Action] // CHECK:STDOUT: %B.ref: type = name_ref B, imports.%import_ref.3 [template = constants.%B] -// CHECK:STDOUT: %.loc4_23: type = interface_type @Action, @Action(constants.%B) [template = constants.%.4] -// CHECK:STDOUT: %.loc4_26: %.7 = specific_constant imports.%import_ref.9, @Action(constants.%B) [template = constants.%.8] -// CHECK:STDOUT: %Op.ref: %.7 = name_ref Op, %.loc4_26 [template = constants.%.8] +// CHECK:STDOUT: %.loc4_23: type = interface_type @Action, @Action(constants.%B) [template = constants.%.5] +// CHECK:STDOUT: %.loc4_26: %.8 = specific_constant imports.%import_ref.9, @Action(constants.%B) [template = constants.%.9] +// CHECK:STDOUT: %Op.ref: %.8 = name_ref Op, %.loc4_26 [template = constants.%.9] // CHECK:STDOUT: %.loc4_15: %Op.type.2 = interface_witness_access imports.%import_ref.13, element0 [template = constants.%Op.3] -// CHECK:STDOUT: %Op.call: init %.2 = call %.loc4_15() +// CHECK:STDOUT: %Op.call: init %.3 = call %.loc4_15() // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -358,12 +366,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Op.type => constants.%Op.type.2 // CHECK:STDOUT: %Op => constants.%Op.2 -// CHECK:STDOUT: %.2 => constants.%.7 -// CHECK:STDOUT: %.3 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.3 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(@Action.%T) { @@ -377,50 +385,51 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %Action.type: type = generic_interface_type @Action [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Action: %Action.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] -// CHECK:STDOUT: %.3: type = interface_type @Action, @Action(%T) [symbolic] -// CHECK:STDOUT: %Self.1: @Action.%.1 (%.3) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @Action, @Action(%B) [template] -// CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: type = interface_type @Action, @Action(%T) [symbolic] +// CHECK:STDOUT: %Self.1: @Action.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @Action, @Action(%B) [template] +// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op, @Action(%T) [symbolic] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.3, %Op.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.11 [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.4, %Op.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [symbolic] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op, @Action(%B) [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.4, %Op.type.2 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.5, %Op.type.2 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.12 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.10: type = ptr_type %.1 [template] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.10: type = interface_type @Action, @Action(%C) [template] +// CHECK:STDOUT: %.11: type = interface_type @Action, @Action(%C) [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op, @Action(%C) [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %Op.type.3 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.11 [template] -// CHECK:STDOUT: %.13: %.5 = assoc_entity element0, imports.%import_ref.15 [symbolic] +// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Op.type.3 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.14: %.6 = assoc_entity element0, imports.%import_ref.15 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Action.type = import_ref Main//action, inst+4, loaded [template = constants.%Action] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//action, inst+24, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//action, inst+27, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, inst+29, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+50, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//action, inst+29, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, inst+32, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+54, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+25, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+28, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+30, unloaded // CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+10, unloaded -// CHECK:STDOUT: %import_ref.9: @Action.%.2 (%.5) = import_ref Main//action, inst+16, loaded [symbolic = @Action.%.3 (constants.%.13)] +// CHECK:STDOUT: %import_ref.9: @Action.%.2 (%.6) = import_ref Main//action, inst+16, loaded [symbolic = @Action.%.3 (constants.%.14)] // CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+12, unloaded // CHECK:STDOUT: %import_ref.11 = import_ref Main//action, inst+12, unloaded // CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+12, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst+44, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+30, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst+48, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+33, unloaded // CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -446,12 +455,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Action, @Action(%T) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @Action, @Action(%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Op.type: type = fn_type @Op, @Action(%T) [symbolic = %Op.type (constants.%Op.type.1)] // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.1) = struct_value () [symbolic = %Op (constants.%Op.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @Action.%.1 (%.3), @Action.%Op.type (%Op.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @Action.%.2 (%.5) = assoc_entity element0, imports.%import_ref.11 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @Action.%.1 (%.4), @Action.%Op.type (%Op.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @Action.%.2 (%.6) = assoc_entity element0, imports.%import_ref.11 [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -461,7 +470,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %A as %.4 { +// CHECK:STDOUT: impl @impl: %A as %.5 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } @@ -481,7 +490,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op(constants.%T: type, constants.%Self.1: @Action.%.1 (%.3)) { +// CHECK:STDOUT: generic fn @Op(constants.%T: type, constants.%Self.1: @Action.%.1 (%.4)) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } @@ -491,9 +500,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Action.ref: %Action.type = name_ref Action, imports.%import_ref.1 [template = constants.%Action] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.4 [template = constants.%C] -// CHECK:STDOUT: %.loc8_23: type = interface_type @Action, @Action(constants.%C) [template = constants.%.10] -// CHECK:STDOUT: %.loc8_26: %.11 = specific_constant imports.%import_ref.9, @Action(constants.%C) [template = constants.%.12] -// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, %.loc8_26 [template = constants.%.12] +// CHECK:STDOUT: %.loc8_23: type = interface_type @Action, @Action(constants.%C) [template = constants.%.11] +// CHECK:STDOUT: %.loc8_26: %.12 = specific_constant imports.%import_ref.9, @Action(constants.%C) [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, %.loc8_26 [template = constants.%.13] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -505,12 +514,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Op.type => constants.%Op.type.2 // CHECK:STDOUT: %Op => constants.%Op.2 -// CHECK:STDOUT: %.2 => constants.%.7 -// CHECK:STDOUT: %.3 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.3 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Action(@Action.%T) { @@ -523,12 +532,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Op.type => constants.%Op.type.3 // CHECK:STDOUT: %Op => constants.%Op.3 -// CHECK:STDOUT: %.2 => constants.%.11 -// CHECK:STDOUT: %.3 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: %.3 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- factory.carbon @@ -546,15 +555,16 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @Factory.%Make.decl [symbolic] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.6: type = interface_type @Factory, @Factory(%B) [template] +// CHECK:STDOUT: %.7: type = interface_type @Factory, @Factory(%B) [template] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make.1, @Factory(%B) [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.6, %Make.type.3 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, @Factory.%Make.decl [template] -// CHECK:STDOUT: %.9: = interface_witness (%Make.2) [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Make.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, @Factory.%Make.decl [template] +// CHECK:STDOUT: %.10: = interface_witness (%Make.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -573,7 +583,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %Factory.ref: %Factory.type = name_ref Factory, %Factory.decl [template = constants.%Factory] // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc11: type = interface_type @Factory, @Factory(constants.%B) [template = constants.%.6] +// CHECK:STDOUT: %.loc11: type = interface_type @Factory, @Factory(constants.%B) [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -603,12 +613,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %A as %.6 { +// CHECK:STDOUT: impl @impl: %A as %.7 { // CHECK:STDOUT: %Make.decl: %Make.type.2 = fn_decl @Make.2 [template = constants.%Make.2] { // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [template = constants.%B] // CHECK:STDOUT: %return.var: ref %B = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11: = interface_witness (%Make.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc11: = interface_witness (%Make.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Make = %Make.decl @@ -616,11 +626,15 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc8: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc9: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } @@ -649,12 +663,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.1 => constants.%.7 // CHECK:STDOUT: %Self.2 => constants.%Self // CHECK:STDOUT: %Make.type => constants.%Make.type.3 // CHECK:STDOUT: %Make => constants.%Make.3 -// CHECK:STDOUT: %.2 => constants.%.7 -// CHECK:STDOUT: %.3 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.3 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Make.1(constants.%B, constants.%A) { @@ -666,44 +680,45 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %Factory.type: type = generic_interface_type @Factory [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Factory: %Factory.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] -// CHECK:STDOUT: %.3: type = interface_type @Factory, @Factory(%T) [symbolic] -// CHECK:STDOUT: %Self.1: @Factory.%.1 (%.3) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @Factory, @Factory(%B) [template] -// CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: type = interface_type @Factory, @Factory(%T) [symbolic] +// CHECK:STDOUT: %Self.1: @Factory.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @Factory, @Factory(%B) [template] +// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Make.type.1: type = fn_type @Make.1, @Factory(%T) [symbolic] // CHECK:STDOUT: %Make.1: %Make.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.3, %Make.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.9 [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.4, %Make.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.9 [symbolic] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make.1, @Factory(%B) [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.4, %Make.type.2 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.5, %Make.type.2 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %MakeB.type: type = fn_type @MakeB [template] // CHECK:STDOUT: %MakeB: %MakeB.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.10: %.5 = assoc_entity element0, imports.%import_ref.12 [symbolic] +// CHECK:STDOUT: %.10: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.11: %.6 = assoc_entity element0, imports.%import_ref.12 [symbolic] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] -// CHECK:STDOUT: %.11: = interface_witness (%Make.3) [template] +// CHECK:STDOUT: %.12: = interface_witness (%Make.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Factory.type = import_ref Main//factory, inst+4, loaded [template = constants.%Factory] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+27, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, inst+30, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, inst+32, loaded [template = constants.%B] // CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+28, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+31, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+33, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+10, unloaded -// CHECK:STDOUT: %import_ref.7: @Factory.%.2 (%.5) = import_ref Main//factory, inst+19, loaded [symbolic = @Factory.%.3 (constants.%.10)] +// CHECK:STDOUT: %import_ref.7: @Factory.%.2 (%.6) = import_ref Main//factory, inst+19, loaded [symbolic = @Factory.%.3 (constants.%.11)] // CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+14, unloaded // CHECK:STDOUT: %import_ref.9 = import_ref Main//factory, inst+14, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.11: = import_ref Main//factory, inst+47, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.11: = import_ref Main//factory, inst+50, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -729,12 +744,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Factory, @Factory(%T) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @Factory, @Factory(%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Make.type: type = fn_type @Make.1, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.1)] // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @Factory.%.1 (%.3), @Factory.%Make.type (%Make.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @Factory.%.2 (%.5) = assoc_entity element0, imports.%import_ref.9 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @Factory.%.1 (%.4), @Factory.%Make.type (%Make.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @Factory.%.2 (%.6) = assoc_entity element0, imports.%import_ref.9 [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -744,7 +759,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %A as %.4 { +// CHECK:STDOUT: impl @impl: %A as %.5 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = imports.%import_ref.11 // CHECK:STDOUT: } @@ -759,7 +774,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make.1(constants.%T: type, constants.%Self.1: @Factory.%.1 (%.3)) { +// CHECK:STDOUT: generic fn @Make.1(constants.%T: type, constants.%Self.1: @Factory.%.1 (%.4)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> @Make.1.%T (%T); @@ -770,9 +785,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Factory.ref: %Factory.type = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory] // CHECK:STDOUT: %B.ref: type = name_ref B, imports.%import_ref.3 [template = constants.%B] -// CHECK:STDOUT: %.loc5_20: type = interface_type @Factory, @Factory(constants.%B) [template = constants.%.4] -// CHECK:STDOUT: %.loc5_23: %.7 = specific_constant imports.%import_ref.7, @Factory(constants.%B) [template = constants.%.8] -// CHECK:STDOUT: %Make.ref: %.7 = name_ref Make, %.loc5_23 [template = constants.%.8] +// CHECK:STDOUT: %.loc5_20: type = interface_type @Factory, @Factory(constants.%B) [template = constants.%.5] +// CHECK:STDOUT: %.loc5_23: %.8 = specific_constant imports.%import_ref.7, @Factory(constants.%B) [template = constants.%.9] +// CHECK:STDOUT: %Make.ref: %.8 = name_ref Make, %.loc5_23 [template = constants.%.9] // CHECK:STDOUT: %.loc5_11: %Make.type.2 = interface_witness_access imports.%import_ref.11, element0 [template = constants.%Make.3] // CHECK:STDOUT: %.loc4: ref %B = splice_block %return {} // CHECK:STDOUT: %Make.call: init %B = call %.loc5_11() to %.loc4 @@ -789,12 +804,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Make.type => constants.%Make.type.2 // CHECK:STDOUT: %Make => constants.%Make.2 -// CHECK:STDOUT: %.2 => constants.%.7 -// CHECK:STDOUT: %.3 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.3 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(@Factory.%T) { @@ -810,47 +825,48 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %Factory.type: type = generic_interface_type @Factory [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Factory: %Factory.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] -// CHECK:STDOUT: %.3: type = interface_type @Factory, @Factory(%T) [symbolic] -// CHECK:STDOUT: %Self.1: @Factory.%.1 (%.3) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @Factory, @Factory(%B) [template] -// CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: type = interface_type @Factory, @Factory(%T) [symbolic] +// CHECK:STDOUT: %Self.1: @Factory.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @Factory, @Factory(%B) [template] +// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Make.type.1: type = fn_type @Make, @Factory(%T) [symbolic] // CHECK:STDOUT: %Make.1: %Make.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.3, %Make.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.9 [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.4, %Make.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.9 [symbolic] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make, @Factory(%B) [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.4, %Make.type.2 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.5, %Make.type.2 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [template] // CHECK:STDOUT: %MakeC: %MakeC.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.10: type = interface_type @Factory, @Factory(%C) [template] +// CHECK:STDOUT: %.10: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.11: type = interface_type @Factory, @Factory(%C) [template] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make, @Factory(%C) [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %Make.type.3 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] -// CHECK:STDOUT: %.13: %.5 = assoc_entity element0, imports.%import_ref.12 [symbolic] +// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Make.type.3 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.14: %.6 = assoc_entity element0, imports.%import_ref.12 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Factory.type = import_ref Main//factory, inst+4, loaded [template = constants.%Factory] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+27, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, inst+30, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, inst+32, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+28, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+31, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+33, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+10, unloaded -// CHECK:STDOUT: %import_ref.7: @Factory.%.2 (%.5) = import_ref Main//factory, inst+19, loaded [symbolic = @Factory.%.3 (constants.%.13)] +// CHECK:STDOUT: %import_ref.7: @Factory.%.2 (%.6) = import_ref Main//factory, inst+19, loaded [symbolic = @Factory.%.3 (constants.%.14)] // CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+14, unloaded // CHECK:STDOUT: %import_ref.9 = import_ref Main//factory, inst+14, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst+47, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst+50, unloaded // CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -878,12 +894,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Factory, @Factory(%T) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @Factory, @Factory(%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.1)] // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @Factory.%.1 (%.3), @Factory.%Make.type (%Make.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @Factory.%.2 (%.5) = assoc_entity element0, imports.%import_ref.9 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @Factory.%.1 (%.4), @Factory.%Make.type (%Make.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @Factory.%.2 (%.6) = assoc_entity element0, imports.%import_ref.9 [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -893,7 +909,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %A as %.4 { +// CHECK:STDOUT: impl @impl: %A as %.5 { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = imports.%import_ref.11 // CHECK:STDOUT: } @@ -909,11 +925,13 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make(constants.%T: type, constants.%Self.1: @Factory.%.1 (%.3)) { +// CHECK:STDOUT: generic fn @Make(constants.%T: type, constants.%Self.1: @Factory.%.1 (%.4)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> @Make.%T (%T); @@ -924,9 +942,9 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %a.ref: %A = name_ref a, %a // CHECK:STDOUT: %Factory.ref: %Factory.type = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory] // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc10_20: type = interface_type @Factory, @Factory(constants.%C) [template = constants.%.10] -// CHECK:STDOUT: %.loc10_23: %.11 = specific_constant imports.%import_ref.7, @Factory(constants.%C) [template = constants.%.12] -// CHECK:STDOUT: %Make.ref: %.11 = name_ref Make, %.loc10_23 [template = constants.%.12] +// CHECK:STDOUT: %.loc10_20: type = interface_type @Factory, @Factory(constants.%C) [template = constants.%.11] +// CHECK:STDOUT: %.loc10_23: %.12 = specific_constant imports.%import_ref.7, @Factory(constants.%C) [template = constants.%.13] +// CHECK:STDOUT: %Make.ref: %.12 = name_ref Make, %.loc10_23 [template = constants.%.13] // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -938,12 +956,12 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%B // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Make.type => constants.%Make.type.2 // CHECK:STDOUT: %Make => constants.%Make.2 -// CHECK:STDOUT: %.2 => constants.%.7 -// CHECK:STDOUT: %.3 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.3 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Factory(@Factory.%T) { @@ -958,11 +976,11 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %T => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Make.type => constants.%Make.type.3 // CHECK:STDOUT: %Make => constants.%Make.3 -// CHECK:STDOUT: %.2 => constants.%.11 -// CHECK:STDOUT: %.3 => constants.%.12 +// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: %.3 => constants.%.13 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon b/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon index a461abbbdd404..0ff39a234adf9 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon +++ b/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon @@ -34,11 +34,12 @@ class A { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @DefaultConstructible.%Make.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: = interface_witness (%Make.2) [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.7: = interface_witness (%Make.2) [template] +// CHECK:STDOUT: %.8: type = ptr_type %.5 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -74,7 +75,7 @@ class A { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc18: = interface_witness (%Make.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc18: = interface_witness (%Make.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Make = %Make.decl @@ -82,6 +83,8 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -91,6 +94,7 @@ class A { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %DefaultConstructible.ref: type = name_ref DefaultConstructible, file.%DefaultConstructible.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc23: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon index 03ae456d0a405..75ef0e5251cc3 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon @@ -48,38 +48,39 @@ impl D as SelfNested { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @UseSelf.%F.decl [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.5: type = struct_type {} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: = interface_witness (%F.2) [template] -// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.8: type = ptr_type %.5 [template] // CHECK:STDOUT: %struct.1: %C = struct_value () [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.3 [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.8: = interface_witness (%F.3) [template] +// CHECK:STDOUT: %.9: = interface_witness (%F.3) [template] // CHECK:STDOUT: %struct.2: %D = struct_value () [template] -// CHECK:STDOUT: %.9: type = interface_type @SelfNested [template] -// CHECK:STDOUT: %Self.2: %.9 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.10: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.11: type = struct_type {.x: %Self.2, .y: %.2} [symbolic] -// CHECK:STDOUT: %.12: type = tuple_type (type, type) [template] -// CHECK:STDOUT: %.13: type = tuple_type (%.10, %.11) [symbolic] +// CHECK:STDOUT: %.10: type = interface_type @SelfNested [template] +// CHECK:STDOUT: %Self.2: %.10 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.11: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.12: type = struct_type {.x: %Self.2, .y: %.2} [symbolic] +// CHECK:STDOUT: %.13: type = tuple_type (type, type) [template] +// CHECK:STDOUT: %.14: type = tuple_type (%.11, %.12) [symbolic] // CHECK:STDOUT: %F.type.4: type = fn_type @F.4 [template] // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template] -// CHECK:STDOUT: %.14: type = assoc_entity_type %.9, %F.type.4 [template] -// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, @SelfNested.%F.decl [template] -// CHECK:STDOUT: %.16: type = ptr_type %C [template] -// CHECK:STDOUT: %.17: type = struct_type {.x: %C, .y: %.2} [template] -// CHECK:STDOUT: %.18: type = tuple_type (%.16, %.17) [template] +// CHECK:STDOUT: %.15: type = assoc_entity_type %.10, %F.type.4 [template] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, @SelfNested.%F.decl [template] +// CHECK:STDOUT: %.17: type = ptr_type %C [template] +// CHECK:STDOUT: %.18: type = struct_type {.x: %C, .y: %.2} [template] +// CHECK:STDOUT: %.19: type = tuple_type (%.17, %.18) [template] // CHECK:STDOUT: %F.type.5: type = fn_type @F.5 [template] // CHECK:STDOUT: %F.5: %F.type.5 = struct_value () [template] -// CHECK:STDOUT: %.19: = interface_witness (%F.5) [template] -// CHECK:STDOUT: %.20: type = ptr_type %D [template] -// CHECK:STDOUT: %.21: type = struct_type {.x: %D, .y: %.2} [template] -// CHECK:STDOUT: %.22: type = tuple_type (%.20, %.21) [template] +// CHECK:STDOUT: %.20: = interface_witness (%F.5) [template] +// CHECK:STDOUT: %.21: type = ptr_type %D [template] +// CHECK:STDOUT: %.22: type = struct_type {.x: %D, .y: %.2} [template] +// CHECK:STDOUT: %.23: type = tuple_type (%.21, %.22) [template] // CHECK:STDOUT: %F.type.6: type = fn_type @F.6 [template] // CHECK:STDOUT: %F.6: %F.type.6 = struct_value () [template] -// CHECK:STDOUT: %.23: = interface_witness (%F.6) [template] +// CHECK:STDOUT: %.24: = interface_witness (%F.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -100,14 +101,14 @@ impl D as SelfNested { // CHECK:STDOUT: %D.ref.loc23: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %UseSelf.ref.loc23: type = name_ref UseSelf, %UseSelf.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.9] {} +// CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.10] {} // CHECK:STDOUT: impl_decl @impl.3 { // CHECK:STDOUT: %C.ref.loc31: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %SelfNested.ref.loc31: type = name_ref SelfNested, %SelfNested.decl [template = constants.%.9] +// CHECK:STDOUT: %SelfNested.ref.loc31: type = name_ref SelfNested, %SelfNested.decl [template = constants.%.10] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.4 { // CHECK:STDOUT: %D.ref.loc35: type = name_ref D, %D.decl [template = constants.%D] -// CHECK:STDOUT: %SelfNested.ref.loc35: type = name_ref SelfNested, %SelfNested.decl [template = constants.%.9] +// CHECK:STDOUT: %SelfNested.ref.loc35: type = name_ref SelfNested, %SelfNested.decl [template = constants.%.10] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -138,24 +139,24 @@ impl D as SelfNested { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @SelfNested { -// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] +// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 0 [symbolic = constants.%Self.2] // CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.4 [template = constants.%F.4] { -// CHECK:STDOUT: %Self.ref.loc28_12: %.9 = name_ref Self, %Self [symbolic = @F.4.%Self (constants.%Self.2)] +// CHECK:STDOUT: %Self.ref.loc28_12: %.10 = name_ref Self, %Self [symbolic = @F.4.%Self (constants.%Self.2)] // CHECK:STDOUT: %.loc28_16.1: type = facet_type_access %Self.ref.loc28_12 [symbolic = @F.4.%Self (constants.%Self.2)] // CHECK:STDOUT: %.loc28_16.2: type = converted %Self.ref.loc28_12, %.loc28_16.1 [symbolic = @F.4.%Self (constants.%Self.2)] -// CHECK:STDOUT: %.loc28_16.3: type = ptr_type %Self.2 [symbolic = @F.4.%.1 (constants.%.10)] -// CHECK:STDOUT: %Self.ref.loc28_24: %.9 = name_ref Self, %Self [symbolic = @F.4.%Self (constants.%Self.2)] +// CHECK:STDOUT: %.loc28_16.3: type = ptr_type %Self.2 [symbolic = @F.4.%.1 (constants.%.11)] +// CHECK:STDOUT: %Self.ref.loc28_24: %.10 = name_ref Self, %Self [symbolic = @F.4.%Self (constants.%Self.2)] // CHECK:STDOUT: %.loc28_24.1: type = facet_type_access %Self.ref.loc28_24 [symbolic = @F.4.%Self (constants.%Self.2)] // CHECK:STDOUT: %.loc28_24.2: type = converted %Self.ref.loc28_24, %.loc28_24.1 [symbolic = @F.4.%Self (constants.%Self.2)] // CHECK:STDOUT: %.loc28_35.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc28_35.2: type = converted %.loc28_35.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %.loc28_36: type = struct_type {.x: %Self.2, .y: %.2} [symbolic = @F.4.%.2 (constants.%.11)] -// CHECK:STDOUT: %.loc28_37.1: %.12 = tuple_literal (%.loc28_16.3, %.loc28_36) -// CHECK:STDOUT: %.loc28_37.2: type = converted %.loc28_37.1, constants.%.13 [symbolic = @F.4.%.3 (constants.%.13)] -// CHECK:STDOUT: %x.loc28_8.1: @F.4.%.3 (%.13) = param x, runtime_param0 -// CHECK:STDOUT: %x.loc28_8.2: @F.4.%.3 (%.13) = bind_name x, %x.loc28_8.1 +// CHECK:STDOUT: %.loc28_36: type = struct_type {.x: %Self.2, .y: %.2} [symbolic = @F.4.%.2 (constants.%.12)] +// CHECK:STDOUT: %.loc28_37.1: %.13 = tuple_literal (%.loc28_16.3, %.loc28_36) +// CHECK:STDOUT: %.loc28_37.2: type = converted %.loc28_37.1, constants.%.14 [symbolic = @F.4.%.3 (constants.%.14)] +// CHECK:STDOUT: %x.loc28_8.1: @F.4.%.3 (%.14) = param x, runtime_param0 +// CHECK:STDOUT: %x.loc28_8.2: @F.4.%.3 (%.14) = bind_name x, %x.loc28_8.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc28_39: %.14 = assoc_entity element0, %F.decl [template = constants.%.15] +// CHECK:STDOUT: %.loc28_39: %.15 = assoc_entity element0, %F.decl [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -174,7 +175,7 @@ impl D as SelfNested { // CHECK:STDOUT: %C.ref.loc20_26: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = interface_witness (%F.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc19: = interface_witness (%F.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -192,47 +193,47 @@ impl D as SelfNested { // CHECK:STDOUT: %Self.ref.loc24_32: type = name_ref Self, constants.%D [template = constants.%D] // CHECK:STDOUT: %return.var: ref %D = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc23: = interface_witness (%F.decl) [template = constants.%.8] +// CHECK:STDOUT: %.loc23: = interface_witness (%F.decl) [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: witness = %.loc23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: %C as %.9 { +// CHECK:STDOUT: impl @impl.3: %C as %.10 { // CHECK:STDOUT: %F.decl: %F.type.5 = fn_decl @F.5 [template = constants.%F.5] { // CHECK:STDOUT: %C.ref.loc32_12: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc32_13: type = ptr_type %C [template = constants.%.16] +// CHECK:STDOUT: %.loc32_13: type = ptr_type %C [template = constants.%.17] // CHECK:STDOUT: %C.ref.loc32_21: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc32_29.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc32_29.2: type = converted %.loc32_29.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %.loc32_30: type = struct_type {.x: %C, .y: %.2} [template = constants.%.17] -// CHECK:STDOUT: %.loc32_31.1: %.12 = tuple_literal (%.loc32_13, %.loc32_30) -// CHECK:STDOUT: %.loc32_31.2: type = converted %.loc32_31.1, constants.%.18 [template = constants.%.18] -// CHECK:STDOUT: %x.loc32_8.1: %.18 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc32_8.2: %.18 = bind_name x, %x.loc32_8.1 +// CHECK:STDOUT: %.loc32_30: type = struct_type {.x: %C, .y: %.2} [template = constants.%.18] +// CHECK:STDOUT: %.loc32_31.1: %.13 = tuple_literal (%.loc32_13, %.loc32_30) +// CHECK:STDOUT: %.loc32_31.2: type = converted %.loc32_31.1, constants.%.19 [template = constants.%.19] +// CHECK:STDOUT: %x.loc32_8.1: %.19 = param x, runtime_param0 +// CHECK:STDOUT: %x.loc32_8.2: %.19 = bind_name x, %x.loc32_8.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc31: = interface_witness (%F.decl) [template = constants.%.19] +// CHECK:STDOUT: %.loc31: = interface_witness (%F.decl) [template = constants.%.20] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: witness = %.loc31 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: %D as %.9 { +// CHECK:STDOUT: impl @impl.4: %D as %.10 { // CHECK:STDOUT: %F.decl: %F.type.6 = fn_decl @F.6 [template = constants.%F.6] { // CHECK:STDOUT: %Self.ref.loc36_12: type = name_ref Self, constants.%D [template = constants.%D] -// CHECK:STDOUT: %.loc36_16: type = ptr_type %D [template = constants.%.20] +// CHECK:STDOUT: %.loc36_16: type = ptr_type %D [template = constants.%.21] // CHECK:STDOUT: %Self.ref.loc36_24: type = name_ref Self, constants.%D [template = constants.%D] // CHECK:STDOUT: %.loc36_35.1: %.2 = tuple_literal () // CHECK:STDOUT: %.loc36_35.2: type = converted %.loc36_35.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: %.loc36_36: type = struct_type {.x: %D, .y: %.2} [template = constants.%.21] -// CHECK:STDOUT: %.loc36_37.1: %.12 = tuple_literal (%.loc36_16, %.loc36_36) -// CHECK:STDOUT: %.loc36_37.2: type = converted %.loc36_37.1, constants.%.22 [template = constants.%.22] -// CHECK:STDOUT: %x.loc36_8.1: %.22 = param x, runtime_param0 -// CHECK:STDOUT: %x.loc36_8.2: %.22 = bind_name x, %x.loc36_8.1 +// CHECK:STDOUT: %.loc36_36: type = struct_type {.x: %D, .y: %.2} [template = constants.%.22] +// CHECK:STDOUT: %.loc36_37.1: %.13 = tuple_literal (%.loc36_16, %.loc36_36) +// CHECK:STDOUT: %.loc36_37.2: type = converted %.loc36_37.1, constants.%.23 [template = constants.%.23] +// CHECK:STDOUT: %x.loc36_8.1: %.23 = param x, runtime_param0 +// CHECK:STDOUT: %x.loc36_8.2: %.23 = bind_name x, %x.loc36_8.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc35: = interface_witness (%F.decl) [template = constants.%.23] +// CHECK:STDOUT: %.loc35: = interface_witness (%F.decl) [template = constants.%.24] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -240,11 +241,15 @@ impl D as SelfNested { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc17: = complete_type_witness %.5 [template = constants.%.6] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } @@ -271,18 +276,18 @@ impl D as SelfNested { // CHECK:STDOUT: return %.loc24_48 to @impl.2.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.4(@SelfNested.%Self: %.9) { -// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.1: type = ptr_type @F.4.%Self (%Self.2) [symbolic = %.1 (constants.%.10)] -// CHECK:STDOUT: %.2: type = struct_type {.x: @F.4.%Self (%Self.2), .y: %.2} [symbolic = %.2 (constants.%.11)] -// CHECK:STDOUT: %.3: type = tuple_type (@F.4.%.1 (%.10), @F.4.%.2 (%.11)) [symbolic = %.3 (constants.%.13)] +// CHECK:STDOUT: generic fn @F.4(@SelfNested.%Self: %.10) { +// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = ptr_type @F.4.%Self (%Self.2) [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %.2: type = struct_type {.x: @F.4.%Self (%Self.2), .y: %.2} [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %.3: type = tuple_type (@F.4.%.1 (%.11), @F.4.%.2 (%.12)) [symbolic = %.3 (constants.%.14)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(@SelfNested.%x.loc28_8.2: @F.4.%.3 (%.13)); +// CHECK:STDOUT: fn(@SelfNested.%x.loc28_8.2: @F.4.%.3 (%.14)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.5(@impl.3.%x.loc32_8.2: %.18); +// CHECK:STDOUT: fn @F.5(@impl.3.%x.loc32_8.2: %.19); // CHECK:STDOUT: -// CHECK:STDOUT: fn @F.6(@impl.4.%x.loc36_8.2: %.22); +// CHECK:STDOUT: fn @F.6(@impl.4.%x.loc36_8.2: %.23); // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%Self.1) { // CHECK:STDOUT: %Self => constants.%Self.1 @@ -298,22 +303,22 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: specific @F.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.1 => constants.%.10 -// CHECK:STDOUT: %.2 => constants.%.11 -// CHECK:STDOUT: %.3 => constants.%.13 +// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.12 +// CHECK:STDOUT: %.3 => constants.%.14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.1 => constants.%.16 -// CHECK:STDOUT: %.2 => constants.%.17 -// CHECK:STDOUT: %.3 => constants.%.18 +// CHECK:STDOUT: %.1 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.18 +// CHECK:STDOUT: %.3 => constants.%.19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.4(constants.%D) { // CHECK:STDOUT: %Self => constants.%D -// CHECK:STDOUT: %.1 => constants.%.20 -// CHECK:STDOUT: %.2 => constants.%.21 -// CHECK:STDOUT: %.3 => constants.%.22 +// CHECK:STDOUT: %.1 => constants.%.21 +// CHECK:STDOUT: %.2 => constants.%.22 +// CHECK:STDOUT: %.3 => constants.%.23 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index 89f419cc114b3..ce20d9f72a266 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -28,7 +28,8 @@ impl i32 as I {} // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] -// CHECK:STDOUT: %.4: = interface_witness () [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,7 +79,7 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.1 { -// CHECK:STDOUT: %.loc19: = interface_witness () [template = constants.%.4] +// CHECK:STDOUT: %.loc19: = interface_witness () [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc19 @@ -91,6 +92,7 @@ impl i32 as I {} // CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32, %.loc16_8.1 [template = i32] // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc17: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 19a2c2b255a97..09e4944e4d0b5 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -201,7 +201,8 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = struct_type {} [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -269,6 +270,7 @@ fn Interface.C.F[self: Self](U:! type, u: U) -> U { return u; } // CHECK:STDOUT: %U.ref.loc14_41: type = name_ref U, %U.loc14_22.2 [symbolic = @F.%U.1 (constants.%U)] // CHECK:STDOUT: %return.var: ref @F.%U.1 (%U) = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc15: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 diff --git a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon index 37af99c982386..66636658efe58 100644 --- a/toolchain/check/testdata/interface/no_prelude/default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/default_fn.carbon @@ -38,7 +38,8 @@ class C { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: = interface_witness (%F.2) [template] // CHECK:STDOUT: %.6: type = struct_type {} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.6 [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.6 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -75,6 +76,7 @@ class C { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc24: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index b1b599e4e987e..f588fa9cfb03d 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -69,31 +69,32 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %WithAssocFn.type: type = generic_interface_type @WithAssocFn [template] // CHECK:STDOUT: %WithAssocFn: %WithAssocFn.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = interface_type @WithAssocFn, @WithAssocFn(%T.1) [symbolic] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @WithAssocFn, @WithAssocFn(%T.1) [symbolic] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @WithAssocFn(%T.1) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %F.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, @WithAssocFn.%F.decl [symbolic] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %F.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, @WithAssocFn.%F.decl [symbolic] // CHECK:STDOUT: %C: type = class_type @C [template] -// CHECK:STDOUT: %.7: type = interface_type @Simple, @Simple(%C) [template] -// CHECK:STDOUT: %.8: = interface_witness () [template] -// CHECK:STDOUT: %.9: type = interface_type @WithAssocFn, @WithAssocFn(%C) [template] +// CHECK:STDOUT: %.8: type = interface_type @Simple, @Simple(%C) [template] +// CHECK:STDOUT: %.9: = interface_witness () [template] +// CHECK:STDOUT: %.10: type = interface_type @WithAssocFn, @WithAssocFn(%C) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @WithAssocFn(%C) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %F.type.3 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, @WithAssocFn.%F.decl [template] -// CHECK:STDOUT: %.12: = interface_witness (%F.2) [template] -// CHECK:STDOUT: %.13: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %F.type.3 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, @WithAssocFn.%F.decl [template] +// CHECK:STDOUT: %.13: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.14: type = ptr_type %.3 [template] // CHECK:STDOUT: %struct: %X = struct_value () [template] // CHECK:STDOUT: %N: %T.1 = bind_symbolic_name N 1 [symbolic] // CHECK:STDOUT: %WithImplicitArgs.type: type = generic_interface_type @WithImplicitArgs [template] // CHECK:STDOUT: %WithImplicitArgs: %WithImplicitArgs.type = struct_value () [template] -// CHECK:STDOUT: %T.2: %.7 = bind_symbolic_name T 0 [symbolic] +// CHECK:STDOUT: %T.2: %.8 = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %Receive.type: type = fn_type @Receive [template] // CHECK:STDOUT: %Receive: %Receive.type = struct_value () [template] // CHECK:STDOUT: %Pass.type: type = fn_type @Pass [template] @@ -130,16 +131,16 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %Receive.decl: %Receive.type = fn_decl @Receive [template = constants.%Receive] { // CHECK:STDOUT: %Simple.ref.loc24: %Simple.type = name_ref Simple, %Simple.decl [template = constants.%Simple] // CHECK:STDOUT: %C.ref.loc24: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc24: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.7] -// CHECK:STDOUT: %T.loc24_12.1: %.7 = param T, runtime_param -// CHECK:STDOUT: @Receive.%T.loc24: %.7 = bind_symbolic_name T 0, %T.loc24_12.1 [symbolic = @Receive.%T.1 (constants.%T.2)] +// CHECK:STDOUT: %.loc24: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.8] +// CHECK:STDOUT: %T.loc24_12.1: %.8 = param T, runtime_param +// CHECK:STDOUT: @Receive.%T.loc24: %.8 = bind_symbolic_name T 0, %T.loc24_12.1 [symbolic = @Receive.%T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %Pass.decl: %Pass.type = fn_decl @Pass [template = constants.%Pass] { // CHECK:STDOUT: %Simple.ref.loc25: %Simple.type = name_ref Simple, %Simple.decl [template = constants.%Simple] // CHECK:STDOUT: %C.ref.loc25: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc25: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.7] -// CHECK:STDOUT: %T.loc25_9.1: %.7 = param T, runtime_param -// CHECK:STDOUT: @Pass.%T.loc25: %.7 = bind_symbolic_name T 0, %T.loc25_9.1 [symbolic = @Pass.%T.1 (constants.%T.2)] +// CHECK:STDOUT: %.loc25: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.8] +// CHECK:STDOUT: %T.loc25_9.1: %.8 = param T, runtime_param +// CHECK:STDOUT: @Pass.%T.loc25: %.8 = bind_symbolic_name T 0, %T.loc25_9.1 [symbolic = @Pass.%T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -163,20 +164,20 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @WithAssocFn, @WithAssocFn(%T) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @WithAssocFn, @WithAssocFn(%T) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @WithAssocFn(%T) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @WithAssocFn.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @WithAssocFn.%.1 (%.4), @WithAssocFn.%F.type (%F.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @WithAssocFn.%.2 (%.5) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @WithAssocFn.%.1 (%.5), @WithAssocFn.%F.type (%F.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @WithAssocFn.%.2 (%.6) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @WithAssocFn.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] +// CHECK:STDOUT: %Self.1: @WithAssocFn.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] // CHECK:STDOUT: %F.decl: @WithAssocFn.%F.type (%F.type.1) = fn_decl @F.1 [symbolic = %F (constants.%F.1)] { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %return.var: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10: @WithAssocFn.%.2 (%.5) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.loc10: @WithAssocFn.%.2 (%.6) = assoc_entity element0, %F.decl [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -192,19 +193,19 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.7 { -// CHECK:STDOUT: %.loc14: = interface_witness () [template = constants.%.8] +// CHECK:STDOUT: impl @impl.1: %C as %.8 { +// CHECK:STDOUT: %.loc14: = interface_witness () [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.9 { +// CHECK:STDOUT: impl @impl.2: %C as %.10 { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %return.var: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness (%F.decl) [template = constants.%.12] +// CHECK:STDOUT: %.loc15: = interface_witness (%F.decl) [template = constants.%.13] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -212,6 +213,8 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: } @@ -220,19 +223,20 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %Simple.ref: %Simple.type = name_ref Simple, file.%Simple.decl [template = constants.%Simple] // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc14: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.7] +// CHECK:STDOUT: %.loc14: type = interface_type @Simple, @Simple(constants.%C) [template = constants.%.8] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %WithAssocFn.ref: %WithAssocFn.type = name_ref WithAssocFn, file.%WithAssocFn.decl [template = constants.%WithAssocFn] // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc15: type = interface_type @WithAssocFn, @WithAssocFn(constants.%C) [template = constants.%.9] +// CHECK:STDOUT: %.loc15: type = interface_type @WithAssocFn, @WithAssocFn(constants.%C) [template = constants.%.10] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc20: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(file.%T.loc8_23.2: type, @WithAssocFn.%Self.1: @WithAssocFn.%.1 (%.4)) { +// CHECK:STDOUT: generic fn @F.1(file.%T.loc8_23.2: type, @WithAssocFn.%Self.1: @WithAssocFn.%.1 (%.5)) { // CHECK:STDOUT: // CHECK:STDOUT: fn() -> %X; // CHECK:STDOUT: } @@ -245,21 +249,21 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: return %.loc17_16 to @impl.2.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Receive(%T.loc24: %.7) { -// CHECK:STDOUT: %T.1: %.7 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] +// CHECK:STDOUT: generic fn @Receive(%T.loc24: %.8) { +// CHECK:STDOUT: %T.1: %.8 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc24: %.7); +// CHECK:STDOUT: fn(%T.loc24: %.8); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Pass(%T.loc25: %.7) { -// CHECK:STDOUT: %T.1: %.7 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] +// CHECK:STDOUT: generic fn @Pass(%T.loc25: %.8) { +// CHECK:STDOUT: %T.1: %.8 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc25: %.7) { +// CHECK:STDOUT: fn(%T.loc25: %.8) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Receive.ref: %Receive.type = name_ref Receive, file.%Receive.decl [template = constants.%Receive] -// CHECK:STDOUT: %T.ref: %.7 = name_ref T, %T.loc25 [symbolic = %T.1 (constants.%T.2)] +// CHECK:STDOUT: %T.ref: %.8 = name_ref T, %T.loc25 [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: %Receive.call: init %.1 = call %Receive.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -287,7 +291,7 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %T => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Self.2 => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -295,12 +299,12 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %T => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.9 +// CHECK:STDOUT: %.1 => constants.%.10 // CHECK:STDOUT: %Self.2 => constants.%Self.2 // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 -// CHECK:STDOUT: %.2 => constants.%.10 -// CHECK:STDOUT: %.3 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: %.3 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%C, constants.%C) {} @@ -329,13 +333,14 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.3: type = struct_type {} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %B: type = class_type @B [template] -// CHECK:STDOUT: %.4: type = interface_type @Generic, @Generic(%A) [template] -// CHECK:STDOUT: %T.2: %.4 = bind_symbolic_name T 0 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @Generic, @Generic(%A) [template] +// CHECK:STDOUT: %T.2: %.5 = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = interface_type @Generic, @Generic(%B) [template] -// CHECK:STDOUT: %T.3: %.5 = bind_symbolic_name T 0 [symbolic] +// CHECK:STDOUT: %.6: type = interface_type @Generic, @Generic(%B) [template] +// CHECK:STDOUT: %T.3: %.6 = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } @@ -357,16 +362,16 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Generic.ref.loc9: %Generic.type = name_ref Generic, %Generic.decl [template = constants.%Generic] // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] -// CHECK:STDOUT: %.loc9: type = interface_type @Generic, @Generic(constants.%A) [template = constants.%.4] -// CHECK:STDOUT: %T.loc9_6.1: %.4 = param T, runtime_param -// CHECK:STDOUT: @F.%T.loc9: %.4 = bind_symbolic_name T 0, %T.loc9_6.1 [symbolic = @F.%T.1 (constants.%T.2)] +// CHECK:STDOUT: %.loc9: type = interface_type @Generic, @Generic(constants.%A) [template = constants.%.5] +// CHECK:STDOUT: %T.loc9_6.1: %.5 = param T, runtime_param +// CHECK:STDOUT: @F.%T.loc9: %.5 = bind_symbolic_name T 0, %T.loc9_6.1 [symbolic = @F.%T.1 (constants.%T.2)] // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Generic.ref.loc10: %Generic.type = name_ref Generic, %Generic.decl [template = constants.%Generic] // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] -// CHECK:STDOUT: %.loc10: type = interface_type @Generic, @Generic(constants.%B) [template = constants.%.5] -// CHECK:STDOUT: %T.loc10_6.1: %.5 = param T, runtime_param -// CHECK:STDOUT: @G.%T.loc10: %.5 = bind_symbolic_name T 0, %T.loc10_6.1 [symbolic = @G.%T.1 (constants.%T.3)] +// CHECK:STDOUT: %.loc10: type = interface_type @Generic, @Generic(constants.%B) [template = constants.%.6] +// CHECK:STDOUT: %T.loc10_6.1: %.6 = param T, runtime_param +// CHECK:STDOUT: @G.%T.loc10: %.6 = bind_symbolic_name T 0, %T.loc10_6.1 [symbolic = @G.%T.1 (constants.%T.3)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -387,31 +392,35 @@ fn G(T:! Generic(B)) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc7: = complete_type_witness %.3 [template = constants.%.4] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F(%T.loc9: %.4) { -// CHECK:STDOUT: %T.1: %.4 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] +// CHECK:STDOUT: generic fn @F(%T.loc9: %.5) { +// CHECK:STDOUT: %T.1: %.5 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.2)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc9: %.4); +// CHECK:STDOUT: fn(%T.loc9: %.5); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @G(%T.loc10: %.5) { -// CHECK:STDOUT: %T.1: %.5 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.3)] +// CHECK:STDOUT: generic fn @G(%T.loc10: %.6) { +// CHECK:STDOUT: %T.1: %.6 = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T.3)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: fn(%T.loc10: %.5) { +// CHECK:STDOUT: fn(%T.loc10: %.6) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F] -// CHECK:STDOUT: %T.ref: %.5 = name_ref T, %T.loc10 [symbolic = %T.1 (constants.%T.3)] -// CHECK:STDOUT: %.loc18: %.4 = converted %T.ref, [template = ] +// CHECK:STDOUT: %T.ref: %.6 = name_ref T, %T.loc10 [symbolic = %T.1 (constants.%T.3)] +// CHECK:STDOUT: %.loc18: %.5 = converted %T.ref, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index 55de8e31ffaa4..8a196140d3e78 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -95,25 +95,26 @@ impl C as AddWith(C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %AddWith.type: type = generic_interface_type @AddWith [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %AddWith: %AddWith.type = struct_value () [template] // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] -// CHECK:STDOUT: %.3: type = interface_type @AddWith, @AddWith(%T) [symbolic] -// CHECK:STDOUT: %Self.1: @AddWith.%.1 (%.3) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: type = interface_type @AddWith, @AddWith(%T) [symbolic] +// CHECK:STDOUT: %Self.1: @AddWith.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1, @AddWith(%T) [symbolic] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.4: type = assoc_entity_type %.3, %F.type.1 [symbolic] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.5 [symbolic] -// CHECK:STDOUT: %.6: type = interface_type @AddWith, @AddWith(%C) [template] +// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %F.type.1 [symbolic] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [symbolic] +// CHECK:STDOUT: %.7: type = interface_type @AddWith, @AddWith(%C) [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %F.type.3: type = fn_type @F.1, @AddWith(%C) [template] // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.6, %F.type.3 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.5 [template] -// CHECK:STDOUT: %.9: = interface_witness (%F.2) [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %F.type.3 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.10: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -135,7 +136,7 @@ impl C as AddWith(C) { // CHECK:STDOUT: %C.ref.loc7_6: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %AddWith.ref: %AddWith.type = name_ref AddWith, imports.%import_ref.1 [template = constants.%AddWith] // CHECK:STDOUT: %C.ref.loc7_19: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc7: type = interface_type @AddWith, @AddWith(constants.%C) [template = constants.%.6] +// CHECK:STDOUT: %.loc7: type = interface_type @AddWith, @AddWith(constants.%C) [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -143,12 +144,12 @@ impl C as AddWith(C) { // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @AddWith, @AddWith(%T) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @AddWith, @AddWith(%T) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %F.type: type = fn_type @F.1, @AddWith(%T) [symbolic = %F.type (constants.%F.type.1)] // CHECK:STDOUT: %F: @AddWith.%F.type (%F.type.1) = struct_value () [symbolic = %F (constants.%F.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @AddWith.%.1 (%.3), @AddWith.%F.type (%F.type.1) [symbolic = %.2 (constants.%.4)] -// CHECK:STDOUT: %.3: @AddWith.%.2 (%.4) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.5)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @AddWith.%.1 (%.4), @AddWith.%F.type (%F.type.1) [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: %.3: @AddWith.%.2 (%.5) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.6)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -158,9 +159,9 @@ impl C as AddWith(C) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.6 { +// CHECK:STDOUT: impl @impl: %C as %.7 { // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {} -// CHECK:STDOUT: %.loc7: = interface_witness (%F.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc7: = interface_witness (%F.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = %F.decl @@ -168,11 +169,13 @@ impl C as AddWith(C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self.1: @AddWith.%.1 (%.3)) { +// CHECK:STDOUT: generic fn @F.1(constants.%T: type, constants.%Self.1: @AddWith.%.1 (%.4)) { // CHECK:STDOUT: // CHECK:STDOUT: fn(); // CHECK:STDOUT: } @@ -196,12 +199,12 @@ impl C as AddWith(C) { // CHECK:STDOUT: %T => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.6 +// CHECK:STDOUT: %.1 => constants.%.7 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %F.type => constants.%F.type.3 // CHECK:STDOUT: %F => constants.%F.3 -// CHECK:STDOUT: %.2 => constants.%.7 -// CHECK:STDOUT: %.3 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.3 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F.1(constants.%C, constants.%C) {} diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index 1d5ae16e38a9c..25ab474bbf586 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -74,14 +74,15 @@ interface A(T: type) {} // CHECK:STDOUT: %.7: type = interface_type @GenericAndParams.2, @GenericAndParams.2(%T, %U) [symbolic] // CHECK:STDOUT: %Self.5: %.7 = bind_symbolic_name Self 2 [symbolic] // CHECK:STDOUT: %.8: type = struct_type {} [template] +// CHECK:STDOUT: %.9: = complete_type_witness %.8 [template] // CHECK:STDOUT: %X: type = class_type @X [template] -// CHECK:STDOUT: %.9: = interface_witness () [template] -// CHECK:STDOUT: %.10: type = interface_type @GenericAndParams.1, @GenericAndParams.1(%X) [template] +// CHECK:STDOUT: %.10: = interface_witness () [template] +// CHECK:STDOUT: %.11: type = interface_type @GenericAndParams.1, @GenericAndParams.1(%X) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%X) [template] // CHECK:STDOUT: %GenericAndParams.type.3: type = generic_interface_type @GenericAndParams.2, @C(%X) [template] // CHECK:STDOUT: %GenericAndParams.3: %GenericAndParams.type.3 = struct_value () [template] -// CHECK:STDOUT: %.11: type = ptr_type %.8 [template] -// CHECK:STDOUT: %.12: type = interface_type @GenericAndParams.2, @GenericAndParams.2(%X, %X) [template] +// CHECK:STDOUT: %.12: type = ptr_type %.8 [template] +// CHECK:STDOUT: %.13: type = interface_type @GenericAndParams.2, @GenericAndParams.2(%X, %X) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -116,7 +117,7 @@ interface A(T: type) {} // CHECK:STDOUT: %X.ref.loc16_6: type = name_ref X, %X.decl [template = constants.%X] // CHECK:STDOUT: %GenericAndParams.ref.loc16: %GenericAndParams.type.1 = name_ref GenericAndParams, %GenericAndParams.decl [template = constants.%GenericAndParams.1] // CHECK:STDOUT: %X.ref.loc16_28: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc16: type = interface_type @GenericAndParams.1, @GenericAndParams.1(constants.%X) [template = constants.%.10] +// CHECK:STDOUT: %.loc16: type = interface_type @GenericAndParams.1, @GenericAndParams.1(constants.%X) [template = constants.%.11] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.4 { // CHECK:STDOUT: %X.ref.loc17_6: type = name_ref X, %X.decl [template = constants.%X] @@ -133,7 +134,7 @@ interface A(T: type) {} // CHECK:STDOUT: %.loc18_15: %GenericAndParams.type.3 = specific_constant @C.%GenericAndParams.decl, @C(constants.%X) [template = constants.%GenericAndParams.3] // CHECK:STDOUT: %GenericAndParams.ref.loc18: %GenericAndParams.type.3 = name_ref GenericAndParams, %.loc18_15 [template = constants.%GenericAndParams.3] // CHECK:STDOUT: %X.ref.loc18_33: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc18_32: type = interface_type @GenericAndParams.2, @GenericAndParams.2(constants.%X, constants.%X) [template = constants.%.12] +// CHECK:STDOUT: %.loc18_32: type = interface_type @GenericAndParams.2, @GenericAndParams.2(constants.%X, constants.%X) [template = constants.%.13] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -202,35 +203,35 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %X as %.1 { -// CHECK:STDOUT: %.loc14: = interface_witness () [template = constants.%.9] +// CHECK:STDOUT: %.loc14: = interface_witness () [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.2: %X as %.3 { -// CHECK:STDOUT: %.loc15: = interface_witness () [template = constants.%.9] +// CHECK:STDOUT: %.loc15: = interface_witness () [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: %X as %.10 { -// CHECK:STDOUT: %.loc16: = interface_witness () [template = constants.%.9] +// CHECK:STDOUT: impl @impl.3: %X as %.11 { +// CHECK:STDOUT: %.loc16: = interface_witness () [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.4: %X as %.5 { -// CHECK:STDOUT: %.loc17: = interface_witness () [template = constants.%.9] +// CHECK:STDOUT: %.loc17: = interface_witness () [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.5: %X as %.12 { -// CHECK:STDOUT: %.loc18: = interface_witness () [template = constants.%.9] +// CHECK:STDOUT: impl @impl.5: %X as %.13 { +// CHECK:STDOUT: %.loc18: = interface_witness () [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = %.loc18 @@ -249,6 +250,7 @@ interface A(T: type) {} // CHECK:STDOUT: %U.loc10_30.1: type = param U, runtime_param // CHECK:STDOUT: %U.loc10_30.2: type = bind_symbolic_name U 1, %U.loc10_30.1 [symbolic = @GenericAndParams.2.%U (constants.%U)] // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc11: = complete_type_witness %.8 [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 @@ -258,6 +260,8 @@ interface A(T: type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { +// CHECK:STDOUT: %.loc13: = complete_type_witness %.8 [template = constants.%.9] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: } @@ -294,7 +298,7 @@ interface A(T: type) {} // CHECK:STDOUT: %T => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %Self.2 => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -311,7 +315,7 @@ interface A(T: type) {} // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T => constants.%X -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: %Self.2 => constants.%Self.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index e01d7644e504b..5069fe824523f 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -196,16 +196,17 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = interface_type @Foo, @Foo(%a) [symbolic] -// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: type = interface_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %Self.1: %.4 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_interface_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = interface_type @Bar, @Bar(%a) [symbolic] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @Bar, @Bar(%a) [symbolic] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -244,11 +245,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] +// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @Foo.%.1 (%.3) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] +// CHECK:STDOUT: %Self.1: @Foo.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -260,11 +261,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Bar, @Bar(%a) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @Bar, @Bar(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @Bar.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] +// CHECK:STDOUT: %Self.1: @Bar.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -273,6 +274,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -298,12 +301,13 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = interface_type @Foo, @Foo(%a) [symbolic] -// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: type = interface_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -328,11 +332,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @Foo.%.1 (%.3) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %Self.1: @Foo.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -341,6 +345,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -358,14 +364,15 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = generic_interface_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = interface_type @.1, @.1(%a) [symbolic] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = interface_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -379,7 +386,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.loc6_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc6_15.2: %C = bind_symbolic_name a 0, %a.loc6_15.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc14_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc14_15.2: %C = bind_symbolic_name a 0, %a.loc14_15.1 [symbolic = @.1.%a (constants.%a)] @@ -396,11 +403,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @.1.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %Self.1: @.1.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -409,6 +416,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -430,12 +439,13 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = interface_type @Foo, @Foo(%a) [symbolic] -// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: type = interface_type @Foo, @Foo(%a) [symbolic] +// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -460,11 +470,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %.1: type = interface_type @Foo, @Foo(%a) [symbolic = %.1 (constants.%.4)] +// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @Foo.%.1 (%.3) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %Self.1: @Foo.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -473,6 +483,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -490,9 +502,10 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %Bar.type: type = generic_interface_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] @@ -533,6 +546,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -550,27 +565,28 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type.1: type = generic_interface_type @.1 [template] -// CHECK:STDOUT: %.3: %.type.1 = struct_value () [template] -// CHECK:STDOUT: %.4: type = interface_type @.1, @.1(%a) [symbolic] -// CHECK:STDOUT: %Self.1: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: %.type.1 = struct_value () [template] +// CHECK:STDOUT: %.5: type = interface_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %Self.1: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Bar.type: type = generic_interface_type @Bar [template] // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] // CHECK:STDOUT: %.type.2: type = generic_interface_type @.2 [template] -// CHECK:STDOUT: %.5: %.type.2 = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @.2, @.2(%a) [symbolic] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.6: %.type.2 = struct_value () [template] +// CHECK:STDOUT: %.7: type = interface_type @.2, @.2(%a) [symbolic] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+5, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+10, loaded [template = constants.%Foo] -// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+18, loaded [template = constants.%Bar] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+12, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+20, loaded [template = constants.%Bar] // CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -583,12 +599,12 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %.decl.loc14: %.type.1 = interface_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl.loc14: %.type.1 = interface_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %a.loc14_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc14_15.2: %C = bind_symbolic_name a 0, %a.loc14_15.1 [symbolic = @.1.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl.loc25: %.type.2 = interface_decl @.2 [template = constants.%.5] { +// CHECK:STDOUT: %.decl.loc25: %.type.2 = interface_decl @.2 [template = constants.%.6] { // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %a.loc25_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc25_15.2: %C = bind_symbolic_name a 0, %a.loc25_15.1 [symbolic = @.2.%a (constants.%a)] @@ -605,11 +621,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @.1.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] +// CHECK:STDOUT: %Self.1: @.1.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -627,11 +643,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.2, @.2(%a) [symbolic = %.1 (constants.%.6)] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @.2, @.2(%a) [symbolic = %.1 (constants.%.7)] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @.2.%.1 (%.6) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] +// CHECK:STDOUT: %Self.1: @.2.%.1 (%.7) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -673,15 +689,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %b: %C = bind_symbolic_name b 0 [symbolic] // CHECK:STDOUT: %.type: type = generic_interface_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = interface_type @.1, @.1(%b) [symbolic] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = interface_type @.1, @.1(%b) [symbolic] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -698,7 +715,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %b.loc15_15.1: %C = param b, runtime_param // CHECK:STDOUT: %b.loc15_15.2: %C = bind_symbolic_name b 0, %b.loc15_15.1 [symbolic = @.1.%b (constants.%b)] @@ -715,11 +732,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %b: %C = bind_symbolic_name b 0 [symbolic = %b (constants.%b)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%b) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%b) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @.1.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %Self.1: @.1.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -728,6 +745,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -749,14 +768,15 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = generic_interface_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = interface_type @.1, @.1(%a) [symbolic] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = interface_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -773,7 +793,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %a.loc15_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc15_15.2: %C = bind_symbolic_name a 0, %a.loc15_15.1 [symbolic = @.1.%a (constants.%a)] @@ -790,11 +810,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @.1.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %Self.1: @.1.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -803,6 +823,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -824,14 +846,15 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = generic_interface_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = interface_type @.1, @.1(%a) [symbolic] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = interface_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -848,7 +871,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a.loc7_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc7_15.2: %C = bind_symbolic_name a 0, %a.loc7_15.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %a.loc15_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc15_15.2: %C = bind_symbolic_name a 0, %a.loc15_15.1 [symbolic = @.1.%a (constants.%a)] @@ -865,11 +888,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @.1.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %Self.1: @.1.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -878,6 +901,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -899,9 +924,10 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -925,6 +951,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -938,19 +966,20 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = generic_interface_type @.1 [template] -// CHECK:STDOUT: %.3: %.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = interface_type @.1, @.1(%a) [symbolic] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.4: %.type = struct_value () [template] +// CHECK:STDOUT: %.5: type = interface_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+8, loaded [template = constants.%Foo] +// CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+10, loaded [template = constants.%Foo] // CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -964,7 +993,7 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.3] { +// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %D.ref: type = name_ref D, %D [template = constants.%C] // CHECK:STDOUT: %a.loc19_15.1: %C = param a, runtime_param // CHECK:STDOUT: %a.loc19_15.2: %C = bind_symbolic_name a 0, %a.loc19_15.1 [symbolic = @.1.%a (constants.%a)] @@ -981,11 +1010,11 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %a: %C = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @.1.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %Self.1: @.1.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -1015,15 +1044,16 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = const_type %C [template] -// CHECK:STDOUT: %a: %.2 = bind_symbolic_name a 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = const_type %C [template] +// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic] // CHECK:STDOUT: %Foo.type: type = generic_interface_type @Foo [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.type: type = generic_interface_type @.1 [template] -// CHECK:STDOUT: %.4: %.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = interface_type @.1, @.1(%a) [symbolic] -// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: %.type = struct_value () [template] +// CHECK:STDOUT: %.6: type = interface_type @.1, @.1(%a) [symbolic] +// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1034,34 +1064,34 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %Foo.decl: %Foo.type = interface_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.2] -// CHECK:STDOUT: %a.loc6_15.1: %.2 = param a, runtime_param -// CHECK:STDOUT: %a.loc6_15.2: %.2 = bind_symbolic_name a 0, %a.loc6_15.1 [symbolic = @Foo.%a (constants.%a)] +// CHECK:STDOUT: %.loc6: type = const_type %C [template = constants.%.3] +// CHECK:STDOUT: %a.loc6_15.1: %.3 = param a, runtime_param +// CHECK:STDOUT: %a.loc6_15.2: %.3 = bind_symbolic_name a 0, %a.loc6_15.1 [symbolic = @Foo.%a (constants.%a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.4] { +// CHECK:STDOUT: %.decl: %.type = interface_decl @.1 [template = constants.%.5] { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc17_26: type = const_type %C [template = constants.%.2] -// CHECK:STDOUT: %.loc17_19: type = const_type %.2 [template = constants.%.2] -// CHECK:STDOUT: %a.loc17_15.1: %.2 = param a, runtime_param -// CHECK:STDOUT: %a.loc17_15.2: %.2 = bind_symbolic_name a 0, %a.loc17_15.1 [symbolic = @.1.%a (constants.%a)] +// CHECK:STDOUT: %.loc17_26: type = const_type %C [template = constants.%.3] +// CHECK:STDOUT: %.loc17_19: type = const_type %.3 [template = constants.%.3] +// CHECK:STDOUT: %a.loc17_15.1: %.3 = param a, runtime_param +// CHECK:STDOUT: %a.loc17_15.2: %.3 = bind_symbolic_name a 0, %a.loc17_15.1 [symbolic = @.1.%a (constants.%a)] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @Foo(file.%a.loc6_15.2: %.2) { -// CHECK:STDOUT: %a: %.2 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @Foo(file.%a.loc6_15.2: %.3) { +// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: interface; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @.1(file.%a.loc17_15.2: %.2) { -// CHECK:STDOUT: %a: %.2 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] +// CHECK:STDOUT: generic interface @.1(file.%a.loc17_15.2: %.3) { +// CHECK:STDOUT: %a: %.3 = bind_symbolic_name a 0 [symbolic = %a (constants.%a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.5)] -// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %.1: type = interface_type @.1, @.1(%a) [symbolic = %.1 (constants.%.6)] +// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @.1.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %Self.1: @.1.%.1 (%.6) = bind_symbolic_name Self 1 [symbolic = %Self.2 (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self.1 @@ -1070,6 +1100,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon index a3b9394394f95..b5c1c8c2c8383 100644 --- a/toolchain/check/testdata/namespace/merging_with_indirections.carbon +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -46,6 +46,7 @@ fn Run() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -74,6 +75,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%A // CHECK:STDOUT: } @@ -83,11 +86,12 @@ fn Run() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %B: type = class_type @B [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %A = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -132,6 +136,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { +// CHECK:STDOUT: %.loc6: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: } @@ -159,7 +165,8 @@ fn Run() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %A: type = class_type @A [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -179,8 +186,8 @@ fn Run() { // CHECK:STDOUT: import Other//b // CHECK:STDOUT: import Other//a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//b, inst+17, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//b, inst+14, unloaded +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//b, inst+19, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//b, inst+16, unloaded // CHECK:STDOUT: %import_ref.3: = import_ref Other//b, inst+4, loaded // CHECK:STDOUT: %NS1: = namespace %import_ref.3, [template] { // CHECK:STDOUT: .A = %import_ref.4 diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index f8b87c76e5aa8..b95e653b61b6b 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Add [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Add [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @AddAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @AddAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+19, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 9af6facbda414..a52f32cccdb0b 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @BitAnd [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @BitAnd [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @BitAndAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @BitAndAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+22, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+22, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+24, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+45, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+45, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+40, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+47, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+47, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+49, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+70, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+70, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+64, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+40, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+64, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %BitAndAssign.ref: type = name_ref BitAndAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %BitAndAssign.ref: type = name_ref BitAndAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index a4b7c31ed3cca..8051b1b0ef184 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -29,20 +29,21 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @BitComplement [template] -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @BitComplement [template] +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -57,9 +58,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+1, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/bitwise, inst+20, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/bitwise, inst+20, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+14, loaded [template = constants.%Op.2] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/bitwise, inst+14, unloaded // CHECK:STDOUT: } @@ -75,7 +76,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, %C.decl [template = constants.%C] @@ -93,7 +94,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -101,7 +102,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C.ref.loc18_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -109,6 +110,8 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -121,8 +124,8 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: return %.loc19_14 to @impl.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self)]() -> @Op.2.%Self (%Self); // CHECK:STDOUT: } @@ -130,7 +133,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: fn @TestOp(%a: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a -// CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.3 [template = constants.%.7] +// CHECK:STDOUT: %Op.ref: %.7 = name_ref Op, imports.%import_ref.3 [template = constants.%.8] // CHECK:STDOUT: %.loc24_10.1: %Op.type.2 = interface_witness_access @impl.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc24_10.2: = bound_method %a.ref, %.loc24_10.1 // CHECK:STDOUT: %.loc23: ref %C = splice_block %return {} diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index 8b0e1cd77796e..7a89225da365b 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @BitOr [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @BitOr [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @BitOrAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @BitOrAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+72, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+72, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+74, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+95, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+95, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+90, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+97, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+97, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+99, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+120, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+120, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+114, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+90, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+114, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %BitOrAssign.ref: type = name_ref BitOrAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %BitOrAssign.ref: type = name_ref BitOrAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 7879a95b86eb8..283724486a647 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @BitXor [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @BitXor [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @BitXorAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @BitXorAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+122, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+122, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+124, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+145, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+145, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+140, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+147, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+147, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+149, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+170, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+170, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+164, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+140, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+164, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %BitXorAssign.ref: type = name_ref BitXorAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %BitXorAssign.ref: type = name_ref BitXorAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 53e186f5d4a31..5f0f8d4d8c619 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -28,22 +28,23 @@ fn TestOp() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Dec [template] -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.3: type = ptr_type %C [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Dec [template] +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.4: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.4: type = tuple_type () [template] +// CHECK:STDOUT: %.5: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %Self [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %Self [symbolic] +// CHECK:STDOUT: %.7: = interface_witness (%Op.1) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -58,9 +59,9 @@ fn TestOp() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+142, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+142, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+144, unloaded -// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+160, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+160, loaded [template = constants.%.10] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+154, loaded [template = constants.%Op.2] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+154, unloaded // CHECK:STDOUT: } @@ -76,7 +77,7 @@ fn TestOp() { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Dec.ref: type = name_ref Dec, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Dec.ref: type = name_ref Dec, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} // CHECK:STDOUT: } @@ -88,15 +89,15 @@ fn TestOp() { // CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc18_21: type = ptr_type %C [template = constants.%.3] -// CHECK:STDOUT: %self.loc18_14.1: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_14.3: %.3 = bind_name self, %self.loc18_14.1 -// CHECK:STDOUT: %.loc18_9: %.3 = addr_pattern %self.loc18_14.3 +// CHECK:STDOUT: %.loc18_21: type = ptr_type %C [template = constants.%.4] +// CHECK:STDOUT: %self.loc18_14.1: %.4 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc18_14.3: %.4 = bind_name self, %self.loc18_14.1 +// CHECK:STDOUT: %.loc18_9: %.4 = addr_pattern %self.loc18_14.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -104,17 +105,19 @@ fn TestOp() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr @impl.%self.loc18_14.3: %.3](); +// CHECK:STDOUT: fn @Op.1[addr @impl.%self.loc18_14.3: %.4](); // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self) [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self) [symbolic = %.2 (constants.%.6)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.5)](); +// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.6)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp() { @@ -127,21 +130,21 @@ fn TestOp() { // CHECK:STDOUT: %.loc22_16: init %C = converted %.loc22_15.1, %.loc22_15.2 [template = constants.%struct] // CHECK:STDOUT: assign %c.var, %.loc22_16 // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c -// CHECK:STDOUT: %Op.ref: %.8 = name_ref Op, imports.%import_ref.3 [template = constants.%.9] +// CHECK:STDOUT: %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10] // CHECK:STDOUT: %.loc23_3.1: %Op.type.2 = interface_witness_access @impl.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc23_3.2: = bound_method %c.ref, %.loc23_3.1 -// CHECK:STDOUT: %.loc23_5: %.3 = addr_of %c.ref -// CHECK:STDOUT: %Op.call: init %.4 = call %.loc23_3.2(%.loc23_5) +// CHECK:STDOUT: %.loc23_5: %.4 = addr_of %c.ref +// CHECK:STDOUT: %Op.call: init %.5 = call %.loc23_3.2(%.loc23_5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.2(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.2(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index ec57570e781ca..8c85e011b8207 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Div [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Div [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @DivAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @DivAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+212, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+212, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+214, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+235, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+235, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+230, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+237, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+237, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+239, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+260, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+260, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+254, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+230, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+254, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Div.ref: type = name_ref Div, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Div.ref: type = name_ref Div, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %DivAssign.ref: type = name_ref DivAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %DivAssign.ref: type = name_ref DivAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 58d665e905ff0..174a55b9917c6 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -87,10 +87,11 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Eq [template] -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Eq [template] +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template] // CHECK:STDOUT: %Equal.1: %Equal.type.1 = struct_value () [template] @@ -100,16 +101,16 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Equal.2: %Equal.type.2 = struct_value () [template] // CHECK:STDOUT: %NotEqual.type.2: type = fn_type @NotEqual.2 [template] // CHECK:STDOUT: %NotEqual.2: %NotEqual.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Equal.1, %NotEqual.1) [template] +// CHECK:STDOUT: %.5: = interface_witness (%Equal.1, %NotEqual.1) [template] // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [template] // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.6: type = assoc_entity_type %.2, %Equal.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %.3, %Equal.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template] // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.2, %NotEqual.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.3, %NotEqual.type.2 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element1, imports.%import_ref.9 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -125,10 +126,10 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.10] // CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2] // CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2] // CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] @@ -148,7 +149,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { // CHECK:STDOUT: %C.ref.loc11_17: type = name_ref C, %C.decl [template = constants.%C] @@ -184,7 +185,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: witness = (imports.%import_ref.5, imports.%import_ref.6) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { // CHECK:STDOUT: %C.ref.loc7_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc7_12.1: %C = param self, runtime_param0 @@ -209,7 +210,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc8_37.2: type = converted %bool.make_type.loc8, %.loc8_37.1 [template = bool] // CHECK:STDOUT: %return.var.loc8: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc6: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Equal = %Equal.decl @@ -218,6 +219,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -228,14 +231,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @NotEqual.1[@impl.%self.loc8_15.2: %C](@impl.%other.loc8_24.2: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Equal.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Equal.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Equal.2.%Self (%Self)](%other: @Equal.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @NotEqual.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @NotEqual.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @NotEqual.2.%Self (%Self)](%other: @NotEqual.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } @@ -244,7 +247,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Equal.ref: %.6 = name_ref Equal, imports.%import_ref.3 [template = constants.%.7] +// CHECK:STDOUT: %Equal.ref: %.7 = name_ref Equal, imports.%import_ref.3 [template = constants.%.8] // CHECK:STDOUT: %.loc12_12.1: %Equal.type.2 = interface_witness_access @impl.%.loc6, element0 [template = constants.%Equal.1] // CHECK:STDOUT: %.loc12_12.2: = bound_method %a.ref, %.loc12_12.1 // CHECK:STDOUT: %Equal.call: init bool = call %.loc12_12.2(%a.ref, %b.ref) @@ -257,7 +260,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %NotEqual.ref: %.8 = name_ref NotEqual, imports.%import_ref.4 [template = constants.%.9] +// CHECK:STDOUT: %NotEqual.ref: %.9 = name_ref NotEqual, imports.%import_ref.4 [template = constants.%.10] // CHECK:STDOUT: %.loc16_12.1: %NotEqual.type.2 = interface_witness_access @impl.%.loc6, element1 [template = constants.%NotEqual.1] // CHECK:STDOUT: %.loc16_12.2: = bound_method %a.ref, %.loc16_12.1 // CHECK:STDOUT: %NotEqual.call: init bool = call %.loc16_12.2(%a.ref, %b.ref) @@ -287,24 +290,25 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: constants { // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [template] // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = interface_type @Eq [template] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = interface_type @Eq [template] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [template] // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Equal.type [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Equal.type [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template] // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [template] // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [template] // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.4, %NotEqual.type [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.5, %NotEqual.type [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.9 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -321,10 +325,10 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.5] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/comparison, inst+26, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/comparison, inst+47, unloaded // CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded @@ -375,6 +379,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } @@ -385,12 +391,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %Equal.ref: %.5 = name_ref Equal, imports.%import_ref.4 [template = constants.%.6] +// CHECK:STDOUT: %Equal.ref: %.6 = name_ref Equal, imports.%import_ref.4 [template = constants.%.7] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Equal(constants.%Self: %.4) { -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Equal(constants.%Self: %.5) { +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Equal.%Self (%Self)](%other: @Equal.%Self (%Self)) -> bool; // CHECK:STDOUT: } @@ -399,12 +405,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %NotEqual.ref: %.7 = name_ref NotEqual, imports.%import_ref.5 [template = constants.%.8] +// CHECK:STDOUT: %NotEqual.ref: %.8 = name_ref NotEqual, imports.%import_ref.5 [template = constants.%.9] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @NotEqual(constants.%Self: %.4) { -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @NotEqual(constants.%Self: %.5) { +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @NotEqual.%Self (%Self)](%other: @NotEqual.%Self (%Self)) -> bool; // CHECK:STDOUT: } @@ -422,11 +428,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.2: type = interface_type @Eq [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.3: type = interface_type @Eq [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template] // CHECK:STDOUT: %Equal.1: %Equal.type.1 = struct_value () [template] @@ -436,32 +443,32 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Equal.2: %Equal.type.2 = struct_value () [template] // CHECK:STDOUT: %NotEqual.type.2: type = fn_type @NotEqual.2 [template] // CHECK:STDOUT: %NotEqual.2: %NotEqual.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Equal.1, %NotEqual.1) [template] +// CHECK:STDOUT: %.5: = interface_witness (%Equal.1, %NotEqual.1) [template] // CHECK:STDOUT: %TestRhsBad.type: type = fn_type @TestRhsBad [template] // CHECK:STDOUT: %TestRhsBad: %TestRhsBad.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.6: type = assoc_entity_type %.2, %Equal.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %.3, %Equal.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.2: @ImplicitAs.%.1 (%.8) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.3: %.8 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.9: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.2: @ImplicitAs.%.1 (%.9) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.3: %.9 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.13 [symbolic] -// CHECK:STDOUT: %.11: type = interface_type @ImplicitAs, @ImplicitAs(%C) [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %.9, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.13 [symbolic] +// CHECK:STDOUT: %.12: type = interface_type @ImplicitAs, @ImplicitAs(%C) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%C) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Convert.type.2 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.13 [template] -// CHECK:STDOUT: %.14: %.9 = assoc_entity element0, imports.%import_ref.14 [symbolic] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.12, %Convert.type.2 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.13 [template] +// CHECK:STDOUT: %.15: %.10 = assoc_entity element0, imports.%import_ref.14 [symbolic] // CHECK:STDOUT: %TestLhsBad.type: type = fn_type @TestLhsBad [template] // CHECK:STDOUT: %TestLhsBad: %TestLhsBad.type = struct_value () [template] -// CHECK:STDOUT: %.15: type = assoc_entity_type %.2, %NotEqual.type.2 [template] -// CHECK:STDOUT: %.16: %.15 = assoc_entity element1, imports.%import_ref.15 [template] +// CHECK:STDOUT: %.16: type = assoc_entity_type %.3, %NotEqual.type.2 [template] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element1, imports.%import_ref.15 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -478,17 +485,17 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.15 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.16] +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.4: %.16 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.17] // CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2] // CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2] // CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded // CHECK:STDOUT: %import_ref.9: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.11: @ImplicitAs.%.2 (%.9) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.14)] +// CHECK:STDOUT: %import_ref.11: @ImplicitAs.%.2 (%.10) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.15)] // CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -509,7 +516,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [template = constants.%TestRhsBad] { // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, %C.decl [template = constants.%C] @@ -549,12 +556,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.8), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.9)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.9) = assoc_entity element0, imports.%import_ref.13 [symbolic = %.3 (constants.%.10)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.9), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.10)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.10) = assoc_entity element0, imports.%import_ref.13 [symbolic = %.3 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -564,7 +571,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] { // CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc8_12.1: %C = param self, runtime_param0 @@ -589,7 +596,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc9_37.2: type = converted %bool.make_type.loc9, %.loc9_37.1 [template = bool] // CHECK:STDOUT: %return.var.loc9: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc7: = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Equal = %Equal.decl @@ -598,11 +605,15 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } @@ -613,14 +624,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @NotEqual.1[@impl.%self.loc9_15.2: %C](@impl.%other.loc9_24.2: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Equal.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Equal.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Equal.2.%Self (%Self.1)](%other: @Equal.2.%Self (%Self.1)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @NotEqual.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @NotEqual.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @NotEqual.2.%Self (%Self.1)](%other: @NotEqual.2.%Self (%Self.1)) -> bool; // CHECK:STDOUT: } @@ -629,12 +640,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %Equal.ref: %.6 = name_ref Equal, imports.%import_ref.3 [template = constants.%.7] +// CHECK:STDOUT: %Equal.ref: %.7 = name_ref Equal, imports.%import_ref.3 [template = constants.%.8] // CHECK:STDOUT: %.loc23_12.1: %Equal.type.2 = interface_witness_access @impl.%.loc7, element0 [template = constants.%Equal.1] // CHECK:STDOUT: %.loc23_12.2: = bound_method %a.ref, %.loc23_12.1 -// CHECK:STDOUT: %.loc23_12.3: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.11] -// CHECK:STDOUT: %.loc23_12.4: %.12 = specific_constant imports.%import_ref.11, @ImplicitAs(constants.%C) [template = constants.%.13] -// CHECK:STDOUT: %Convert.ref: %.12 = name_ref Convert, %.loc23_12.4 [template = constants.%.13] +// CHECK:STDOUT: %.loc23_12.3: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.12] +// CHECK:STDOUT: %.loc23_12.4: %.13 = specific_constant imports.%import_ref.11, @ImplicitAs(constants.%C) [template = constants.%.14] +// CHECK:STDOUT: %Convert.ref: %.13 = name_ref Convert, %.loc23_12.4 [template = constants.%.14] // CHECK:STDOUT: %.loc23_12.5: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Equal.call: init bool = call %.loc23_12.2() [template = ] // CHECK:STDOUT: %.loc23_16.1: bool = value_of_initializer %Equal.call [template = ] @@ -642,10 +653,10 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: return %.loc23_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.2: @ImplicitAs.%.1 (%.8)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.2: @ImplicitAs.%.1 (%.9)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.8)] -// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.9)] +// CHECK:STDOUT: %Self: %.9 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.3)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.3)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -654,7 +665,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %NotEqual.ref: %.15 = name_ref NotEqual, imports.%import_ref.4 [template = constants.%.16] +// CHECK:STDOUT: %NotEqual.ref: %.16 = name_ref NotEqual, imports.%import_ref.4 [template = constants.%.17] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -688,7 +699,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.2) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.8 +// CHECK:STDOUT: %.1 => constants.%.9 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -696,11 +707,11 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Dest => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.11 +// CHECK:STDOUT: %.1 => constants.%.12 // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.12 -// CHECK:STDOUT: %.3 => constants.%.13 +// CHECK:STDOUT: %.2 => constants.%.13 +// CHECK:STDOUT: %.3 => constants.%.14 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index a9bf843052471..71bd4c588e193 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -45,33 +45,34 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Inc [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.3: type = ptr_type %C [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Inc [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.4: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.4: type = tuple_type () [template] +// CHECK:STDOUT: %.5: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %Self.1 [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.7: type = interface_type @AddAssign [template] -// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.6: type = ptr_type %Self.1 [symbolic] +// CHECK:STDOUT: %.7: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.8: type = interface_type @AddAssign [template] +// CHECK:STDOUT: %Self.2: %.8 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestIncNonRef.type: type = fn_type @TestIncNonRef [template] // CHECK:STDOUT: %TestIncNonRef: %TestIncNonRef.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAddAssignNonRef.type: type = fn_type @TestAddAssignNonRef [template] // CHECK:STDOUT: %TestAddAssignNonRef: %TestAddAssignNonRef.type = struct_value () [template] -// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %.8, %Op.type.4 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -87,13 +88,13 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3: %.12 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+64, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7: %.14 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.15] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded @@ -111,12 +112,12 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc18: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.7] +// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.8] // CHECK:STDOUT: } // CHECK:STDOUT: %TestIncNonRef.decl: %TestIncNonRef.type = fn_decl @TestIncNonRef [template = constants.%TestIncNonRef] { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] @@ -147,33 +148,33 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc16_21: type = ptr_type %C [template = constants.%.3] -// CHECK:STDOUT: %self.loc16_14.1: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc16_14.3: %.3 = bind_name self, %self.loc16_14.1 -// CHECK:STDOUT: %.loc16_9: %.3 = addr_pattern %self.loc16_14.3 +// CHECK:STDOUT: %.loc16_21: type = ptr_type %C [template = constants.%.4] +// CHECK:STDOUT: %self.loc16_14.1: %.4 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc16_14.3: %.4 = bind_name self, %self.loc16_14.1 +// CHECK:STDOUT: %.loc16_9: %.4 = addr_pattern %self.loc16_14.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness (%Op.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc15: = interface_witness (%Op.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.7 { +// CHECK:STDOUT: impl @impl.2: %C as %.8 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc19_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc19_21: type = ptr_type %C [template = constants.%.3] -// CHECK:STDOUT: %self.loc19_14.1: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc19_14.3: %.3 = bind_name self, %self.loc19_14.1 -// CHECK:STDOUT: %.loc19_9: %.3 = addr_pattern %self.loc19_14.3 +// CHECK:STDOUT: %.loc19_21: type = ptr_type %C [template = constants.%.4] +// CHECK:STDOUT: %self.loc19_14.1: %.4 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc19_14.3: %.4 = bind_name self, %self.loc19_14.1 +// CHECK:STDOUT: %.loc19_9: %.4 = addr_pattern %self.loc19_14.3 // CHECK:STDOUT: %C.ref.loc19_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc19_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc19_24.2: %C = bind_name other, %other.loc19_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc18: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc18: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,35 +182,37 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc13: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr @impl.1.%self.loc16_14.3: %.3](); +// CHECK:STDOUT: fn @Op.1[addr @impl.1.%self.loc16_14.3: %.4](); // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self.1) [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self.1) [symbolic = %.2 (constants.%.6)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.5)](); +// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.6)](); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc19_14.3: %.3](@impl.2.%other.loc19_24.2: %C); +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc19_14.3: %.4](@impl.2.%other.loc19_24.2: %C); // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { -// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.8) { +// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestIncNonRef(%a: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a -// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] +// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.3 [template = constants.%.13] // CHECK:STDOUT: %.loc30_3.1: %Op.type.2 = interface_witness_access @impl.1.%.loc15, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc30_3.2: = bound_method %a.ref, %.loc30_3.1 -// CHECK:STDOUT: %Op.call: init %.4 = call %.loc30_3.2() [template = ] +// CHECK:STDOUT: %Op.call: init %.5 = call %.loc30_3.2() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -217,30 +220,30 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] +// CHECK:STDOUT: %Op.ref: %.14 = name_ref Op, imports.%import_ref.7 [template = constants.%.15] // CHECK:STDOUT: %.loc40_5.1: %Op.type.4 = interface_witness_access @impl.2.%.loc18, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc40_5.2: = bound_method %a.ref, %.loc40_5.1 -// CHECK:STDOUT: %Op.call: init %.4 = call %.loc40_5.2() [template = ] +// CHECK:STDOUT: %Op.call: init %.5 = call %.loc40_5.2() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.2(constants.%Self.1) { // CHECK:STDOUT: %Self => constants.%Self.1 -// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.2(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index 6946c2261d3a7..53b76dc45aae9 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -46,41 +46,42 @@ fn TestRef(b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %TestUnary.type: type = fn_type @TestUnary [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %TestUnary: %TestUnary.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = interface_type @Negate [template] -// CHECK:STDOUT: %Self.1: %.4 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = interface_type @Negate [template] +// CHECK:STDOUT: %Self.1: %.5 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Op.type.1 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Op.type.1 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: %TestBinary.type: type = fn_type @TestBinary [template] // CHECK:STDOUT: %TestBinary: %TestBinary.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = interface_type @Add [template] -// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = interface_type @Add [template] +// CHECK:STDOUT: %Self.2: %.8 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Op.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Op.type.2 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestRef.type: type = fn_type @TestRef [template] // CHECK:STDOUT: %TestRef: %TestRef.type = struct_value () [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.10: type = interface_type @AddAssign [template] -// CHECK:STDOUT: %Self.3: %.10 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.11: type = interface_type @AddAssign [template] +// CHECK:STDOUT: %Self.3: %.11 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] -// CHECK:STDOUT: %.11: type = ptr_type %Self.3 [symbolic] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.10, %Op.type.3 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.15 [template] -// CHECK:STDOUT: %.14: type = interface_type @Inc [template] -// CHECK:STDOUT: %Self.4: %.14 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.12: type = ptr_type %Self.3 [symbolic] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.11, %Op.type.3 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.15 [template] +// CHECK:STDOUT: %.15: type = interface_type @Inc [template] +// CHECK:STDOUT: %Self.4: %.15 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.15: type = ptr_type %Self.4 [symbolic] -// CHECK:STDOUT: %.16: type = assoc_entity_type %.14, %Op.type.4 [template] -// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.20 [template] +// CHECK:STDOUT: %.16: type = ptr_type %Self.4 [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %.15, %Op.type.4 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.20 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -98,24 +99,24 @@ fn TestRef(b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.5] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded -// CHECK:STDOUT: %import_ref.3: %.5 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded -// CHECK:STDOUT: %import_ref.6: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8: %.8 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.8: %.9 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.10] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.11] // CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.13: %.12 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.13: %.13 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded // CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.15] // CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded -// CHECK:STDOUT: %import_ref.18: %.16 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.17] +// CHECK:STDOUT: %import_ref.18: %.17 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.18] // CHECK:STDOUT: %import_ref.19 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded // CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded // CHECK:STDOUT: } @@ -183,6 +184,8 @@ fn TestRef(b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc13: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -190,12 +193,12 @@ fn TestRef(b: C) { // CHECK:STDOUT: fn @TestUnary(%a: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a -// CHECK:STDOUT: %Op.ref: %.5 = name_ref Op, imports.%import_ref.3 [template = constants.%.6] +// CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.3 [template = constants.%.7] // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.1(constants.%Self.1: %.4) { -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.1(constants.%Self.1: %.5) { +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.1.%Self (%Self.1)]() -> @Op.1.%Self (%Self.1); // CHECK:STDOUT: } @@ -204,12 +207,12 @@ fn TestRef(b: C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.8 = name_ref Op, imports.%import_ref.8 [template = constants.%.9] +// CHECK:STDOUT: %Op.ref: %.9 = name_ref Op, imports.%import_ref.8 [template = constants.%.10] // CHECK:STDOUT: return to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.2: %.7) { -// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.2: %.8) { +// CHECK:STDOUT: %Self: %.8 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.2)](%other: @Op.2.%Self (%Self.2)) -> @Op.2.%Self (%Self.2); // CHECK:STDOUT: } @@ -225,24 +228,24 @@ fn TestRef(b: C) { // CHECK:STDOUT: assign %a.var, %.loc32_16 // CHECK:STDOUT: %a.ref.loc37: ref %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref.loc37: %.12 = name_ref Op, imports.%import_ref.13 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref.loc37: %.13 = name_ref Op, imports.%import_ref.13 [template = constants.%.14] // CHECK:STDOUT: %a.ref.loc41: ref %C = name_ref a, %a -// CHECK:STDOUT: %Op.ref.loc41: %.16 = name_ref Op, imports.%import_ref.18 [template = constants.%.17] +// CHECK:STDOUT: %Op.ref.loc41: %.17 = name_ref Op, imports.%import_ref.18 [template = constants.%.18] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.3(constants.%Self.3: %.10) { -// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.3)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.3.%Self (%Self.3) [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: generic fn @Op.3(constants.%Self.3: %.11) { +// CHECK:STDOUT: %Self: %.11 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.3)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.3.%Self (%Self.3) [symbolic = %.2 (constants.%.12)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.3.%.2 (%.11)](%other: @Op.3.%Self (%Self.3)); +// CHECK:STDOUT: fn[addr %self: @Op.3.%.2 (%.12)](%other: @Op.3.%Self (%Self.3)); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.4: %.14) { -// CHECK:STDOUT: %Self: %.14 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.4)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.4) [symbolic = %.2 (constants.%.15)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.4: %.15) { +// CHECK:STDOUT: %Self: %.15 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.4) [symbolic = %.2 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.15)](); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.16)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.1(constants.%Self.1) { @@ -255,11 +258,11 @@ fn TestRef(b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.3(constants.%Self.3) { // CHECK:STDOUT: %Self => constants.%Self.3 -// CHECK:STDOUT: %.2 => constants.%.11 +// CHECK:STDOUT: %.2 => constants.%.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.4) { // CHECK:STDOUT: %Self => constants.%Self.4 -// CHECK:STDOUT: %.2 => constants.%.15 +// CHECK:STDOUT: %.2 => constants.%.16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 48b0bdb1ae8f2..7ed217656b5a5 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -53,50 +53,51 @@ fn TestAssign(b: D) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.2: type = interface_type @Add [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.3: type = interface_type @Add [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = interface_type @AddAssign [template] -// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.6: type = ptr_type %C [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = interface_type @AddAssign [template] +// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.7: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.8: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.10: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.12: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.3: @ImplicitAs.%.1 (%.12) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.4: %.12 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.13: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.3: @ImplicitAs.%.1 (%.13) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.4: %.13 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.13: type = assoc_entity_type %.12, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.14 [symbolic] -// CHECK:STDOUT: %.15: type = interface_type @ImplicitAs, @ImplicitAs(%C) [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %.13, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.14 [symbolic] +// CHECK:STDOUT: %.16: type = interface_type @ImplicitAs, @ImplicitAs(%C) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%C) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.16: type = assoc_entity_type %.15, %Convert.type.2 [template] -// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.14 [template] -// CHECK:STDOUT: %.18: %.13 = assoc_entity element0, imports.%import_ref.15 [symbolic] +// CHECK:STDOUT: %.17: type = assoc_entity_type %.16, %Convert.type.2 [template] +// CHECK:STDOUT: %.18: %.17 = assoc_entity element0, imports.%import_ref.14 [template] +// CHECK:STDOUT: %.19: %.14 = assoc_entity element0, imports.%import_ref.15 [symbolic] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.19: type = assoc_entity_type %.5, %Op.type.4 [template] -// CHECK:STDOUT: %.20: %.19 = assoc_entity element0, imports.%import_ref.16 [template] +// CHECK:STDOUT: %.20: type = assoc_entity_type %.6, %Op.type.4 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.16 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -113,18 +114,18 @@ fn TestAssign(b: D) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+19, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.6] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.19 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.20] +// CHECK:STDOUT: %import_ref.7: %.20 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.21] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded // CHECK:STDOUT: %import_ref.10: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.12: @ImplicitAs.%.2 (%.13) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.18)] +// CHECK:STDOUT: %import_ref.12: @ImplicitAs.%.2 (%.14) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.19)] // CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -145,12 +146,12 @@ fn TestAssign(b: D) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc16: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc19: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.5] +// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] { // CHECK:STDOUT: %C.ref.loc23_12: type = name_ref C, %C.decl [template = constants.%C] @@ -187,12 +188,12 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.12)] -// CHECK:STDOUT: %Self: %.12 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %Self: %.13 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.4)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.12), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.13)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.13) = assoc_entity element0, imports.%import_ref.14 [symbolic = %.3 (constants.%.14)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.13), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.14)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.14) = assoc_entity element0, imports.%import_ref.14 [symbolic = %.3 (constants.%.15)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -202,7 +203,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc17_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc17_9.1: %C = param self, runtime_param0 @@ -213,25 +214,25 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %C.ref.loc17_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc16: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.5 { +// CHECK:STDOUT: impl @impl.2: %C as %.6 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc20_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc20_21: type = ptr_type %C [template = constants.%.6] -// CHECK:STDOUT: %self.loc20_14.1: %.6 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc20_14.3: %.6 = bind_name self, %self.loc20_14.1 -// CHECK:STDOUT: %.loc20_9: %.6 = addr_pattern %self.loc20_14.3 +// CHECK:STDOUT: %.loc20_21: type = ptr_type %C [template = constants.%.7] +// CHECK:STDOUT: %self.loc20_14.1: %.7 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc20_14.3: %.7 = bind_name self, %self.loc20_14.1 +// CHECK:STDOUT: %.loc20_9: %.7 = addr_pattern %self.loc20_14.3 // CHECK:STDOUT: %C.ref.loc20_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc20_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc20_24.2: %C = bind_name other, %other.loc20_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = interface_witness (%Op.decl) [template = constants.%.8] +// CHECK:STDOUT: %.loc19: = interface_witness (%Op.decl) [template = constants.%.9] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -239,52 +240,56 @@ fn TestAssign(b: D) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc13: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc14: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Op.1[@impl.1.%self.loc17_9.2: %C](@impl.1.%other.loc17_18.2: %C) -> %C; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc20_14.3: %.6](@impl.2.%other.loc20_24.2: %C); +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc20_14.3: %.7](@impl.2.%other.loc20_24.2: %C); // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.5) { -// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.7)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { +// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.7)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Test(%a: %C, %b: %D) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc34_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc16, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc34_12.2: = bound_method %a.ref, %.loc34_12.1 // CHECK:STDOUT: %.loc34_12.3: ref %C = temporary_storage -// CHECK:STDOUT: %.loc34_12.4: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.15] -// CHECK:STDOUT: %.loc34_12.5: %.16 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.17] -// CHECK:STDOUT: %Convert.ref: %.16 = name_ref Convert, %.loc34_12.5 [template = constants.%.17] +// CHECK:STDOUT: %.loc34_12.4: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.16] +// CHECK:STDOUT: %.loc34_12.5: %.17 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.18] +// CHECK:STDOUT: %Convert.ref: %.17 = name_ref Convert, %.loc34_12.5 [template = constants.%.18] // CHECK:STDOUT: %.loc34_12.6: %C = converted %b.ref, [template = ] // CHECK:STDOUT: %Op.call: init %C = call %.loc34_12.2() [template = ] // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.3: @ImplicitAs.%.1 (%.12)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.3: @ImplicitAs.%.1 (%.13)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.12)] -// CHECK:STDOUT: %Self: %.12 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.4)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.13)] +// CHECK:STDOUT: %Self: %.13 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.4)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.4)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -300,15 +305,15 @@ fn TestAssign(b: D) { // CHECK:STDOUT: assign %a.var, %.loc38_16 // CHECK:STDOUT: %a.ref: ref %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.19 = name_ref Op, imports.%import_ref.7 [template = constants.%.20] +// CHECK:STDOUT: %Op.ref: %.20 = name_ref Op, imports.%import_ref.7 [template = constants.%.21] // CHECK:STDOUT: %.loc48_5.1: %Op.type.4 = interface_witness_access @impl.2.%.loc19, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc48_5.2: = bound_method %a.ref, %.loc48_5.1 -// CHECK:STDOUT: %.loc48_3: %.6 = addr_of %a.ref -// CHECK:STDOUT: %.loc48_5.3: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.15] -// CHECK:STDOUT: %.loc48_5.4: %.16 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.17] -// CHECK:STDOUT: %Convert.ref: %.16 = name_ref Convert, %.loc48_5.4 [template = constants.%.17] +// CHECK:STDOUT: %.loc48_3: %.7 = addr_of %a.ref +// CHECK:STDOUT: %.loc48_5.3: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%.16] +// CHECK:STDOUT: %.loc48_5.4: %.17 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.18] +// CHECK:STDOUT: %Convert.ref: %.17 = name_ref Convert, %.loc48_5.4 [template = constants.%.18] // CHECK:STDOUT: %.loc48_5.5: %C = converted %b.ref, [template = ] -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc48_5.2() [template = ] +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc48_5.2() [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -322,12 +327,12 @@ fn TestAssign(b: D) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.6 +// CHECK:STDOUT: %.2 => constants.%.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) { @@ -344,7 +349,7 @@ fn TestAssign(b: D) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.3) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: %Self => constants.%Self.3 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -352,11 +357,11 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Dest => constants.%C // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.15 +// CHECK:STDOUT: %.1 => constants.%.16 // CHECK:STDOUT: %Self => constants.%Self.4 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.16 -// CHECK:STDOUT: %.3 => constants.%.17 +// CHECK:STDOUT: %.2 => constants.%.17 +// CHECK:STDOUT: %.3 => constants.%.18 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index ea7ce7bdc213b..d70b719456e2e 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -40,33 +40,34 @@ fn Test() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %X, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.n: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.4: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.5: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.5) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.5 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic] -// CHECK:STDOUT: %.7: type = interface_type @ImplicitAs, @ImplicitAs(%X) [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic] +// CHECK:STDOUT: %.8: type = interface_type @ImplicitAs, @ImplicitAs(%X) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(%X) [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.3 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.10: = interface_witness (%Convert.2) [template] -// CHECK:STDOUT: %.11: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.12: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.8, %Convert.type.3 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.11: = interface_witness (%Convert.2) [template] +// CHECK:STDOUT: %.12: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.13: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template] // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.3 [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(i32) [template] // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template] -// CHECK:STDOUT: %.13: type = assoc_entity_type %.12, %Convert.type.5 [template] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.6 [template] -// CHECK:STDOUT: %.15: = interface_witness (%Convert.4) [template] +// CHECK:STDOUT: %.14: type = assoc_entity_type %.13, %Convert.type.5 [template] +// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.16: = interface_witness (%Convert.4) [template] // CHECK:STDOUT: %Sink_i32.type: type = fn_type @Sink_i32 [template] // CHECK:STDOUT: %Sink_i32: %Sink_i32.type = struct_value () [template] // CHECK:STDOUT: %Sink_X.type: type = fn_type @Sink_X [template] @@ -76,7 +77,7 @@ fn Test() { // CHECK:STDOUT: %Source: %Source.type = struct_value () [template] // CHECK:STDOUT: %Test.type: type = fn_type @Test [template] // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] -// CHECK:STDOUT: %.16: %.5 = assoc_entity element0, imports.%import_ref.7 [symbolic] +// CHECK:STDOUT: %.17: %.6 = assoc_entity element0, imports.%import_ref.7 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -95,7 +96,7 @@ fn Test() { // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.16)] +// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.2 (%.6) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] // CHECK:STDOUT: %import_ref.5: @ImplicitAs.%Convert.type (%Convert.type.1) = import_ref Core//prelude/operators/as, inst+52, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -119,7 +120,7 @@ fn Test() { // CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ImplicitAs.ref.loc15: %ImplicitAs.type = name_ref ImplicitAs, imports.%import_ref.2 [template = constants.%ImplicitAs] // CHECK:STDOUT: %X.ref.loc15: type = name_ref X, %X.decl [template = constants.%X] -// CHECK:STDOUT: %.loc15_28: type = interface_type @ImplicitAs, @ImplicitAs(constants.%X) [template = constants.%.7] +// CHECK:STDOUT: %.loc15_28: type = interface_type @ImplicitAs, @ImplicitAs(constants.%X) [template = constants.%.8] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %X.ref.loc19: type = name_ref X, %X.decl [template = constants.%X] @@ -128,7 +129,7 @@ fn Test() { // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_26.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] // CHECK:STDOUT: %.loc19_26.2: type = converted %int.make_type_32.loc19, %.loc19_26.1 [template = i32] -// CHECK:STDOUT: %.loc19_26.3: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%.12] +// CHECK:STDOUT: %.loc19_26.3: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%.13] // CHECK:STDOUT: } // CHECK:STDOUT: %Sink_i32.decl: %Sink_i32.type = fn_decl @Sink_i32 [template = constants.%Sink_i32] { // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] @@ -155,12 +156,12 @@ fn Test() { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.4), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.5)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.5) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.6)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.5), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.6)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.6) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.3 (constants.%.7)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -170,7 +171,7 @@ fn Test() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: i32 as %.7 { +// CHECK:STDOUT: impl @impl.1: i32 as %.8 { // CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_20.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -180,14 +181,14 @@ fn Test() { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %return.var: ref %X = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15: = interface_witness (%Convert.decl) [template = constants.%.10] +// CHECK:STDOUT: %.loc15: = interface_witness (%Convert.decl) [template = constants.%.11] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl // CHECK:STDOUT: witness = %.loc15 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %X as %.12 { +// CHECK:STDOUT: impl @impl.2: %X as %.13 { // CHECK:STDOUT: %Convert.decl: %Convert.type.4 = fn_decl @Convert.3 [template = constants.%Convert.4] { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %self.loc20_14.1: %X = param self, runtime_param0 @@ -197,7 +198,7 @@ fn Test() { // CHECK:STDOUT: %.loc20_28.2: type = converted %int.make_type_32, %.loc20_28.1 [template = i32] // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19: = interface_witness (%Convert.decl) [template = constants.%.15] +// CHECK:STDOUT: %.loc19: = interface_witness (%Convert.decl) [template = constants.%.16] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Convert = %Convert.decl @@ -209,6 +210,7 @@ fn Test() { // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32] // CHECK:STDOUT: %.loc12_8: %.2 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc13: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X @@ -217,10 +219,10 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.4)) { +// CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.5)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.5)] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest); // CHECK:STDOUT: } @@ -262,9 +264,9 @@ fn Test() { // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %.loc30_18.1: ref %X = temporary_storage // CHECK:STDOUT: %Source.call.loc30: init %X = call %Source.ref.loc30() to %.loc30_18.1 -// CHECK:STDOUT: %.loc30_11.1: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%.12] -// CHECK:STDOUT: %.loc30_11.2: %.13 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.14] -// CHECK:STDOUT: %Convert.ref.loc30: %.13 = name_ref Convert, %.loc30_11.2 [template = constants.%.14] +// CHECK:STDOUT: %.loc30_11.1: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%.13] +// CHECK:STDOUT: %.loc30_11.2: %.14 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.15] +// CHECK:STDOUT: %Convert.ref.loc30: %.14 = name_ref Convert, %.loc30_11.2 [template = constants.%.15] // CHECK:STDOUT: %.loc30_18.2: ref %X = temporary %.loc30_18.1, %Source.call.loc30 // CHECK:STDOUT: %.loc30_11.3: %Convert.type.5 = interface_witness_access @impl.2.%.loc19, element0 [template = constants.%Convert.4] // CHECK:STDOUT: %.loc30_11.4: = bound_method %.loc30_18.2, %.loc30_11.3 @@ -281,9 +283,9 @@ fn Test() { // CHECK:STDOUT: %.loc31_16.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc31_16.2: type = converted %int.make_type_32, %.loc31_16.1 [template = i32] // CHECK:STDOUT: %Source.call.loc31: init i32 = call %Source.ref.loc31() -// CHECK:STDOUT: %.loc31_9.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%X) [template = constants.%.7] -// CHECK:STDOUT: %.loc31_9.2: %.8 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%X) [template = constants.%.9] -// CHECK:STDOUT: %Convert.ref.loc31: %.8 = name_ref Convert, %.loc31_9.2 [template = constants.%.9] +// CHECK:STDOUT: %.loc31_9.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%X) [template = constants.%.8] +// CHECK:STDOUT: %.loc31_9.2: %.9 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%X) [template = constants.%.10] +// CHECK:STDOUT: %Convert.ref.loc31: %.9 = name_ref Convert, %.loc31_9.2 [template = constants.%.10] // CHECK:STDOUT: %.loc31_16.3: ref i32 = temporary_storage // CHECK:STDOUT: %.loc31_16.4: ref i32 = temporary %.loc31_16.3, %Source.call.loc31 // CHECK:STDOUT: %.loc31_9.3: %Convert.type.3 = interface_witness_access @impl.1.%.loc15, element0 [template = constants.%Convert.2] @@ -312,7 +314,7 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.4 +// CHECK:STDOUT: %.1 => constants.%.5 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -320,17 +322,17 @@ fn Test() { // CHECK:STDOUT: %Dest => constants.%X // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.3 // CHECK:STDOUT: %Convert => constants.%Convert.3 -// CHECK:STDOUT: %.2 => constants.%.8 -// CHECK:STDOUT: %.3 => constants.%.9 +// CHECK:STDOUT: %.2 => constants.%.9 +// CHECK:STDOUT: %.3 => constants.%.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(constants.%X, i32) { // CHECK:STDOUT: %Dest => constants.%X -// CHECK:STDOUT: %.1 => constants.%.7 +// CHECK:STDOUT: %.1 => constants.%.8 // CHECK:STDOUT: %Self => i32 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -338,17 +340,17 @@ fn Test() { // CHECK:STDOUT: %Dest => i32 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5 // CHECK:STDOUT: %Convert => constants.%Convert.5 -// CHECK:STDOUT: %.2 => constants.%.13 -// CHECK:STDOUT: %.3 => constants.%.14 +// CHECK:STDOUT: %.2 => constants.%.14 +// CHECK:STDOUT: %.3 => constants.%.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert.1(i32, constants.%X) { // CHECK:STDOUT: %Dest => i32 -// CHECK:STDOUT: %.1 => constants.%.12 +// CHECK:STDOUT: %.1 => constants.%.13 // CHECK:STDOUT: %Self => constants.%X // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 41948d3954299..0c8e9b17e8a52 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -28,22 +28,23 @@ fn TestOp() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Inc [template] -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.3: type = ptr_type %C [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Inc [template] +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.4: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.4: type = tuple_type () [template] +// CHECK:STDOUT: %.5: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %Self [symbolic] -// CHECK:STDOUT: %.6: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %Self [symbolic] +// CHECK:STDOUT: %.7: = interface_witness (%Op.1) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -58,9 +59,9 @@ fn TestOp() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded -// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.3: %.9 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.10] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+64, loaded [template = constants.%Op.2] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded // CHECK:STDOUT: } @@ -76,7 +77,7 @@ fn TestOp() { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} // CHECK:STDOUT: } @@ -88,15 +89,15 @@ fn TestOp() { // CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc18_21: type = ptr_type %C [template = constants.%.3] -// CHECK:STDOUT: %self.loc18_14.1: %.3 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc18_14.3: %.3 = bind_name self, %self.loc18_14.1 -// CHECK:STDOUT: %.loc18_9: %.3 = addr_pattern %self.loc18_14.3 +// CHECK:STDOUT: %.loc18_21: type = ptr_type %C [template = constants.%.4] +// CHECK:STDOUT: %self.loc18_14.1: %.4 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc18_14.3: %.4 = bind_name self, %self.loc18_14.1 +// CHECK:STDOUT: %.loc18_9: %.4 = addr_pattern %self.loc18_14.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.6] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -104,17 +105,19 @@ fn TestOp() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.1[addr @impl.%self.loc18_14.3: %.3](); +// CHECK:STDOUT: fn @Op.1[addr @impl.%self.loc18_14.3: %.4](); // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self) [symbolic = %.2 (constants.%.5)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.2.%Self (%Self) [symbolic = %.2 (constants.%.6)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.5)](); +// CHECK:STDOUT: fn[addr %self: @Op.2.%.2 (%.6)](); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp() { @@ -127,21 +130,21 @@ fn TestOp() { // CHECK:STDOUT: %.loc22_16: init %C = converted %.loc22_15.1, %.loc22_15.2 [template = constants.%struct] // CHECK:STDOUT: assign %c.var, %.loc22_16 // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c -// CHECK:STDOUT: %Op.ref: %.8 = name_ref Op, imports.%import_ref.3 [template = constants.%.9] +// CHECK:STDOUT: %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10] // CHECK:STDOUT: %.loc23_3.1: %Op.type.2 = interface_witness_access @impl.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc23_3.2: = bound_method %c.ref, %.loc23_3.1 -// CHECK:STDOUT: %.loc23_5: %.3 = addr_of %c.ref -// CHECK:STDOUT: %Op.call: init %.4 = call %.loc23_3.2(%.loc23_5) +// CHECK:STDOUT: %.loc23_5: %.4 = addr_of %c.ref +// CHECK:STDOUT: %Op.call: init %.5 = call %.loc23_3.2(%.loc23_5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.2(constants.%Self) { // CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %.2 => constants.%.5 +// CHECK:STDOUT: %.2 => constants.%.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.2(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.3 +// CHECK:STDOUT: %.2 => constants.%.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index ae90f920843d8..e8b1f7d503b82 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @LeftShift [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @LeftShift [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @LeftShiftAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @LeftShiftAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+172, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+172, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+174, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+195, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+195, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+190, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+197, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+197, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+199, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+220, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+220, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+214, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+190, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+214, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %LeftShiftAssign.ref: type = name_ref LeftShiftAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %LeftShiftAssign.ref: type = name_ref LeftShiftAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 93660eb06e69e..4edf096b0371e 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Mod [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Mod [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @ModAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @ModAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+262, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+262, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+264, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+285, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+285, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+280, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+287, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+287, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+289, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+310, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+310, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+304, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+280, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+304, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Mod.ref: type = name_ref Mod, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Mod.ref: type = name_ref Mod, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %ModAssign.ref: type = name_ref ModAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %ModAssign.ref: type = name_ref ModAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index 46fa4712204d7..d2b58af22e761 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Mul [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Mul [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @MulAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @MulAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+162, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+162, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+164, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+185, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+185, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+180, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+187, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+187, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+189, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+210, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+210, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+204, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+180, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+204, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Mul.ref: type = name_ref Mul, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Mul.ref: type = name_ref Mul, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %MulAssign.ref: type = name_ref MulAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %MulAssign.ref: type = name_ref MulAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index 227c56ef15471..cf4f7acb32117 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -29,20 +29,21 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Negate [template] -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Negate [template] +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -57,9 +58,9 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.8] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+85, loaded [template = constants.%Op.2] // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded // CHECK:STDOUT: } @@ -75,7 +76,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Negate.ref: type = name_ref Negate, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Negate.ref: type = name_ref Negate, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, %C.decl [template = constants.%C] @@ -93,7 +94,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -101,7 +102,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C.ref.loc18_23: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -109,6 +110,8 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -121,8 +124,8 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: return %.loc19_14 to @impl.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self)]() -> @Op.2.%Self (%Self); // CHECK:STDOUT: } @@ -130,7 +133,7 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: fn @TestOp(%a: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a -// CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.3 [template = constants.%.7] +// CHECK:STDOUT: %Op.ref: %.7 = name_ref Op, imports.%import_ref.3 [template = constants.%.8] // CHECK:STDOUT: %.loc24_10.1: %Op.type.2 = interface_witness_access @impl.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc24_10.2: = bound_method %a.ref, %.loc24_10.1 // CHECK:STDOUT: %.loc23: ref %C = splice_block %return {} diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index e1312117f32c7..bc3cc616ef6ca 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -79,10 +79,11 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Ordered [template] -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Ordered [template] +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %Less.type.1: type = fn_type @Less.1 [template] // CHECK:STDOUT: %Less.1: %Less.type.1 = struct_value () [template] @@ -100,24 +101,24 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %Greater.2: %Greater.type.2 = struct_value () [template] // CHECK:STDOUT: %GreaterOrEquivalent.type.2: type = fn_type @GreaterOrEquivalent.2 [template] // CHECK:STDOUT: %GreaterOrEquivalent.2: %GreaterOrEquivalent.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Less.1, %LessOrEquivalent.1, %Greater.1, %GreaterOrEquivalent.1) [template] +// CHECK:STDOUT: %.5: = interface_witness (%Less.1, %LessOrEquivalent.1, %Greater.1, %GreaterOrEquivalent.1) [template] // CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [template] // CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.6: type = assoc_entity_type %.2, %Less.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.7: type = assoc_entity_type %.3, %Less.type.2 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.12 [template] // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [template] // CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [template] -// CHECK:STDOUT: %.8: type = assoc_entity_type %.2, %LessOrEquivalent.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.13 [template] +// CHECK:STDOUT: %.9: type = assoc_entity_type %.3, %LessOrEquivalent.type.2 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element1, imports.%import_ref.13 [template] // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [template] // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Greater.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element2, imports.%import_ref.14 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Greater.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element2, imports.%import_ref.14 [template] // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [template] // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.2, %GreaterOrEquivalent.type.2 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element3, imports.%import_ref.15 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.3, %GreaterOrEquivalent.type.2 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element3, imports.%import_ref.15 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -133,12 +134,12 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+56, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+77, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+98, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: %.10 = import_ref Core//prelude/operators/comparison, inst+119, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.6: %.12 = import_ref Core//prelude/operators/comparison, inst+140, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.3: %.7 = import_ref Core//prelude/operators/comparison, inst+77, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/comparison, inst+98, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.5: %.11 = import_ref Core//prelude/operators/comparison, inst+119, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.6: %.13 = import_ref Core//prelude/operators/comparison, inst+140, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.7: %Less.type.2 = import_ref Core//prelude/operators/comparison, inst+72, loaded [template = constants.%Less.2] // CHECK:STDOUT: %import_ref.8: %LessOrEquivalent.type.2 = import_ref Core//prelude/operators/comparison, inst+93, loaded [template = constants.%LessOrEquivalent.2] // CHECK:STDOUT: %import_ref.9: %Greater.type.2 = import_ref Core//prelude/operators/comparison, inst+114, loaded [template = constants.%Greater.2] @@ -164,7 +165,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Ordered.ref: type = name_ref Ordered, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Ordered.ref: type = name_ref Ordered, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { // CHECK:STDOUT: %C.ref.loc13_16: type = name_ref C, %C.decl [template = constants.%C] @@ -226,7 +227,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: witness = (imports.%import_ref.7, imports.%import_ref.8, imports.%import_ref.9, imports.%import_ref.10) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C as %.2 { +// CHECK:STDOUT: impl @impl: %C as %.3 { // CHECK:STDOUT: %Less.decl: %Less.type.1 = fn_decl @Less.1 [template = constants.%Less.1] { // CHECK:STDOUT: %C.ref.loc7_17: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc7_11.1: %C = param self, runtime_param0 @@ -275,7 +276,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc10_48.2: type = converted %bool.make_type.loc10, %.loc10_48.1 [template = bool] // CHECK:STDOUT: %return.var.loc10: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6: = interface_witness (%Less.decl, %LessOrEquivalent.decl, %Greater.decl, %GreaterOrEquivalent.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc6: = interface_witness (%Less.decl, %LessOrEquivalent.decl, %Greater.decl, %GreaterOrEquivalent.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Less = %Less.decl @@ -286,6 +287,8 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -300,26 +303,26 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @GreaterOrEquivalent.1[@impl.%self.loc10_26.2: %C](@impl.%other.loc10_35.2: %C) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Less.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Less.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Less.2.%Self (%Self)](%other: @Less.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @LessOrEquivalent.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @LessOrEquivalent.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @LessOrEquivalent.2.%Self (%Self)](%other: @LessOrEquivalent.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Greater.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Greater.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Greater.2.%Self (%Self)](%other: @Greater.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @GreaterOrEquivalent.2(constants.%Self: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @GreaterOrEquivalent.2(constants.%Self: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @GreaterOrEquivalent.2.%Self (%Self)](%other: @GreaterOrEquivalent.2.%Self (%Self)) -> bool; // CHECK:STDOUT: } @@ -328,7 +331,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Less.ref: %.6 = name_ref Less, imports.%import_ref.3 [template = constants.%.7] +// CHECK:STDOUT: %Less.ref: %.7 = name_ref Less, imports.%import_ref.3 [template = constants.%.8] // CHECK:STDOUT: %.loc14_12.1: %Less.type.2 = interface_witness_access @impl.%.loc6, element0 [template = constants.%Less.1] // CHECK:STDOUT: %.loc14_12.2: = bound_method %a.ref, %.loc14_12.1 // CHECK:STDOUT: %Less.call: init bool = call %.loc14_12.2(%a.ref, %b.ref) @@ -341,7 +344,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %LessOrEquivalent.ref: %.8 = name_ref LessOrEquivalent, imports.%import_ref.4 [template = constants.%.9] +// CHECK:STDOUT: %LessOrEquivalent.ref: %.9 = name_ref LessOrEquivalent, imports.%import_ref.4 [template = constants.%.10] // CHECK:STDOUT: %.loc18_12.1: %LessOrEquivalent.type.2 = interface_witness_access @impl.%.loc6, element1 [template = constants.%LessOrEquivalent.1] // CHECK:STDOUT: %.loc18_12.2: = bound_method %a.ref, %.loc18_12.1 // CHECK:STDOUT: %LessOrEquivalent.call: init bool = call %.loc18_12.2(%a.ref, %b.ref) @@ -354,7 +357,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Greater.ref: %.10 = name_ref Greater, imports.%import_ref.5 [template = constants.%.11] +// CHECK:STDOUT: %Greater.ref: %.11 = name_ref Greater, imports.%import_ref.5 [template = constants.%.12] // CHECK:STDOUT: %.loc22_12.1: %Greater.type.2 = interface_witness_access @impl.%.loc6, element2 [template = constants.%Greater.1] // CHECK:STDOUT: %.loc22_12.2: = bound_method %a.ref, %.loc22_12.1 // CHECK:STDOUT: %Greater.call: init bool = call %.loc22_12.2(%a.ref, %b.ref) @@ -367,7 +370,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %GreaterOrEquivalent.ref: %.12 = name_ref GreaterOrEquivalent, imports.%import_ref.6 [template = constants.%.13] +// CHECK:STDOUT: %GreaterOrEquivalent.ref: %.13 = name_ref GreaterOrEquivalent, imports.%import_ref.6 [template = constants.%.14] // CHECK:STDOUT: %.loc26_12.1: %GreaterOrEquivalent.type.2 = interface_witness_access @impl.%.loc6, element3 [template = constants.%GreaterOrEquivalent.1] // CHECK:STDOUT: %.loc26_12.2: = bound_method %a.ref, %.loc26_12.1 // CHECK:STDOUT: %GreaterOrEquivalent.call: init bool = call %.loc26_12.2(%a.ref, %b.ref) @@ -413,36 +416,37 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: constants { // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [template] // CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = interface_type @Ordered [template] -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = interface_type @Ordered [template] +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Less.type: type = fn_type @Less [template] // CHECK:STDOUT: %Less: %Less.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Less.type [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.6: type = assoc_entity_type %.5, %Less.type [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.12 [template] // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [template] // CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [template] // CHECK:STDOUT: %LessOrEquivalent.type: type = fn_type @LessOrEquivalent [template] // CHECK:STDOUT: %LessOrEquivalent: %LessOrEquivalent.type = struct_value () [template] -// CHECK:STDOUT: %.7: type = assoc_entity_type %.4, %LessOrEquivalent.type [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.13 [template] +// CHECK:STDOUT: %.8: type = assoc_entity_type %.5, %LessOrEquivalent.type [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.13 [template] // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [template] // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [template] // CHECK:STDOUT: %Greater.type: type = fn_type @Greater [template] // CHECK:STDOUT: %Greater: %Greater.type = struct_value () [template] -// CHECK:STDOUT: %.9: type = assoc_entity_type %.4, %Greater.type [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element2, imports.%import_ref.14 [template] +// CHECK:STDOUT: %.10: type = assoc_entity_type %.5, %Greater.type [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element2, imports.%import_ref.14 [template] // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [template] // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [template] // CHECK:STDOUT: %GreaterOrEquivalent.type: type = fn_type @GreaterOrEquivalent [template] // CHECK:STDOUT: %GreaterOrEquivalent: %GreaterOrEquivalent.type = struct_value () [template] -// CHECK:STDOUT: %.11: type = assoc_entity_type %.4, %GreaterOrEquivalent.type [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element3, imports.%import_ref.15 [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %.5, %GreaterOrEquivalent.type [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element3, imports.%import_ref.15 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -459,12 +463,12 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.5] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+56, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+77, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+98, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.6: %.9 = import_ref Core//prelude/operators/comparison, inst+119, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref Core//prelude/operators/comparison, inst+140, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//prelude/operators/comparison, inst+77, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5: %.8 = import_ref Core//prelude/operators/comparison, inst+98, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.6: %.10 = import_ref Core//prelude/operators/comparison, inst+119, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/comparison, inst+140, loaded [template = constants.%.13] // CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+72, unloaded // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+93, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/comparison, inst+114, unloaded @@ -547,6 +551,8 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: } @@ -557,12 +563,12 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %Less.ref: %.5 = name_ref Less, imports.%import_ref.4 [template = constants.%.6] +// CHECK:STDOUT: %Less.ref: %.6 = name_ref Less, imports.%import_ref.4 [template = constants.%.7] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Less(constants.%Self: %.4) { -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Less(constants.%Self: %.5) { +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Less.%Self (%Self)](%other: @Less.%Self (%Self)) -> bool; // CHECK:STDOUT: } @@ -571,12 +577,12 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %LessOrEquivalent.ref: %.7 = name_ref LessOrEquivalent, imports.%import_ref.5 [template = constants.%.8] +// CHECK:STDOUT: %LessOrEquivalent.ref: %.8 = name_ref LessOrEquivalent, imports.%import_ref.5 [template = constants.%.9] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @LessOrEquivalent(constants.%Self: %.4) { -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @LessOrEquivalent(constants.%Self: %.5) { +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @LessOrEquivalent.%Self (%Self)](%other: @LessOrEquivalent.%Self (%Self)) -> bool; // CHECK:STDOUT: } @@ -585,12 +591,12 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %Greater.ref: %.9 = name_ref Greater, imports.%import_ref.6 [template = constants.%.10] +// CHECK:STDOUT: %Greater.ref: %.10 = name_ref Greater, imports.%import_ref.6 [template = constants.%.11] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Greater(constants.%Self: %.4) { -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @Greater(constants.%Self: %.5) { +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Greater.%Self (%Self)](%other: @Greater.%Self (%Self)) -> bool; // CHECK:STDOUT: } @@ -599,12 +605,12 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %D = name_ref a, %a // CHECK:STDOUT: %b.ref: %D = name_ref b, %b -// CHECK:STDOUT: %GreaterOrEquivalent.ref: %.11 = name_ref GreaterOrEquivalent, imports.%import_ref.7 [template = constants.%.12] +// CHECK:STDOUT: %GreaterOrEquivalent.ref: %.12 = name_ref GreaterOrEquivalent, imports.%import_ref.7 [template = constants.%.13] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @GreaterOrEquivalent(constants.%Self: %.4) { -// CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: generic fn @GreaterOrEquivalent(constants.%Self: %.5) { +// CHECK:STDOUT: %Self: %.5 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @GreaterOrEquivalent.%Self (%Self)](%other: @GreaterOrEquivalent.%Self (%Self)) -> bool; // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index a73144294b7bd..2ec2e5cf0713e 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @RightShift [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @RightShift [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @RightShiftAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @RightShiftAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+222, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+222, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+224, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+245, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/bitwise, inst+245, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+240, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+247, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+247, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+249, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+270, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/bitwise, inst+270, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+264, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+240, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+264, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %RightShiftAssign.ref: type = name_ref RightShiftAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %RightShiftAssign.ref: type = name_ref RightShiftAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 0b50361cf9acb..95d8cb31aa740 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -36,33 +36,34 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = interface_type @Sub [template] -// CHECK:STDOUT: %Self.1: %.2 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = interface_type @Sub [template] +// CHECK:STDOUT: %Self.1: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] -// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = tuple_type () [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] -// CHECK:STDOUT: %.4: = interface_witness (%Op.1) [template] -// CHECK:STDOUT: %.5: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: = interface_witness (%Op.1) [template] +// CHECK:STDOUT: %.6: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] -// CHECK:STDOUT: %.6: type = interface_type @SubAssign [template] -// CHECK:STDOUT: %Self.2: %.6 = bind_symbolic_name Self 0 [symbolic] -// CHECK:STDOUT: %.7: type = ptr_type %C [template] +// CHECK:STDOUT: %.7: type = interface_type @SubAssign [template] +// CHECK:STDOUT: %Self.2: %.7 = bind_symbolic_name Self 0 [symbolic] +// CHECK:STDOUT: %.8: type = ptr_type %C [template] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] -// CHECK:STDOUT: %.8: type = ptr_type %Self.2 [symbolic] -// CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] +// CHECK:STDOUT: %.9: type = ptr_type %Self.2 [symbolic] +// CHECK:STDOUT: %.10: = interface_witness (%Op.3) [template] // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] -// CHECK:STDOUT: %.10: type = assoc_entity_type %.2, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.11: type = assoc_entity_type %.3, %Op.type.2 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] -// CHECK:STDOUT: %.12: type = assoc_entity_type %.6, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.13: type = assoc_entity_type %.7, %Op.type.4 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -78,13 +79,13 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+92, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+92, loaded [template = constants.%.3] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+94, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+115, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+115, loaded [template = constants.%.12] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+110, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+117, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+117, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+119, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+140, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+140, loaded [template = constants.%.14] // CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+134, loaded [template = constants.%Op.4] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+110, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+134, unloaded @@ -102,12 +103,12 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %Sub.ref: type = name_ref Sub, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Sub.ref: type = name_ref Sub, imports.%import_ref.1 [template = constants.%.3] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] -// CHECK:STDOUT: %SubAssign.ref: type = name_ref SubAssign, imports.%import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %SubAssign.ref: type = name_ref SubAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -121,9 +122,9 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %a.loc30_15.1: %.7 = param a, runtime_param0 -// CHECK:STDOUT: @TestAssign.%a: %.7 = bind_name a, %a.loc30_15.1 +// CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %a.loc30_15.1: %.8 = param a, runtime_param0 +// CHECK:STDOUT: @TestAssign.%a: %.8 = bind_name a, %a.loc30_15.1 // CHECK:STDOUT: %C.ref.loc30_25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc30_22.1: %C = param b, runtime_param1 // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 @@ -144,7 +145,7 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: %C as %.2 { +// CHECK:STDOUT: impl @impl.1: %C as %.3 { // CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] { // CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %self.loc18_9.1: %C = param self, runtime_param0 @@ -155,25 +156,25 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc18_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.4] +// CHECK:STDOUT: %.loc17: = interface_witness (%Op.decl) [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl // CHECK:STDOUT: witness = %.loc17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: %C as %.6 { +// CHECK:STDOUT: impl @impl.2: %C as %.7 { // CHECK:STDOUT: %Op.decl: %Op.type.3 = fn_decl @Op.3 [template = constants.%Op.3] { // CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C] -// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.7] -// CHECK:STDOUT: %self.loc23_14.1: %.7 = param self, runtime_param0 -// CHECK:STDOUT: %self.loc23_14.3: %.7 = bind_name self, %self.loc23_14.1 -// CHECK:STDOUT: %.loc23_9: %.7 = addr_pattern %self.loc23_14.3 +// CHECK:STDOUT: %.loc23_21: type = ptr_type %C [template = constants.%.8] +// CHECK:STDOUT: %self.loc23_14.1: %.8 = param self, runtime_param0 +// CHECK:STDOUT: %self.loc23_14.3: %.8 = bind_name self, %self.loc23_14.1 +// CHECK:STDOUT: %.loc23_9: %.8 = addr_pattern %self.loc23_14.3 // CHECK:STDOUT: %C.ref.loc23_31: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %other.loc23_24.1: %C = param other, runtime_param1 // CHECK:STDOUT: %other.loc23_24.2: %C = bind_name other, %other.loc23_24.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.9] +// CHECK:STDOUT: %.loc22: = interface_witness (%Op.decl) [template = constants.%.10] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Op = %Op.decl @@ -181,6 +182,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc15: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -193,29 +196,29 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %.loc19_14 to @impl.1.%return.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.2) { -// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] +// CHECK:STDOUT: generic fn @Op.2(constants.%Self.1: %.3) { +// CHECK:STDOUT: %Self: %.3 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.1)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Op.2.%Self (%Self.1)](%other: @Op.2.%Self (%Self.1)) -> @Op.2.%Self (%Self.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.7](@impl.2.%other.loc23_24.2: %C) { +// CHECK:STDOUT: fn @Op.3[addr @impl.2.%self.loc23_14.3: %.8](@impl.2.%other.loc23_24.2: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.6) { -// CHECK:STDOUT: %Self: %.6 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] -// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.8)] +// CHECK:STDOUT: generic fn @Op.4(constants.%Self.2: %.7) { +// CHECK:STDOUT: %Self: %.7 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.2: type = ptr_type @Op.4.%Self (%Self.2) [symbolic = %.2 (constants.%.9)] // CHECK:STDOUT: -// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.8)](%other: @Op.4.%Self (%Self.2)); +// CHECK:STDOUT: fn[addr %self: @Op.4.%.2 (%.9)](%other: @Op.4.%Self (%Self.2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestOp(%a: %C, %b: %C) -> %return: %C { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11] +// CHECK:STDOUT: %Op.ref: %.11 = name_ref Op, imports.%import_ref.3 [template = constants.%.12] // CHECK:STDOUT: %.loc27_12.1: %Op.type.2 = interface_witness_access @impl.1.%.loc17, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc27_12.2: = bound_method %a.ref, %.loc27_12.1 // CHECK:STDOUT: %.loc26: ref %C = splice_block %return {} @@ -223,16 +226,16 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: return %Op.call to %return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @TestAssign(%a: %.7, %b: %C) { +// CHECK:STDOUT: fn @TestAssign(%a: %.8, %b: %C) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.7 = name_ref a, %a +// CHECK:STDOUT: %a.ref: %.8 = name_ref a, %a // CHECK:STDOUT: %.loc31_3.1: ref %C = deref %a.ref // CHECK:STDOUT: %b.ref: %C = name_ref b, %b -// CHECK:STDOUT: %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13] +// CHECK:STDOUT: %Op.ref: %.13 = name_ref Op, imports.%import_ref.7 [template = constants.%.14] // CHECK:STDOUT: %.loc31_6.1: %Op.type.4 = interface_witness_access @impl.2.%.loc22, element0 [template = constants.%Op.3] // CHECK:STDOUT: %.loc31_6.2: = bound_method %.loc31_3.1, %.loc31_6.1 -// CHECK:STDOUT: %.loc31_3.2: %.7 = addr_of %.loc31_3.1 -// CHECK:STDOUT: %Op.call: init %.3 = call %.loc31_6.2(%.loc31_3.2, %b.ref) +// CHECK:STDOUT: %.loc31_3.2: %.8 = addr_of %.loc31_3.1 +// CHECK:STDOUT: %Op.call: init %.4 = call %.loc31_6.2(%.loc31_3.2, %b.ref) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -246,11 +249,11 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%Self.2) { // CHECK:STDOUT: %Self => constants.%Self.2 -// CHECK:STDOUT: %.2 => constants.%.8 +// CHECK:STDOUT: %.2 => constants.%.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Op.4(constants.%C) { // CHECK:STDOUT: %Self => constants.%C -// CHECK:STDOUT: %.2 => constants.%.7 +// CHECK:STDOUT: %.2 => constants.%.8 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 5ec37c291a3bd..8ef0b469b2fda 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -177,9 +177,10 @@ fn Main() { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %Main.type: type = fn_type @Main [template] // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -211,6 +212,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} +// CHECK:STDOUT: %.loc8: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index 6201e92038063..98d8de79216b8 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -208,6 +208,7 @@ alias C = Other.C; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -221,6 +222,7 @@ alias C = Other.C; // CHECK:STDOUT: %.loc5_11.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -292,6 +294,7 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -320,6 +323,7 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -348,12 +352,13 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -376,7 +381,8 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -429,7 +435,8 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -483,7 +490,8 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -537,7 +545,8 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -547,9 +556,9 @@ alias C = Other.C; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -589,7 +598,8 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -600,9 +610,9 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//export_name_copy // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -642,7 +652,8 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -652,9 +663,9 @@ alias C = Other.C; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name_indirect, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name_indirect, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name_indirect, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name_indirect, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name_indirect, inst+10, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name_indirect, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -694,7 +705,8 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -710,9 +722,9 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -817,6 +829,7 @@ alias C = Other.C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -825,9 +838,9 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+11, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Other//conflict, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index 44c012035a46b..0fcd046fa8471 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -173,6 +173,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -186,6 +187,7 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %.loc5_11.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -269,7 +271,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -316,7 +319,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -364,7 +368,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -412,7 +417,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -459,7 +465,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -506,7 +513,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -553,7 +561,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -600,7 +609,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -647,7 +657,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -705,7 +716,8 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } @@ -752,13 +764,14 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//use_non_export_then_base, inst+14, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//use_non_export_then_base, inst+15, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index 4e7d4feb49b89..e07332ad0a46e 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -120,9 +120,11 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %D, %.1 [template] -// CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %D, %.1 [template] +// CHECK:STDOUT: %.6: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -138,6 +140,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.loc5_11.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -147,7 +150,8 @@ var d: D = {.y = ()}; // CHECK:STDOUT: class @D { // CHECK:STDOUT: %.loc9_11.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc9_11.2: type = converted %.loc9_11.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %.loc9_8: %.4 = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc9_8: %.5 = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc10: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -158,7 +162,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+11, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -175,11 +179,12 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+11, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+13, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } @@ -205,11 +210,12 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+11, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+13, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } @@ -232,7 +238,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: --- export_name_then_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export_name, inst+12, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export_name, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -248,15 +254,16 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -295,15 +302,16 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_name, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_name, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -342,15 +350,16 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -391,7 +400,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export_import_then_name, inst+12, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export_import_then_name, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -419,15 +428,16 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -466,22 +476,24 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template] // CHECK:STDOUT: %D: type = class_type @D [template] -// CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %struct.2: %D = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+11, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+11, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+16, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+13, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+12, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+14, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+18, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -523,7 +535,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.loc8_21: init %C = converted %.loc8_20.1, %.loc8_20.4 [template = constants.%struct.1] // CHECK:STDOUT: assign file.%c.var, %.loc8_21 // CHECK:STDOUT: %.loc9_19.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc9_20.1: %.4 = struct_literal (%.loc9_19.1) +// CHECK:STDOUT: %.loc9_20.1: %.5 = struct_literal (%.loc9_19.1) // CHECK:STDOUT: %.loc9_20.2: ref %.1 = class_element_access file.%d.var, element0 // CHECK:STDOUT: %.loc9_19.2: init %.1 = tuple_init () to %.loc9_20.2 [template = constants.%tuple] // CHECK:STDOUT: %.loc9_20.3: init %.1 = converted %.loc9_19.1, %.loc9_19.2 [template = constants.%tuple] diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index 51d840f6e94a8..c61a1594da3d0 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -211,9 +211,11 @@ private export C; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: %.3: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %NSC: type = class_type @NSC [template] -// CHECK:STDOUT: %.4: type = unbound_element_type %NSC, %.1 [template] -// CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.5: type = unbound_element_type %NSC, %.1 [template] +// CHECK:STDOUT: %.6: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.7: = complete_type_witness %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -232,6 +234,7 @@ private export C; // CHECK:STDOUT: %.loc5_11.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -241,7 +244,8 @@ private export C; // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: %.loc10_11.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_11.2: type = converted %.loc10_11.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %.loc10_8: %.4 = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc10_8: %.5 = field_decl y, element0 [template] +// CHECK:STDOUT: %.loc11: = complete_type_witness %.6 [template = constants.%.7] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%NSC @@ -254,21 +258,23 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %NSC: type = class_type @NSC [template] -// CHECK:STDOUT: %.3: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+13, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = file.%NSC // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+14, loaded [template = constants.%NSC] // CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+17, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+15, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+19, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -296,12 +302,12 @@ private export C; // CHECK:STDOUT: --- not_reexporting.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//export, inst+14, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//export, inst+15, unloaded // CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+22, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+24, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -318,21 +324,23 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: %NSC: type = class_type @NSC [template] -// CHECK:STDOUT: %.3: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+15, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = file.%NSC // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+24, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+14, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+22, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -369,26 +377,28 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template] // CHECK:STDOUT: %NSC: type = class_type @NSC [template] -// CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+15, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+24, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+14, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+22, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -431,7 +441,7 @@ private export C; // CHECK:STDOUT: %.loc6_21: init %C = converted %.loc6_20.1, %.loc6_20.4 [template = constants.%struct.1] // CHECK:STDOUT: assign file.%c.var, %.loc6_21 // CHECK:STDOUT: %.loc7_26.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc7_27.1: %.4 = struct_literal (%.loc7_26.1) +// CHECK:STDOUT: %.loc7_27.1: %.5 = struct_literal (%.loc7_26.1) // CHECK:STDOUT: %.loc7_27.2: ref %.1 = class_element_access file.%nsc.var, element0 // CHECK:STDOUT: %.loc7_26.2: init %.1 = tuple_init () to %.loc7_27.2 [template = constants.%tuple] // CHECK:STDOUT: %.loc7_27.3: init %.1 = converted %.loc7_26.1, %.loc7_26.2 [template = constants.%tuple] @@ -447,26 +457,28 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template] // CHECK:STDOUT: %NSC: type = class_type @NSC [template] -// CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+15, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export_export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+24, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+14, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+22, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export_export, inst+23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -510,7 +522,7 @@ private export C; // CHECK:STDOUT: %.loc4_21: init %C = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%struct.1] // CHECK:STDOUT: assign file.%c.var, %.loc4_21 // CHECK:STDOUT: %.loc5_26.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc5_27.1: %.4 = struct_literal (%.loc5_26.1) +// CHECK:STDOUT: %.loc5_27.1: %.5 = struct_literal (%.loc5_26.1) // CHECK:STDOUT: %.loc5_27.2: ref %.1 = class_element_access file.%nsc.var, element0 // CHECK:STDOUT: %.loc5_26.2: init %.1 = tuple_init () to %.loc5_27.2 [template = constants.%tuple] // CHECK:STDOUT: %.loc5_27.3: init %.1 = converted %.loc5_26.1, %.loc5_26.2 [template = constants.%tuple] @@ -526,26 +538,28 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template] // CHECK:STDOUT: %NSC: type = class_type @NSC [template] -// CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+15, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export_export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+24, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+14, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+22, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export_export, inst+23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -588,7 +602,7 @@ private export C; // CHECK:STDOUT: %.loc6_21: init %C = converted %.loc6_20.1, %.loc6_20.4 [template = constants.%struct.1] // CHECK:STDOUT: assign file.%c.var, %.loc6_21 // CHECK:STDOUT: %.loc7_26.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc7_27.1: %.4 = struct_literal (%.loc7_26.1) +// CHECK:STDOUT: %.loc7_27.1: %.5 = struct_literal (%.loc7_26.1) // CHECK:STDOUT: %.loc7_27.2: ref %.1 = class_element_access file.%nsc.var, element0 // CHECK:STDOUT: %.loc7_26.2: init %.1 = tuple_init () to %.loc7_27.2 [template = constants.%tuple] // CHECK:STDOUT: %.loc7_27.3: init %.1 = converted %.loc7_26.1, %.loc7_26.2 [template = constants.%tuple] @@ -602,11 +616,11 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+13, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -622,6 +636,7 @@ private export C; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Local: type = class_type @Local [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -632,6 +647,8 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Local { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Local // CHECK:STDOUT: } @@ -642,15 +659,16 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+13, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+14, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } @@ -675,26 +693,28 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template] // CHECK:STDOUT: %NSC: type = class_type @NSC [template] -// CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+13, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+14, loaded [template = constants.%NSC] // CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+17, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+15, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+19, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -737,7 +757,7 @@ private export C; // CHECK:STDOUT: %.loc7_21: init %C = converted %.loc7_20.1, %.loc7_20.4 [template = constants.%struct.1] // CHECK:STDOUT: assign file.%c.var, %.loc7_21 // CHECK:STDOUT: %.loc8_26.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc8_27.1: %.4 = struct_literal (%.loc8_26.1) +// CHECK:STDOUT: %.loc8_27.1: %.5 = struct_literal (%.loc8_26.1) // CHECK:STDOUT: %.loc8_27.2: ref %.1 = class_element_access file.%nsc.var, element0 // CHECK:STDOUT: %.loc8_26.2: init %.1 = tuple_init () to %.loc8_27.2 [template = constants.%tuple] // CHECK:STDOUT: %.loc8_27.3: init %.1 = converted %.loc8_26.1, %.loc8_26.2 [template = constants.%tuple] @@ -753,26 +773,28 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template] // CHECK:STDOUT: %NSC: type = class_type @NSC [template] -// CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+15, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+24, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+14, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+22, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+23, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -815,7 +837,7 @@ private export C; // CHECK:STDOUT: %.loc7_21: init %C = converted %.loc7_20.1, %.loc7_20.4 [template = constants.%struct.1] // CHECK:STDOUT: assign file.%c.var, %.loc7_21 // CHECK:STDOUT: %.loc8_26.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc8_27.1: %.4 = struct_literal (%.loc8_26.1) +// CHECK:STDOUT: %.loc8_27.1: %.5 = struct_literal (%.loc8_26.1) // CHECK:STDOUT: %.loc8_27.2: ref %.1 = class_element_access file.%nsc.var, element0 // CHECK:STDOUT: %.loc8_26.2: init %.1 = tuple_init () to %.loc8_27.2 [template = constants.%tuple] // CHECK:STDOUT: %.loc8_27.3: init %.1 = converted %.loc8_26.1, %.loc8_26.2 [template = constants.%tuple] @@ -845,15 +867,16 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+13, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+14, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } @@ -879,15 +902,16 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//repeat_export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//repeat_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//repeat_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//repeat_export, inst+15, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//repeat_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//repeat_export, inst+14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -926,15 +950,16 @@ private export C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+13, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+14, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index c69fa18e9c53e..2bf8e60d9c297 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -43,6 +43,7 @@ export C.n; // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %.3: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: %.4: type = struct_type {.n: %.1} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -56,6 +57,7 @@ export C.n; // CHECK:STDOUT: %.loc5_11.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc5_8: %.3 = field_decl n, element0 [template] +// CHECK:STDOUT: %.loc6: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -68,6 +70,7 @@ export C.n; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: %.2: type = struct_type {.n: %.1} [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index ea33319480ae4..b23a1c3a2b94f 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -177,6 +177,7 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C1: type = class_type @C1 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -187,6 +188,8 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C1 { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C1 // CHECK:STDOUT: } @@ -196,6 +199,7 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C2: type = class_type @C2 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -206,6 +210,8 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C2 { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C2 // CHECK:STDOUT: } @@ -215,6 +221,7 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -228,6 +235,8 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc5: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } @@ -237,6 +246,7 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %O1: type = class_type @O1 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -247,6 +257,8 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @O1 { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%O1 // CHECK:STDOUT: } @@ -256,6 +268,7 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %O2: type = class_type @O2 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -266,6 +279,8 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @O2 { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%O2 // CHECK:STDOUT: } @@ -275,6 +290,7 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %Other: type = class_type @Other [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -285,6 +301,8 @@ import Other library "o1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Other { +// CHECK:STDOUT: %.loc4: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Other // CHECK:STDOUT: } @@ -307,8 +325,9 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C1: type = class_type @C1 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct.1: %C1 = struct_value () [template] // CHECK:STDOUT: %C2: type = class_type @C2 [template] // CHECK:STDOUT: %struct.2: %C2 = struct_value () [template] @@ -379,8 +398,9 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C1: type = class_type @C1 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C1 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -437,8 +457,9 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -498,8 +519,9 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %O1: type = class_type @O1 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct.1: %O1 = struct_value () [template] // CHECK:STDOUT: %O2: type = class_type @O2 [template] // CHECK:STDOUT: %struct.2: %O2 = struct_value () [template] @@ -580,8 +602,9 @@ import Other library "o1"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %O1: type = class_type @O1 [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %O1 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index 4895970356732..a93664dc50fcc 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -278,6 +278,7 @@ var n: {} = i32; // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template] // CHECK:STDOUT: %.2: type = tuple_type () [template] // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.1 [template] // CHECK:STDOUT: %struct: %.1 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -299,6 +300,7 @@ var n: {} = i32; // CHECK:STDOUT: %.loc6_18.2: type = converted %.loc6_18.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %return.var: ref %.1 = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc7: = complete_type_witness %.1 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Core diff --git a/toolchain/check/testdata/pointer/arrow.carbon b/toolchain/check/testdata/pointer/arrow.carbon index dd8fe0b8978f2..8488404272e7f 100644 --- a/toolchain/check/testdata/pointer/arrow.carbon +++ b/toolchain/check/testdata/pointer/arrow.carbon @@ -33,9 +33,10 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: %.2: type = ptr_type %C [template] // CHECK:STDOUT: %.3: type = unbound_element_type %C, %.2 [template] // CHECK:STDOUT: %.4: type = struct_type {.field: %.2} [template] +// CHECK:STDOUT: %.5: = complete_type_witness %.4 [template] // CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template] // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] -// CHECK:STDOUT: %.5: type = ptr_type %.4 [template] +// CHECK:STDOUT: %.6: type = ptr_type %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -76,6 +77,7 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %.loc13_15: type = ptr_type %C [template = constants.%.2] // CHECK:STDOUT: %.loc13_12: %.3 = field_decl field, element0 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.4 [template = constants.%.5] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C 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 3ef08d9b61e4e..fba773c885bc1 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -45,11 +45,12 @@ fn G() -> C { // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %.4: type = unbound_element_type %C, i32 [template] // CHECK:STDOUT: %.5: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.6: = complete_type_witness %.5 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.6: type = ptr_type %.5 [template] -// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] -// CHECK:STDOUT: %struct: %C = struct_value (%.3, %.7) [template] +// CHECK:STDOUT: %.7: type = ptr_type %.5 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] +// CHECK:STDOUT: %struct: %C = struct_value (%.3, %.8) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -97,6 +98,7 @@ fn G() -> C { // CHECK:STDOUT: %.loc23_30.1: type = value_of_initializer %int.make_type_32.loc23_30 [template = i32] // CHECK:STDOUT: %.loc23_30.2: type = converted %int.make_type_32.loc23_30, %.loc23_30.1 [template = i32] // CHECK:STDOUT: %.loc23_28: %.4 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc23_35: = complete_type_witness %.5 [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -124,12 +126,12 @@ fn G() -> C { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %c: ref %C = bind_name c, %return // CHECK:STDOUT: %.loc25_29: i32 = int_literal 1 [template = constants.%.3] -// CHECK:STDOUT: %.loc25_37: i32 = int_literal 2 [template = constants.%.7] +// CHECK:STDOUT: %.loc25_37: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: %.loc25_38.1: %.5 = struct_literal (%.loc25_29, %.loc25_37) // CHECK:STDOUT: %.loc25_38.2: ref i32 = class_element_access %return, element0 // CHECK:STDOUT: %.loc25_38.3: init i32 = initialize_from %.loc25_29 to %.loc25_38.2 [template = constants.%.3] // CHECK:STDOUT: %.loc25_38.4: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc25_38.5: init i32 = initialize_from %.loc25_37 to %.loc25_38.4 [template = constants.%.7] +// CHECK:STDOUT: %.loc25_38.5: init i32 = initialize_from %.loc25_37 to %.loc25_38.4 [template = constants.%.8] // CHECK:STDOUT: %.loc25_38.6: init %C = class_init (%.loc25_38.3, %.loc25_38.5), %return [template = constants.%struct] // CHECK:STDOUT: %.loc25_39: init %C = converted %.loc25_38.1, %.loc25_38.6 [template = constants.%struct] // CHECK:STDOUT: assign %return, %.loc25_39 diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 1752f369c1bcc..04d7b5e0e4b31 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -32,15 +32,16 @@ fn G() -> i32 { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: %.2: type = unbound_element_type %C, i32 [template] // CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %.4: = complete_type_witness %.3 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.4: type = ptr_type %.3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] -// CHECK:STDOUT: %struct: %C = struct_value (%.5, %.6) [template] +// CHECK:STDOUT: %.5: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.7: i32 = int_literal 2 [template] +// CHECK:STDOUT: %struct: %C = struct_value (%.6, %.7) [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.7: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.8: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -88,6 +89,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32.loc13, %.loc13_10.1 [template = i32] // CHECK:STDOUT: %.loc13_8: %.2 = field_decl b, element1 [template] +// CHECK:STDOUT: %.loc14: = complete_type_witness %.3 [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C @@ -101,13 +103,13 @@ fn G() -> i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %result: ref %C = bind_name result, %return -// CHECK:STDOUT: %.loc17_34: i32 = int_literal 1 [template = constants.%.5] -// CHECK:STDOUT: %.loc17_42: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_34: i32 = int_literal 1 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_42: i32 = int_literal 2 [template = constants.%.7] // CHECK:STDOUT: %.loc17_43.1: %.3 = struct_literal (%.loc17_34, %.loc17_42) // CHECK:STDOUT: %.loc17_43.2: ref i32 = class_element_access %return, element0 -// CHECK:STDOUT: %.loc17_43.3: init i32 = initialize_from %.loc17_34 to %.loc17_43.2 [template = constants.%.5] +// CHECK:STDOUT: %.loc17_43.3: init i32 = initialize_from %.loc17_34 to %.loc17_43.2 [template = constants.%.6] // CHECK:STDOUT: %.loc17_43.4: ref i32 = class_element_access %return, element1 -// CHECK:STDOUT: %.loc17_43.5: init i32 = initialize_from %.loc17_42 to %.loc17_43.4 [template = constants.%.6] +// CHECK:STDOUT: %.loc17_43.5: init i32 = initialize_from %.loc17_42 to %.loc17_43.4 [template = constants.%.7] // CHECK:STDOUT: %.loc17_43.6: init %C = class_init (%.loc17_43.3, %.loc17_43.5), %return [template = constants.%struct] // CHECK:STDOUT: %.loc17_44: init %C = converted %.loc17_43.1, %.loc17_43.6 [template = constants.%struct] // CHECK:STDOUT: assign %return, %.loc17_44 @@ -121,7 +123,7 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc22_24.2: type = converted %int.make_type_32, %.loc22_24.1 [template = i32] // CHECK:STDOUT: %result.var: ref i32 = var result // CHECK:STDOUT: %result: ref i32 = bind_name result, %result.var -// CHECK:STDOUT: %.loc22_30: i32 = int_literal 0 [template = constants.%.7] +// CHECK:STDOUT: %.loc22_30: i32 = int_literal 0 [template = constants.%.8] // CHECK:STDOUT: assign %result.var, %.loc22_30 // CHECK:STDOUT: %.loc22_16: i32 = bind_value %result // CHECK:STDOUT: return %.loc22_16 diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index d9ae6585e4a0e..0c25f8869457e 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -78,10 +78,11 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] // CHECK:STDOUT: %.12: type = struct_type {} [template] -// CHECK:STDOUT: %.13: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.14: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.15: type = ptr_type %.11 [template] -// CHECK:STDOUT: %struct.4: %.11 = struct_value (%.13, %.14) [template] +// CHECK:STDOUT: %.13: = complete_type_witness %.12 [template] +// CHECK:STDOUT: %.14: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.15: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.16: type = ptr_type %.11 [template] +// CHECK:STDOUT: %struct.4: %.11 = struct_value (%.14, %.15) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct.4) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] @@ -145,8 +146,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %C.ref: %C.type = name_ref C, %C.decl [template = constants.%C.1] -// CHECK:STDOUT: %.loc9_19: i32 = int_literal 1 [template = constants.%.13] -// CHECK:STDOUT: %.loc9_27: i32 = int_literal 2 [template = constants.%.14] +// CHECK:STDOUT: %.loc9_19: i32 = int_literal 1 [template = constants.%.14] +// CHECK:STDOUT: %.loc9_27: i32 = int_literal 2 [template = constants.%.15] // CHECK:STDOUT: %.loc9_28: %.11 = struct_literal (%.loc9_19, %.loc9_27) // CHECK:STDOUT: %struct: %.11 = struct_value (%.loc9_19, %.loc9_27) [template = constants.%struct.4] // CHECK:STDOUT: %.loc9_12: %.11 = converted %.loc9_28, %struct [template = constants.%struct.4] @@ -161,6 +162,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc8: = complete_type_witness %.12 [template = constants.%.13] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 // CHECK:STDOUT: } @@ -225,15 +228,16 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %.10: type = struct_type {} [template] -// CHECK:STDOUT: %.11: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %S: %.11 = bind_symbolic_name S 0 [symbolic] +// CHECK:STDOUT: %.11: = complete_type_witness %.10 [template] +// CHECK:STDOUT: %.12: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %S: %.12 = bind_symbolic_name S 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] -// CHECK:STDOUT: %.12: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.13: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.14: type = ptr_type %.11 [template] -// CHECK:STDOUT: %struct: %.11 = struct_value (%.12, %.13) [template] +// CHECK:STDOUT: %.13: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.14: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.15: type = ptr_type %.12 [template] +// CHECK:STDOUT: %struct: %.12 = struct_value (%.13, %.14) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct) [template] -// CHECK:STDOUT: %.15: type = ptr_type %.10 [template] +// CHECK:STDOUT: %.16: type = ptr_type %.10 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -242,7 +246,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.1: ref %.2 = import_ref Implicit//default, inst+17, loaded // CHECK:STDOUT: %import_ref.2: ref %.6 = import_ref Implicit//default, inst+57, loaded // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+99, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+120, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -294,18 +298,18 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %b.var: ref %.6 = var b // CHECK:STDOUT: %b: ref %.6 = bind_name b, %b.var // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc6_16: i32 = int_literal 1 [template = constants.%.12] -// CHECK:STDOUT: %.loc6_24: i32 = int_literal 2 [template = constants.%.13] -// CHECK:STDOUT: %.loc6_25: %.11 = struct_literal (%.loc6_16, %.loc6_24) -// CHECK:STDOUT: %struct: %.11 = struct_value (%.loc6_16, %.loc6_24) [template = constants.%struct] -// CHECK:STDOUT: %.loc6_9: %.11 = converted %.loc6_25, %struct [template = constants.%struct] +// CHECK:STDOUT: %.loc6_16: i32 = int_literal 1 [template = constants.%.13] +// CHECK:STDOUT: %.loc6_24: i32 = int_literal 2 [template = constants.%.14] +// CHECK:STDOUT: %.loc6_25: %.12 = struct_literal (%.loc6_16, %.loc6_24) +// CHECK:STDOUT: %struct: %.12 = struct_value (%.loc6_16, %.loc6_24) [template = constants.%struct] +// CHECK:STDOUT: %.loc6_9: %.12 = converted %.loc6_25, %struct [template = constants.%struct] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct) [template = constants.%C.3] // CHECK:STDOUT: %c.var: ref %C.3 = var c // CHECK:STDOUT: %c: ref %C.3 = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %.11) { -// CHECK:STDOUT: %S: %.11 = bind_symbolic_name S 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: generic class @C(constants.%S: %.12) { +// CHECK:STDOUT: %S: %.12 = bind_symbolic_name S 0 [symbolic = %S (constants.%S)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -374,25 +378,26 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %S: %.3 = bind_symbolic_name S 0 [symbolic] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %S: %.4 = bind_symbolic_name S 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.6: type = struct_type {.c: i32, .d: i32} [template] -// CHECK:STDOUT: %.7: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.7: type = struct_type {.c: i32, .d: i32} [template] +// CHECK:STDOUT: %.8: type = ptr_type %.4 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %struct: %.3 = struct_value (%.4, %.5) [template] +// CHECK:STDOUT: %struct: %.4 = struct_value (%.5, %.6) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct) [template] -// CHECK:STDOUT: %.8: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.9: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+99, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+120, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -419,15 +424,15 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc13_28: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc13_29: %.6 = struct_literal (%.loc13_20, %.loc13_28) +// CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc13_28: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc13_29: %.7 = struct_literal (%.loc13_20, %.loc13_28) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %.3) { -// CHECK:STDOUT: %S: %.3 = bind_symbolic_name S 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: generic class @C(constants.%S: %.4) { +// CHECK:STDOUT: %S: %.4 = bind_symbolic_name S 0 [symbolic = %S (constants.%S)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -465,44 +470,45 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %S: %.3 = bind_symbolic_name S 0 [symbolic] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = struct_type {.a: i32, .b: i32} [template] +// CHECK:STDOUT: %S: %.4 = bind_symbolic_name S 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%S) [symbolic] -// CHECK:STDOUT: %.4: i32 = int_literal 3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 4 [template] -// CHECK:STDOUT: %.6: type = ptr_type %.3 [template] -// CHECK:STDOUT: %struct.1: %.3 = struct_value (%.4, %.5) [template] +// CHECK:STDOUT: %.5: i32 = int_literal 3 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 4 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.4 [template] +// CHECK:STDOUT: %struct.1: %.4 = struct_value (%.5, %.6) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%struct.1) [template] -// CHECK:STDOUT: %.7: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.9: i32 = int_literal 1 [template] -// CHECK:STDOUT: %struct.2: %.3 = struct_value (%.9, %.8) [template] +// CHECK:STDOUT: %.9: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.10: i32 = int_literal 1 [template] +// CHECK:STDOUT: %struct.2: %.4 = struct_value (%.10, %.9) [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%struct.2) [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.10: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.10) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.10 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.11: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.11) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.11 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.10 [symbolic] -// CHECK:STDOUT: %.13: type = interface_type @ImplicitAs, @ImplicitAs(%C.3) [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [symbolic] +// CHECK:STDOUT: %.14: type = interface_type @ImplicitAs, @ImplicitAs(%C.3) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%C.3) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.14: type = assoc_entity_type %.13, %Convert.type.2 [template] -// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.10 [template] -// CHECK:STDOUT: %.16: %.11 = assoc_entity element0, imports.%import_ref.11 [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %.14, %Convert.type.2 [template] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.17: %.12 = assoc_entity element0, imports.%import_ref.11 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+99, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+120, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude @@ -517,7 +523,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+103, unloaded // CHECK:STDOUT: %import_ref.6: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.2 (%.11) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.16)] +// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -536,11 +542,11 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc9_20: i32 = int_literal 3 [template = constants.%.4] -// CHECK:STDOUT: %.loc9_28: i32 = int_literal 4 [template = constants.%.5] -// CHECK:STDOUT: %.loc9_29: %.3 = struct_literal (%.loc9_20, %.loc9_28) -// CHECK:STDOUT: %struct: %.3 = struct_value (%.loc9_20, %.loc9_28) [template = constants.%struct.1] -// CHECK:STDOUT: %.loc9_13: %.3 = converted %.loc9_29, %struct [template = constants.%struct.1] +// CHECK:STDOUT: %.loc9_20: i32 = int_literal 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc9_28: i32 = int_literal 4 [template = constants.%.6] +// CHECK:STDOUT: %.loc9_29: %.4 = struct_literal (%.loc9_20, %.loc9_28) +// CHECK:STDOUT: %struct: %.4 = struct_value (%.loc9_20, %.loc9_28) [template = constants.%struct.1] +// CHECK:STDOUT: %.loc9_13: %.4 = converted %.loc9_29, %struct [template = constants.%struct.1] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct.1) [template = constants.%C.3] // CHECK:STDOUT: %c_bad.var: ref %C.3 = var c_bad // CHECK:STDOUT: %c_bad: ref %C.3 = bind_name c_bad, %c_bad.var @@ -550,12 +556,12 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.10)] -// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %Self: %.11 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.10), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.11)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.11) = assoc_entity element0, imports.%import_ref.10 [symbolic = %.3 (constants.%.12)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.11), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.12) = assoc_entity element0, imports.%import_ref.10 [symbolic = %.3 (constants.%.13)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -565,8 +571,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%S: %.3) { -// CHECK:STDOUT: %S: %.3 = bind_symbolic_name S 0 [symbolic = %S (constants.%S)] +// CHECK:STDOUT: generic class @C(constants.%S: %.4) { +// CHECK:STDOUT: %S: %.4 = bind_symbolic_name S 0 [symbolic = %S (constants.%S)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -578,10 +584,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.4; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.10)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.11)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.10)] -// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %Self: %.11 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -591,9 +597,9 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc9_35.1: ref %C.4 = temporary_storage // CHECK:STDOUT: %F.call: init %C.4 = call %F.ref() to %.loc9_35.1 -// CHECK:STDOUT: %.loc9_37.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C.3) [template = constants.%.13] -// CHECK:STDOUT: %.loc9_37.2: %.14 = specific_constant imports.%import_ref.8, @ImplicitAs(constants.%C.3) [template = constants.%.15] -// CHECK:STDOUT: %Convert.ref: %.14 = name_ref Convert, %.loc9_37.2 [template = constants.%.15] +// CHECK:STDOUT: %.loc9_37.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C.3) [template = constants.%.14] +// CHECK:STDOUT: %.loc9_37.2: %.15 = specific_constant imports.%import_ref.8, @ImplicitAs(constants.%C.3) [template = constants.%.16] +// CHECK:STDOUT: %Convert.ref: %.15 = name_ref Convert, %.loc9_37.2 [template = constants.%.16] // CHECK:STDOUT: %.loc9_35.2: ref %C.4 = temporary %.loc9_35.1, %F.call // CHECK:STDOUT: %.loc9_37.3: %C.3 = converted %F.call, [template = ] // CHECK:STDOUT: assign file.%c_bad.var, @@ -630,7 +636,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -638,11 +644,11 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Dest => constants.%C.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %.1 => constants.%.14 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.14 -// CHECK:STDOUT: %.3 => constants.%.15 +// CHECK:STDOUT: %.2 => constants.%.15 +// CHECK:STDOUT: %.3 => constants.%.16 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 575e799dd6dd6..07dc6e6c7d274 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -86,6 +86,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] // CHECK:STDOUT: %.18: type = struct_type {} [template] +// CHECK:STDOUT: %.19: = complete_type_witness %.18 [template] // CHECK:STDOUT: %tuple.5: %.9 = tuple_value (%.15, %.16) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple.5) [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] @@ -175,6 +176,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: !definition: // CHECK:STDOUT: // CHECK:STDOUT: class { +// CHECK:STDOUT: %.loc7: = complete_type_witness %.18 [template = constants.%.19] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C.2 // CHECK:STDOUT: } @@ -250,13 +253,14 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %.14: type = struct_type {} [template] +// CHECK:STDOUT: %.15: = complete_type_witness %.14 [template] // CHECK:STDOUT: %X: %.8 = bind_symbolic_name X 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] -// CHECK:STDOUT: %.15: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.16: i32 = int_literal 2 [template] -// CHECK:STDOUT: %tuple: %.8 = tuple_value (%.15, %.16) [template] +// CHECK:STDOUT: %.16: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.17: i32 = int_literal 2 [template] +// CHECK:STDOUT: %tuple: %.8 = tuple_value (%.16, %.17) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple) [template] -// CHECK:STDOUT: %.17: type = ptr_type %.14 [template] +// CHECK:STDOUT: %.18: type = ptr_type %.14 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } @@ -265,7 +269,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.1: ref %.3 = import_ref Implicit//default, inst+17, loaded // CHECK:STDOUT: %import_ref.2: ref %.9 = import_ref Implicit//default, inst+57, loaded // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+103, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+119, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude @@ -325,8 +329,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %b.var: ref %.9 = var b // CHECK:STDOUT: %b: ref %.9 = bind_name b, %b.var // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc6_11: i32 = int_literal 1 [template = constants.%.15] -// CHECK:STDOUT: %.loc6_14: i32 = int_literal 2 [template = constants.%.16] +// CHECK:STDOUT: %.loc6_11: i32 = int_literal 1 [template = constants.%.16] +// CHECK:STDOUT: %.loc6_14: i32 = int_literal 2 [template = constants.%.17] // CHECK:STDOUT: %.loc6_15: %.8 = tuple_literal (%.loc6_11, %.loc6_14) // CHECK:STDOUT: %tuple: %.8 = tuple_value (%.loc6_11, %.loc6_14) [template = constants.%tuple] // CHECK:STDOUT: %.loc6_9: %.8 = converted %.loc6_15, %tuple [template = constants.%tuple] @@ -413,26 +417,27 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %X: %.3 = bind_symbolic_name X 0 [symbolic] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %X: %.4 = bind_symbolic_name X 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] -// CHECK:STDOUT: %.4: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.6: i32 = int_literal 3 [template] -// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template] -// CHECK:STDOUT: %.8: type = ptr_type %.3 [template] +// CHECK:STDOUT: %.5: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.7: i32 = int_literal 3 [template] +// CHECK:STDOUT: %.8: type = tuple_type (i32, i32, i32) [template] +// CHECK:STDOUT: %.9: type = ptr_type %.4 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.4, %.5) [template] +// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.5, %.6) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple) [template] -// CHECK:STDOUT: %.9: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.10: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+103, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+119, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators @@ -459,16 +464,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc14_15: i32 = int_literal 1 [template = constants.%.4] -// CHECK:STDOUT: %.loc14_18: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %.loc14_21: i32 = int_literal 3 [template = constants.%.6] -// CHECK:STDOUT: %.loc14_22: %.7 = tuple_literal (%.loc14_15, %.loc14_18, %.loc14_21) +// CHECK:STDOUT: %.loc14_15: i32 = int_literal 1 [template = constants.%.5] +// CHECK:STDOUT: %.loc14_18: i32 = int_literal 2 [template = constants.%.6] +// CHECK:STDOUT: %.loc14_21: i32 = int_literal 3 [template = constants.%.7] +// CHECK:STDOUT: %.loc14_22: %.8 = tuple_literal (%.loc14_15, %.loc14_18, %.loc14_21) // CHECK:STDOUT: %c_bad.var: ref = var c_bad // CHECK:STDOUT: %c_bad: ref = bind_name c_bad, %c_bad.var // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%X: %.3) { -// CHECK:STDOUT: %X: %.3 = bind_symbolic_name X 0 [symbolic = %X (constants.%X)] +// CHECK:STDOUT: generic class @C(constants.%X: %.4) { +// CHECK:STDOUT: %X: %.4 = bind_symbolic_name X 0 [symbolic = %X (constants.%X)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -506,44 +511,45 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = tuple_type (i32, i32) [template] -// CHECK:STDOUT: %X: %.3 = bind_symbolic_name X 0 [symbolic] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = tuple_type (i32, i32) [template] +// CHECK:STDOUT: %X: %.4 = bind_symbolic_name X 0 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic] -// CHECK:STDOUT: %.4: i32 = int_literal 3 [template] -// CHECK:STDOUT: %.5: i32 = int_literal 4 [template] -// CHECK:STDOUT: %.6: type = ptr_type %.3 [template] -// CHECK:STDOUT: %tuple.1: %.3 = tuple_value (%.4, %.5) [template] +// CHECK:STDOUT: %.5: i32 = int_literal 3 [template] +// CHECK:STDOUT: %.6: i32 = int_literal 4 [template] +// CHECK:STDOUT: %.7: type = ptr_type %.4 [template] +// CHECK:STDOUT: %tuple.1: %.4 = tuple_value (%.5, %.6) [template] // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple.1) [template] -// CHECK:STDOUT: %.7: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.8: type = ptr_type %.2 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.8: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.9: i32 = int_literal 1 [template] -// CHECK:STDOUT: %tuple.2: %.3 = tuple_value (%.9, %.8) [template] +// CHECK:STDOUT: %.9: i32 = int_literal 2 [template] +// CHECK:STDOUT: %.10: i32 = int_literal 1 [template] +// CHECK:STDOUT: %tuple.2: %.4 = tuple_value (%.10, %.9) [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%tuple.2) [template] // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template] // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template] // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic] -// CHECK:STDOUT: %.10: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] -// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.10) = bind_symbolic_name Self 1 [symbolic] -// CHECK:STDOUT: %Self.2: %.10 = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %.11: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] +// CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.11) = bind_symbolic_name Self 1 [symbolic] +// CHECK:STDOUT: %Self.2: %.11 = bind_symbolic_name Self 1 [symbolic] // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] -// CHECK:STDOUT: %.11: type = assoc_entity_type %.10, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.10 [symbolic] -// CHECK:STDOUT: %.13: type = interface_type @ImplicitAs, @ImplicitAs(%C.3) [template] +// CHECK:STDOUT: %.12: type = assoc_entity_type %.11, %Convert.type.1 [symbolic] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [symbolic] +// CHECK:STDOUT: %.14: type = interface_type @ImplicitAs, @ImplicitAs(%C.3) [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%C.3) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] -// CHECK:STDOUT: %.14: type = assoc_entity_type %.13, %Convert.type.2 [template] -// CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.10 [template] -// CHECK:STDOUT: %.16: %.11 = assoc_entity element0, imports.%import_ref.11 [symbolic] +// CHECK:STDOUT: %.15: type = assoc_entity_type %.14, %Convert.type.2 [template] +// CHECK:STDOUT: %.16: %.15 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.17: %.12 = assoc_entity element0, imports.%import_ref.11 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+103, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+119, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .ImplicitAs = %import_ref.6 // CHECK:STDOUT: import Core//prelude @@ -558,7 +564,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+107, unloaded // CHECK:STDOUT: %import_ref.6: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs] // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+42, unloaded -// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.2 (%.11) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.16)] +// CHECK:STDOUT: %import_ref.8: @ImplicitAs.%.2 (%.12) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.17)] // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/as, inst+52, unloaded // CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/as, inst+52, unloaded @@ -577,11 +583,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] -// CHECK:STDOUT: %.loc10_15: i32 = int_literal 3 [template = constants.%.4] -// CHECK:STDOUT: %.loc10_18: i32 = int_literal 4 [template = constants.%.5] -// CHECK:STDOUT: %.loc10_19: %.3 = tuple_literal (%.loc10_15, %.loc10_18) -// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.loc10_15, %.loc10_18) [template = constants.%tuple.1] -// CHECK:STDOUT: %.loc10_13: %.3 = converted %.loc10_19, %tuple [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc10_15: i32 = int_literal 3 [template = constants.%.5] +// CHECK:STDOUT: %.loc10_18: i32 = int_literal 4 [template = constants.%.6] +// CHECK:STDOUT: %.loc10_19: %.4 = tuple_literal (%.loc10_15, %.loc10_18) +// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc10_15, %.loc10_18) [template = constants.%tuple.1] +// CHECK:STDOUT: %.loc10_13: %.4 = converted %.loc10_19, %tuple [template = constants.%tuple.1] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.1) [template = constants.%C.3] // CHECK:STDOUT: %c_bad.var: ref %C.3 = var c_bad // CHECK:STDOUT: %c_bad: ref %C.3 = bind_name c_bad, %c_bad.var @@ -591,12 +597,12 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.10)] -// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %Self: %.11 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] -// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.10), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.11)] -// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.11) = assoc_entity element0, imports.%import_ref.10 [symbolic = %.3 (constants.%.12)] +// CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.11), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.12)] +// CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.12) = assoc_entity element0, imports.%import_ref.10 [symbolic = %.3 (constants.%.13)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: @@ -606,8 +612,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic class @C(constants.%X: %.3) { -// CHECK:STDOUT: %X: %.3 = bind_symbolic_name X 0 [symbolic = %X (constants.%X)] +// CHECK:STDOUT: generic class @C(constants.%X: %.4) { +// CHECK:STDOUT: %X: %.4 = bind_symbolic_name X 0 [symbolic = %X (constants.%X)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: @@ -619,10 +625,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.4; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.10)) { +// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.11)) { // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)] -// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.10)] -// CHECK:STDOUT: %Self: %.10 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] +// CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.11)] +// CHECK:STDOUT: %Self: %.11 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)] // CHECK:STDOUT: // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest); // CHECK:STDOUT: } @@ -632,9 +638,9 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc10_25.1: ref %C.4 = temporary_storage // CHECK:STDOUT: %F.call: init %C.4 = call %F.ref() to %.loc10_25.1 -// CHECK:STDOUT: %.loc10_27.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C.3) [template = constants.%.13] -// CHECK:STDOUT: %.loc10_27.2: %.14 = specific_constant imports.%import_ref.8, @ImplicitAs(constants.%C.3) [template = constants.%.15] -// CHECK:STDOUT: %Convert.ref: %.14 = name_ref Convert, %.loc10_27.2 [template = constants.%.15] +// CHECK:STDOUT: %.loc10_27.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C.3) [template = constants.%.14] +// CHECK:STDOUT: %.loc10_27.2: %.15 = specific_constant imports.%import_ref.8, @ImplicitAs(constants.%C.3) [template = constants.%.16] +// CHECK:STDOUT: %Convert.ref: %.15 = name_ref Convert, %.loc10_27.2 [template = constants.%.16] // CHECK:STDOUT: %.loc10_25.2: ref %C.4 = temporary %.loc10_25.1, %F.call // CHECK:STDOUT: %.loc10_27.3: %C.3 = converted %F.call, [template = ] // CHECK:STDOUT: assign file.%c_bad.var, @@ -671,7 +677,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) { // CHECK:STDOUT: %Dest => constants.%Dest -// CHECK:STDOUT: %.1 => constants.%.10 +// CHECK:STDOUT: %.1 => constants.%.11 // CHECK:STDOUT: %Self => constants.%Self.1 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -679,11 +685,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Dest => constants.%C.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %.1 => constants.%.13 +// CHECK:STDOUT: %.1 => constants.%.14 // CHECK:STDOUT: %Self => constants.%Self.2 // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2 // CHECK:STDOUT: %Convert => constants.%Convert.2 -// CHECK:STDOUT: %.2 => constants.%.14 -// CHECK:STDOUT: %.3 => constants.%.15 +// CHECK:STDOUT: %.2 => constants.%.15 +// CHECK:STDOUT: %.3 => constants.%.16 // 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 912777698f094..63cfa4b317470 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -32,12 +32,13 @@ fn F(x: X) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %X: type = class_type @X [template] // CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: = complete_type_witness %.1 [template] // CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %.3: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] -// CHECK:STDOUT: %.4: type = ptr_type String [template] -// CHECK:STDOUT: %.5: String = string_literal "hello" [template] +// CHECK:STDOUT: %.4: type = ptr_type %.1 [template] +// CHECK:STDOUT: %.5: type = ptr_type String [template] +// CHECK:STDOUT: %.6: String = string_literal "hello" [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -69,6 +70,8 @@ fn F(x: X) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { +// CHECK:STDOUT: %.loc12: = complete_type_witness %.1 [template = constants.%.2] +// CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%X // CHECK:STDOUT: } @@ -77,7 +80,7 @@ fn F(x: X) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.var: ref String = var s // CHECK:STDOUT: %s: ref String = bind_name s, %s.var -// CHECK:STDOUT: %.loc21: String = string_literal "hello" [template = constants.%.5] +// CHECK:STDOUT: %.loc21: String = string_literal "hello" [template = constants.%.6] // CHECK:STDOUT: assign %s.var, // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X] // CHECK:STDOUT: %y.var: ref %X = var y diff --git a/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon b/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon index e63f7939c33cc..74312758b836b 100644 --- a/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon +++ b/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon @@ -92,7 +92,8 @@ class D { // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.2: type = struct_type {} [template] -// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: %.3: = complete_type_witness %.2 [template] +// CHECK:STDOUT: %.4: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file {} @@ -102,6 +103,7 @@ class D { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C] // CHECK:STDOUT: %return.var: ref %C = var // CHECK:STDOUT: } +// CHECK:STDOUT: %.loc10: = complete_type_witness %.2 [template = constants.%.3] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C diff --git a/toolchain/lower/constant.cpp b/toolchain/lower/constant.cpp index 26238f2d7598e..d0caff176b792 100644 --- a/toolchain/lower/constant.cpp +++ b/toolchain/lower/constant.cpp @@ -11,6 +11,7 @@ #include "toolchain/lower/file_context.h" #include "toolchain/sem_ir/generic.h" #include "toolchain/sem_ir/inst.h" +#include "toolchain/sem_ir/typed_insts.h" namespace Carbon::Lower { @@ -174,6 +175,11 @@ static auto EmitAsConstant(ConstantContext& context, SemIR::BoundMethod inst) return context.GetConstant(inst.function_id); } +static auto EmitAsConstant(ConstantContext& context, + SemIR::CompleteTypeWitness inst) -> llvm::Constant* { + return context.GetUnusedConstant(inst.type_id); +} + static auto EmitAsConstant(ConstantContext& context, SemIR::FieldDecl inst) -> llvm::Constant* { return context.GetUnusedConstant(inst.type_id); diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index af728114c901a..3f4e0e7752895 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -434,8 +434,10 @@ static auto BuildTypeForInst(FileContext& /*context*/, InstT inst) static auto BuildTypeForInst(FileContext& context, SemIR::ClassType inst) -> llvm::Type* { - auto object_repr_id = - context.sem_ir().classes().Get(inst.class_id).object_repr_id; + auto object_repr_id = context.sem_ir() + .classes() + .Get(inst.class_id) + .GetObjectRepr(context.sem_ir(), inst.specific_id); return context.GetType(object_repr_id); } diff --git a/toolchain/lower/handle_aggregates.cpp b/toolchain/lower/handle_aggregates.cpp index 02116f2718918..3765849a4b52f 100644 --- a/toolchain/lower/handle_aggregates.cpp +++ b/toolchain/lower/handle_aggregates.cpp @@ -105,17 +105,18 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, SemIR::ClassElementAccess inst) -> void { // Find the class that we're performing access into. auto class_type_id = context.sem_ir().insts().Get(inst.base_id).type_id(); - auto class_id = - context.sem_ir().types().GetAs(class_type_id).class_id; - const auto& class_info = context.sem_ir().classes().Get(class_id); + auto class_type = + context.sem_ir().types().GetAs(class_type_id); + const auto& class_info = context.sem_ir().classes().Get(class_type.class_id); + SemIR::TypeId object_repr_id = + class_info.GetObjectRepr(context.sem_ir(), class_type.specific_id); // Translate the class field access into a struct access on the object // representation. context.SetLocal( - inst_id, - GetAggregateElement( - context, inst.base_id, inst.index, inst.type_id, - GetStructFieldName(context, class_info.object_repr_id, inst.index))); + inst_id, GetAggregateElement( + context, inst.base_id, inst.index, inst.type_id, + GetStructFieldName(context, object_repr_id, inst.index))); } static auto EmitAggregateInitializer(FunctionContext& context, diff --git a/toolchain/sem_ir/BUILD b/toolchain/sem_ir/BUILD index 5ea9dea9c3472..89a2227df1d0e 100644 --- a/toolchain/sem_ir/BUILD +++ b/toolchain/sem_ir/BUILD @@ -83,6 +83,7 @@ cc_library( name = "file", srcs = [ "builtin_function_kind.cpp", + "class.cpp", "constant.cpp", "file.cpp", "function.cpp", diff --git a/toolchain/sem_ir/class.cpp b/toolchain/sem_ir/class.cpp new file mode 100644 index 0000000000000..30400a705bf02 --- /dev/null +++ b/toolchain/sem_ir/class.cpp @@ -0,0 +1,28 @@ +// 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 "toolchain/sem_ir/class.h" + +#include "toolchain/sem_ir/file.h" +#include "toolchain/sem_ir/generic.h" +#include "toolchain/sem_ir/ids.h" + +namespace Carbon::SemIR { + +auto Class::GetObjectRepr(const File& file, SpecificId specific_id) const + -> TypeId { + if (!complete_type_witness_id.is_valid()) { + return TypeId::Invalid; + } + auto witness_id = + GetConstantValueInSpecific(file, specific_id, complete_type_witness_id); + if (witness_id == ConstantId::Error) { + return TypeId::Error; + } + return file.insts() + .GetAs(file.constant_values().GetInstId(witness_id)) + .object_repr_id; +} + +} // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/class.h b/toolchain/sem_ir/class.h index 2a00beaa1c402..121015a0eb11d 100644 --- a/toolchain/sem_ir/class.h +++ b/toolchain/sem_ir/class.h @@ -51,10 +51,11 @@ struct ClassFields { // The following members are set at the `}` of the class definition. - // The object representation type to use for this class. This is valid once - // the class is defined. For an adapter, this is the non-adapter type that - // this class directly or transitively adapts. - TypeId object_repr_id = TypeId::Invalid; + // A `CompleteTypeWitness` instruction witnessing that this class type is + // complete, and tracking its object representation. This is valid once the + // class is defined. For an adapter, the object representation is the + // non-adapter type that this class directly or transitively adapts. + InstId complete_type_witness_id = InstId::Invalid; }; // A class. See EntityWithParamsBase regarding the inheritance here. @@ -69,7 +70,13 @@ struct Class : public EntityWithParamsBase, // Determines whether this class has been fully defined. This is false until // we reach the `}` of the class definition. - auto is_defined() const -> bool { return object_repr_id.is_valid(); } + auto is_defined() const -> bool { + return complete_type_witness_id.is_valid(); + } + + // Gets the object representation for this class. Returns Invalid if the class + // is not yet defined. + auto GetObjectRepr(const File& file, SpecificId specific_id) const -> TypeId; }; } // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index 0c804a2b5548a..e9a0bcdb37196 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -434,6 +434,7 @@ static auto StringifyTypeExprImpl(const SemIR::File& outer_sem_ir, case ClassDecl::Kind: case ClassElementAccess::Kind: case ClassInit::Kind: + case CompleteTypeWitness::Kind: case Converted::Kind: case Deref::Kind: case FieldDecl::Kind: @@ -568,6 +569,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case BoundMethod::Kind: case ClassDecl::Kind: case ClassType::Kind: + case CompleteTypeWitness::Kind: case ConstType::Kind: case FacetTypeAccess::Kind: case FloatLiteral::Kind: diff --git a/toolchain/sem_ir/generic.cpp b/toolchain/sem_ir/generic.cpp index c86e8d8ef5c3e..b2d6c9290794c 100644 --- a/toolchain/sem_ir/generic.cpp +++ b/toolchain/sem_ir/generic.cpp @@ -66,19 +66,14 @@ auto GetConstantInSpecific(const File& sem_ir, SpecificId specific_id, } if (!specific_id.is_valid()) { - // TODO: We have a generic constant but no specific. Investigate whether we - // can CHECK-fail here. For now, produce the canonical value of the - // constant. + // We have a generic constant but no specific. We treat as a request for the + // canonical value of the constant. return sem_ir.constant_values().Get(symbolic.inst_id); } const auto& specific = sem_ir.specifics().Get(specific_id); - if (specific.generic_id != symbolic.generic_id) { - // TODO: Given an specific for the wrong generic. If the symbolic constant - // is from an enclosing generic, take the value from the corresponding - // specific. Otherwise, CHECK-fail. - return sem_ir.constant_values().Get(symbolic.inst_id); - } + CARBON_CHECK(specific.generic_id == symbolic.generic_id, + "Given a specific for the wrong generic"); auto value_block_id = specific.GetValueBlock(symbolic.index.region()); CARBON_CHECK( diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index 959da3d89a578..487b6eb033533 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -46,6 +46,7 @@ CARBON_SEM_IR_INST_KIND(ClassDecl) CARBON_SEM_IR_INST_KIND(ClassElementAccess) CARBON_SEM_IR_INST_KIND(ClassInit) CARBON_SEM_IR_INST_KIND(ClassType) +CARBON_SEM_IR_INST_KIND(CompleteTypeWitness) CARBON_SEM_IR_INST_KIND(ConstType) CARBON_SEM_IR_INST_KIND(Converted) CARBON_SEM_IR_INST_KIND(Deref) diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index d4c73ae62b110..99e30a7796bcc 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -448,6 +448,26 @@ struct ClassType { SpecificId specific_id; }; +// A witness that a type is complete. For now, this only tracks the object +// representation corresponding to the type, and this instruction is currently +// only created for class types, because all other types are their own object +// representation. +// +// TODO: Eventually this should be replaced by a witness for an interface that +// models type completeness, and should track other information such as the +// value representation. +struct CompleteTypeWitness { + static constexpr auto Kind = + InstKind::CompleteTypeWitness.Define( + {.ir_name = "complete_type_witness", + .is_type = InstIsType::Never, + .constant_kind = InstConstantKind::Always}); + // Always the builtin witness type. + TypeId type_id; + // The type that is used as the object representation of this type. + TypeId object_repr_id; +}; + // Indicates `const` on a type, such as `var x: const i32`. struct ConstType { static constexpr auto Kind = From f7304b21ac79274a30b998b487068fb8826cd13e Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 19 Sep 2024 13:35:50 -0700 Subject: [PATCH 3/8] Iterate on diagnostic structure (#4321) Part of this is also a plan to change "ERROR:" -> "error:" in diagnostics. I think I'm the odd one out on sentence casing. The rest is mostly trying to figure out advice that I think we can live with. Note I'm not immediately planning to rewrite all diagnostics (unless maybe there's a simple regex). I'm more trying to redirect style a little to where preferences lie, particularly for new diagnostics. --- toolchain/docs/diagnostics.md | 94 ++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/toolchain/docs/diagnostics.md b/toolchain/docs/diagnostics.md index 19fc5d9c8d05a..fef7428850dd6 100644 --- a/toolchain/docs/diagnostics.md +++ b/toolchain/docs/diagnostics.md @@ -158,53 +158,78 @@ different kinds of diagnostic. ## Diagnostic parameter types -Here are some types you might consider for the parameters to a diagnostic: - -- `llvm::StringLiteral`. Note that we don't use `llvm::StringRef` to avoid - lifetime issues. -- `std::string` -- Carbon types `T` that implement `llvm::format_provider` like: - - `Lex::TokenKind` - - `Lex::NumericLiteral::Radix` - - `Parse::RelativeLocation` -- integer types: `int`, `uint64_t`, `int64_t`, `size_t` -- `char` -- Other - [types supported by llvm::formatv](https://llvm.org/doxygen/FormatVariadic_8h_source.html) +Diagnostic parameters should have informative types. We rely on three different +methods for formatting arguments: + +- Builtin + [llvm::formatv](https://llvm.org/doxygen/FormatVariadic_8h_source.html) + support. + - This includes `char` and integer types (`int`, `int32_t`, and so on). + - String types can be added as needed, but stringifying values using the + methods noted below is preferred. + - Use `llvm::StringLiteral` where appropriate; use `std::string` when + allocations are required. + - `llvm::StringRef` is disallowed due to lifetime issues. +- `llvm::format_provider<...>` specializations. + - This can be used when formatting the parameter doesn't require + additional context. + - For example, `Lex::TokenKind` and `Parse::RelativeLoc` provide + diagnostic formatting this way. +- `DiagnosticConverter::ConvertArg` overrides. + - This can provide additional context to a formatter. + - For example, formatting `SemIR::NameId` accesses the IR's name list. ## Diagnostic message style guide -In order to provide a consistent experience, Carbon diagnostics should be -written in the following style: +We want Carbon's diagnostics to be helpful for developers when they run into an +error, and phrased consistently across diagnostics. In addition, Carbon +diagnostics may be mixed with Clang diagnostics when compiling interoperable +code, so we are borrowing some features of Clang's +[Diagnostic Wording](https://clang.llvm.org/docs/InternalsManual.html#diagnostic-wording). +Carbon's diagnostic style aims to balance these concerns. Our style is: -- Start diagnostics with a capital letter or quoted code, and end them with a - period. +- Start diagnostics with a lower case letter or quoted code, and omit trailing + periods. -- Quoted code should be enclosed in backticks, for example: - ``"`{0}` is bad."`` +- Quoted code should be enclosed in backticks, for example: ``"`{0}` is bad"`` - Phrase diagnostics as bullet points rather than full sentences. Leave out articles unless they're necessary for clarity. -- Diagnostics should describe the situation the toolchain observed and the - language rule that was violated, although either can be omitted if it's - clear from the other. For example: + - Semicolons can be used to separate sentence fragments. - - `"Redeclaration of X."` describes the situation and implies that +- Diagnostics should describe the situation the toolchain observed. The + language rule violated can be mentioned if it wouldn't otherwise be clear. + For example: + + - `"redeclaration of X"` describes the situation and implies that redeclarations are not permitted. - - ``"`self` can only be declared in an implicit parameter list."`` - describes the language rule and implies that you declared `self` - somewhere else. + - ``"`self` declared in invalid context; can only be declared in implicit parameter list"`` + describes the language rule. - It's OK for a diagnostic to guess at the developer's intent and provide a hint after explaining the situation and the rule, but not as a substitute for that. For example, - ``"Add an `as String` cast to format this integer as a string."`` is not - sufficient as an error message, but - ``"Cannot add i32 to String. Add an `as String` cast to format this integer as a string."`` + ``"add `as String` to convert `i32` to `String`"`` is not sufficient as + an error message, but + ``"cannot implicitly convert `i32` to `String`; add `as String` for explicit conversion"`` could be acceptable. +- Use "cannot" if needed, but try to use phrasing that doesn't require it. + Avoid "allowed", "legal", "permitted", "valid", and related wording. For + example: + + - ``"`export` in `impl` file"`` rather than + ``"`export` is only allowed in API files"``. + - ``"`extern library` specifies current library"`` rather than + `` "`extern library` cannot specify the current library"``. + +- Try to structure diagnostics such that inputs can be extracted without + string parsing; prefer [typed parameters](#diagnostic-parameter-types). We + would like to keep a path for diagnostics to be an API. There can be + exceptions where this is particularly difficult. + - TODO: Should diagnostics be atemporal and non-sequential ("multiple declarations of X", "additional declaration here"), present tense but sequential ("redeclaration of X", "previous declaration is here"), or @@ -212,17 +237,6 @@ written in the following style: try to sidestep difference between the latter two by avoiding verbs with tense ("previously declared here", "Y declared here", with no is/was). -- TODO: Word choices: - - - For disallowed constructs, do we say they're not permitted / not allowed - / not valid / not legal / illegal / ill-formed / disallowed? Do we say - "X cannot be Y" or "X may not be Y" or "X must not be Y" or "X shall not - be Y"? - -- TODO: Is structuring diagnostics such that inputs can be parsed without - string parsing important? that is, when is passing strings in as part of the - message templating okay? - - TODO: When do we put identifiers or expressions in diagnostics, versus requiring notes pointing at relevant code? Is it only avoided for values, or only allowed for types? From db78450c610f4a0dd3ba6b02538fb8e708a9c146 Mon Sep 17 00:00:00 2001 From: josh11b <15258583+josh11b@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:58:57 -0700 Subject: [PATCH 4/8] Fix singular/plural mismatch in design README (#4326) Co-authored-by: Josh L --- docs/design/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/design/README.md b/docs/design/README.md index 3ed08fb634b1a..88009d25b6292 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -550,8 +550,8 @@ represent that value. Floating-point types in Carbon have IEEE-754 semantics, use the round-to-nearest rounding mode, and do not set any floating-point exception state. They are named -with a _type literals_, consisting of `f` and the number of bits, which must be -a multiple of 8. These types will always be available: +using _type literals_, consisting of `f` and the number of bits, which must be a +multiple of 8. These types will always be available: [`f16`](https://en.wikipedia.org/wiki/Half-precision_floating-point_format), [`f32`](https://en.wikipedia.org/wiki/Single-precision_floating-point_format), and From 7f6d684b29e005809b1e068678790315260756c8 Mon Sep 17 00:00:00 2001 From: Geoff Romer Date: Thu, 19 Sep 2024 14:00:21 -0700 Subject: [PATCH 5/8] Add usage tips to NOAUTOUPDATE tests (#4324) These tips are especially valuable in these cases, because you can't use `autoupdate_testdata.py` to identify the output difference, so dumping the output is pretty much the only option. --- toolchain/check/testdata/basics/no_prelude/verbose.carbon | 4 ++++ toolchain/codegen/testdata/assembly/basic.carbon | 5 +++++ toolchain/codegen/testdata/fail_target_triple.carbon | 4 ++++ toolchain/driver/testdata/dump_mem_usage.carbon | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/toolchain/check/testdata/basics/no_prelude/verbose.carbon b/toolchain/check/testdata/basics/no_prelude/verbose.carbon index 9a101360cdc01..b2b9a43db8f9d 100644 --- a/toolchain/check/testdata/basics/no_prelude/verbose.carbon +++ b/toolchain/check/testdata/basics/no_prelude/verbose.carbon @@ -5,6 +5,10 @@ // ARGS: -v compile --no-prelude-import --phase=check %s // // Only checks a couple statements in order to minimize manual update churn. +// To test this file alone, run: +// bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/verbose.carbon +// To dump output, run: +// bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/verbose.carbon // NOAUTOUPDATE // SET-CHECK-SUBSET // CHECK:STDERR: Node Push 0: FunctionIntroducer -> diff --git a/toolchain/codegen/testdata/assembly/basic.carbon b/toolchain/codegen/testdata/assembly/basic.carbon index a0fc2061d5c25..7fdeee2802c50 100644 --- a/toolchain/codegen/testdata/assembly/basic.carbon +++ b/toolchain/codegen/testdata/assembly/basic.carbon @@ -3,6 +3,11 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // ARGS: compile --no-prelude-import --target=x86_64-unknown-linux-gnu --output=- %s +// +// To test this file alone, run: +// bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/codegen/testdata/assembly/basic.carbon +// To dump output, run: +// bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/codegen/testdata/assembly/basic.carbon // NOAUTOUPDATE // SET-CHECK-SUBSET // CHECK:STDOUT: _CMain.Main: diff --git a/toolchain/codegen/testdata/fail_target_triple.carbon b/toolchain/codegen/testdata/fail_target_triple.carbon index 2b5e2a0673713..3c9f35cc733ae 100644 --- a/toolchain/codegen/testdata/fail_target_triple.carbon +++ b/toolchain/codegen/testdata/fail_target_triple.carbon @@ -4,6 +4,10 @@ // // ARGS: compile --no-prelude-import --target=x86_687-unknown-linux-gnu --output=- %s // No autoupdate because the message comes from LLVM. +// To test this file alone, run: +// bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/codegen/testdata/fail_target_triple.carbon +// To dump output, run: +// bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/codegen/testdata/fail_target_triple.carbon // NOAUTOUPDATE // CHECK:STDERR: ERROR: Invalid target: {{.*}}x86_687{{.*}} diff --git a/toolchain/driver/testdata/dump_mem_usage.carbon b/toolchain/driver/testdata/dump_mem_usage.carbon index 17c595bbccbac..caf71a21d05cf 100644 --- a/toolchain/driver/testdata/dump_mem_usage.carbon +++ b/toolchain/driver/testdata/dump_mem_usage.carbon @@ -4,6 +4,10 @@ // // ARGS: compile --phase=check --dump-mem-usage %s // +// To test this file alone, run: +// bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/dump_mem_usage.carbon +// To dump output, run: +// bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/dump_mem_usage.carbon // NOAUTOUPDATE // // Avoid testing specific values: From e7aebbe581a4f4f8ecab50e3f3f5ec57c4fc2c86 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 19 Sep 2024 14:32:53 -0700 Subject: [PATCH 6/8] Update basic diagnostic capitalization/punctuation (#4328) This is a primarily automated change: - Search & replace for capitalization - `(CARBON_DIAGNOSTIC\((?:\n\s+)?\w+,(?:\n\s+)?\s\w+,(?:\n\s+)?\s")([A-Z])` - `$1\L$2` - Search & replace for period - `(CARBON_DIAGNOSTIC\((?:\n\s+)?\w+,(?:\n\s+)?\s\w+,(?:\n\s+)?\s"(?:[^)]|\n)+)\.("[,)])` - `$1$2` - Limited search & replace for `ERROR: ` -> `error: ` in streamed things - Leaving a TODO for command_line because there's more cleanup that can be done there - Modify diagnostic_consumer.cpp - ERROR -> error - WARNING -> warning --------- Co-authored-by: Richard Smith --- toolchain/check/call.cpp | 6 +- toolchain/check/check.cpp | 38 +++--- toolchain/check/context.cpp | 32 +++-- toolchain/check/convert.cpp | 44 +++---- toolchain/check/decl_name_stack.cpp | 18 +-- toolchain/check/deduce.cpp | 10 +- toolchain/check/eval.cpp | 27 +++-- toolchain/check/function.cpp | 10 +- toolchain/check/generic.cpp | 2 +- toolchain/check/handle_alias.cpp | 2 +- toolchain/check/handle_array.cpp | 3 +- toolchain/check/handle_binding_pattern.cpp | 10 +- toolchain/check/handle_export.cpp | 8 +- toolchain/check/handle_function.cpp | 12 +- toolchain/check/handle_impl.cpp | 21 ++-- toolchain/check/handle_index.cpp | 2 +- toolchain/check/handle_let_and_var.cpp | 6 +- toolchain/check/handle_literal.cpp | 10 +- toolchain/check/handle_loop_statement.cpp | 4 +- toolchain/check/handle_modifier.cpp | 8 +- toolchain/check/handle_name.cpp | 2 +- toolchain/check/handle_operator.cpp | 12 +- toolchain/check/handle_struct.cpp | 4 +- toolchain/check/impl.cpp | 8 +- toolchain/check/import.cpp | 2 +- toolchain/check/member_access.cpp | 33 +++--- toolchain/check/merge.cpp | 34 +++--- toolchain/check/modifiers.cpp | 13 +-- toolchain/check/name_component.cpp | 2 +- toolchain/check/return.cpp | 24 ++-- .../check/sem_ir_diagnostic_converter.cpp | 2 +- .../testdata/alias/fail_bool_value.carbon | 2 +- .../check/testdata/alias/fail_builtins.carbon | 4 +- .../testdata/alias/fail_control_flow.carbon | 6 +- .../alias/no_prelude/export_name.carbon | 2 +- .../fail_aliased_name_in_diag.carbon | 2 +- .../no_prelude/fail_local_in_namespace.carbon | 6 +- .../alias/no_prelude/fail_modifiers.carbon | 18 +-- .../no_prelude/fail_name_conflict.carbon | 8 +- .../alias/no_prelude/fail_not_constant.carbon | 2 +- .../alias/no_prelude/fail_params.carbon | 4 +- .../testdata/alias/no_prelude/import.carbon | 4 +- .../alias/no_prelude/import_access.carbon | 4 +- .../testdata/array/fail_bound_negative.carbon | 2 +- .../testdata/array/fail_bound_overflow.carbon | 8 +- .../array/fail_incomplete_element.carbon | 4 +- .../testdata/array/fail_invalid_type.carbon | 4 +- .../testdata/array/fail_out_of_bound.carbon | 2 +- .../fail_out_of_bound_non_literal.carbon | 2 +- .../testdata/array/fail_type_mismatch.carbon | 12 +- .../array/fail_undefined_bound.carbon | 2 +- .../testdata/as/adapter_conversion.carbon | 6 +- .../testdata/as/fail_no_conversion.carbon | 4 +- .../check/testdata/as/fail_not_type.carbon | 4 +- .../check/testdata/basics/fail_bad_run.carbon | 4 +- .../testdata/basics/fail_bad_run_2.carbon | 2 +- .../basics/fail_non_type_as_type.carbon | 4 +- .../fail_numeric_literal_overflow.carbon | 10 +- .../basics/fail_qualifier_unsupported.carbon | 2 +- .../basics/no_prelude/fail_name_lookup.carbon | 2 +- .../testdata/basics/type_literals.carbon | 26 ++--- .../check/testdata/builtins/float/add.carbon | 6 +- .../check/testdata/builtins/float/div.carbon | 6 +- .../check/testdata/builtins/float/eq.carbon | 2 +- .../testdata/builtins/float/make_type.carbon | 4 +- .../check/testdata/builtins/float/mul.carbon | 6 +- .../testdata/builtins/float/negate.carbon | 18 +-- .../check/testdata/builtins/float/neq.carbon | 2 +- .../check/testdata/builtins/float/sub.carbon | 6 +- .../check/testdata/builtins/int/eq.carbon | 2 +- .../testdata/builtins/int/left_shift.carbon | 10 +- .../builtins/int/make_type_signed.carbon | 6 +- .../builtins/int/make_type_unsigned.carbon | 6 +- .../testdata/builtins/int/right_shift.carbon | 6 +- .../check/testdata/builtins/int/sadd.carbon | 18 +-- .../check/testdata/builtins/int/sdiv.carbon | 6 +- .../check/testdata/builtins/int/smod.carbon | 6 +- .../check/testdata/builtins/int/smul.carbon | 2 +- .../testdata/builtins/int/snegate.carbon | 30 ++--- .../check/testdata/builtins/int/ssub.carbon | 2 +- .../check/testdata/builtins/int/uadd.carbon | 16 +-- .../check/testdata/builtins/int/udiv.carbon | 4 +- .../check/testdata/builtins/int/umod.carbon | 4 +- .../testdata/builtins/int/unegate.carbon | 28 ++--- .../testdata/class/access_modifers.carbon | 28 ++--- toolchain/check/testdata/class/adapt.carbon | 2 +- .../class/cross_package_import.carbon | 26 ++--- .../check/testdata/class/extend_adapt.carbon | 12 +- .../check/testdata/class/fail_abstract.carbon | 2 +- .../testdata/class/fail_adapt_bad_decl.carbon | 20 ++-- .../testdata/class/fail_adapt_bad_type.carbon | 4 +- .../class/fail_adapt_modifiers.carbon | 14 +-- .../class/fail_adapt_with_subobjects.carbon | 8 +- .../testdata/class/fail_addr_not_self.carbon | 4 +- .../testdata/class/fail_addr_self.carbon | 14 +-- .../class/fail_base_as_declared_name.carbon | 4 +- .../testdata/class/fail_base_bad_type.carbon | 36 +++--- .../class/fail_base_method_define.carbon | 4 +- .../testdata/class/fail_base_misplaced.carbon | 6 +- .../testdata/class/fail_base_modifiers.carbon | 14 +-- .../testdata/class/fail_base_no_extend.carbon | 2 +- .../testdata/class/fail_base_repeated.carbon | 4 +- .../testdata/class/fail_base_unbound.carbon | 2 +- .../class/fail_compound_type_mismatch.carbon | 4 +- .../class/fail_convert_to_invalid.carbon | 2 +- .../class/fail_derived_to_base.carbon | 8 +- .../testdata/class/fail_extend_cycle.carbon | 6 +- .../class/fail_field_modifiers.carbon | 8 +- .../testdata/class/fail_generic_method.carbon | 8 +- .../testdata/class/fail_import_misuses.carbon | 12 +- .../testdata/class/fail_incomplete.carbon | 50 ++++---- .../check/testdata/class/fail_init.carbon | 6 +- .../class/fail_init_as_inplace.carbon | 2 +- .../class/fail_memaccess_category.carbon | 8 +- .../testdata/class/fail_member_of_let.carbon | 4 +- .../check/testdata/class/fail_method.carbon | 12 +- .../class/fail_method_modifiers.carbon | 16 +-- .../class/fail_method_redefinition.carbon | 4 +- .../testdata/class/fail_modifiers.carbon | 28 ++--- .../class/fail_out_of_line_decl.carbon | 2 +- .../fail_redeclaration_introducer.carbon | 12 +- .../class/fail_redeclaration_scope.carbon | 2 +- .../testdata/class/fail_redefinition.carbon | 10 +- .../check/testdata/class/fail_scope.carbon | 2 +- .../check/testdata/class/fail_self.carbon | 14 +-- .../class/fail_self_type_member.carbon | 4 +- .../class/fail_todo_local_class.carbon | 4 +- .../testdata/class/fail_unbound_field.carbon | 4 +- .../testdata/class/fail_unknown_member.carbon | 2 +- .../check/testdata/class/generic/call.carbon | 14 +-- .../testdata/class/generic/import.carbon | 12 +- .../class/generic/member_access.carbon | 4 +- .../class/generic/member_inline.carbon | 2 +- .../class/generic/member_out_of_line.carbon | 16 +-- .../testdata/class/generic/redeclare.carbon | 20 ++-- .../testdata/class/inheritance_access.carbon | 24 ++-- .../check/testdata/class/init_adapt.carbon | 16 +-- .../testdata/class/no_prelude/extern.carbon | 94 +++++++-------- .../class/no_prelude/extern_library.carbon | 2 +- .../class/no_prelude/generic_vs_params.carbon | 4 +- .../class/no_prelude/implicit_import.carbon | 18 +-- .../class/no_prelude/import_access.carbon | 12 +- .../no_definition_in_impl_file.carbon | 4 +- .../class/no_prelude/syntactic_merge.carbon | 26 ++--- .../class/syntactic_merge_literal.carbon | 6 +- .../check/testdata/const/collapse.carbon | 2 +- .../check/testdata/const/fail_collapse.carbon | 6 +- .../check/testdata/eval/fail_aggregate.carbon | 2 +- .../check/testdata/eval/fail_symbolic.carbon | 2 +- .../function/builtin/fail_redefined.carbon | 12 +- .../function/builtin/fail_unknown.carbon | 2 +- .../function/call/fail_not_callable.carbon | 2 +- .../function/call/fail_param_count.carbon | 24 ++-- .../function/call/fail_param_type.carbon | 6 +- .../call/fail_return_type_mismatch.carbon | 4 +- .../declaration/fail_param_in_type.carbon | 2 +- .../declaration/fail_param_redecl.carbon | 4 +- .../function/declaration/import.carbon | 110 +++++++++--------- .../declaration/no_prelude/extern.carbon | 12 +- .../no_prelude/extern_library.carbon | 36 +++--- .../extern_library_for_default.carbon | 6 +- .../extern_library_from_default.carbon | 6 +- .../fail_import_incomplete_return.carbon | 32 ++--- .../no_prelude/fail_modifiers.carbon | 38 +++--- .../fail_pattern_in_signature.carbon | 4 +- .../declaration/no_prelude/fail_redecl.carbon | 20 ++-- .../no_prelude/fail_todo_no_params.carbon | 8 +- .../no_prelude/implicit_import.carbon | 14 +-- .../no_definition_in_impl_file.carbon | 4 +- .../function/definition/import.carbon | 30 ++--- .../function/definition/import_access.carbon | 12 +- .../definition/no_prelude/extern.carbon | 22 ++-- .../no_prelude/extern_library.carbon | 10 +- .../fail_decl_param_mismatch.carbon | 22 ++-- .../definition/no_prelude/fail_redef.carbon | 4 +- .../no_prelude/implicit_import.carbon | 30 ++--- .../no_prelude/syntactic_merge.carbon | 22 ++-- .../testdata/function/generic/deduce.carbon | 20 ++-- .../generic/fail_todo_param_in_type.carbon | 2 +- .../fail_type_param_mismatch.carbon | 2 +- .../function/generic/redeclare.carbon | 24 ++-- .../if/fail_reachable_fallthrough.carbon | 6 +- toolchain/check/testdata/if/fail_scope.carbon | 2 +- .../if_expr/fail_not_in_function.carbon | 12 +- .../if_expr/fail_partial_constant.carbon | 6 +- .../testdata/impl/fail_call_invalid.carbon | 2 +- .../impl/fail_extend_impl_forall.carbon | 2 +- .../impl/fail_extend_impl_scope.carbon | 2 +- .../impl/fail_extend_impl_type_as.carbon | 10 +- .../impl/fail_extend_non_interface.carbon | 2 +- ..._extend_partially_defined_interface.carbon | 4 +- .../fail_extend_undefined_interface.carbon | 4 +- .../testdata/impl/fail_impl_as_scope.carbon | 2 +- .../impl/fail_impl_bad_assoc_const.carbon | 2 +- .../impl/fail_impl_bad_assoc_fn.carbon | 60 +++++----- .../impl/fail_impl_bad_interface.carbon | 6 +- .../testdata/impl/fail_redefinition.carbon | 4 +- .../impl/fail_todo_impl_assoc_const.carbon | 2 +- .../lookup/fail_alias_impl_not_found.carbon | 4 +- .../lookup/fail_todo_undefined_impl.carbon | 2 +- .../impl/no_prelude/fail_impl_bad_type.carbon | 2 +- .../impl/no_prelude/interface_args.carbon | 4 +- .../no_definition_in_impl_file.carbon | 4 +- .../index/fail_array_large_index.carbon | 4 +- .../index/fail_array_non_int_indexing.carbon | 4 +- .../fail_array_out_of_bound_access.carbon | 2 +- .../testdata/index/fail_expr_category.carbon | 8 +- .../testdata/index/fail_invalid_base.carbon | 8 +- .../testdata/index/fail_name_not_found.carbon | 2 +- .../index/fail_negative_indexing.carbon | 2 +- .../index/fail_non_tuple_access.carbon | 2 +- .../fail_assoc_const_bad_default.carbon | 4 +- .../fail_todo_assoc_const_default.carbon | 4 +- .../fail_todo_define_default_fn_inline.carbon | 4 +- ..._todo_define_default_fn_out_of_line.carbon | 12 +- .../fail_add_member_outside_definition.carbon | 6 +- .../fail_assoc_const_not_binding.carbon | 2 +- .../fail_assoc_const_not_constant.carbon | 4 +- .../fail_assoc_const_template.carbon | 2 +- .../fail_definition_imported.carbon | 6 +- .../no_prelude/fail_duplicate.carbon | 16 +-- .../fail_generic_redeclaration.carbon | 12 +- .../no_prelude/fail_lookup_undefined.carbon | 16 +-- .../no_prelude/fail_member_lookup.carbon | 4 +- .../no_prelude/fail_modifiers.carbon | 8 +- .../no_prelude/fail_redeclare_member.carbon | 4 +- .../no_prelude/fail_todo_facet_lookup.carbon | 4 +- .../fail_todo_generic_default_fn.carbon | 4 +- .../no_prelude/fail_todo_modifiers.carbon | 4 +- .../interface/no_prelude/generic.carbon | 4 +- .../no_prelude/generic_vs_params.carbon | 4 +- .../interface/no_prelude/import_access.carbon | 14 +-- .../no_prelude/syntactic_merge.carbon | 40 +++---- .../testdata/let/fail_duplicate_decl.carbon | 4 +- .../check/testdata/let/fail_generic.carbon | 8 +- .../testdata/let/fail_generic_import.carbon | 4 +- .../testdata/let/fail_missing_value.carbon | 4 +- .../check/testdata/let/fail_modifiers.carbon | 32 ++--- .../testdata/let/fail_use_in_init.carbon | 2 +- .../let/no_prelude/import_access.carbon | 4 +- .../fail_conflict_after_merge.carbon | 12 +- ...l_conflict_imported_namespace_first.carbon | 6 +- ..._conflict_imported_namespace_nested.carbon | 10 +- ..._conflict_imported_namespace_second.carbon | 12 +- ...conflict_in_imports_namespace_first.carbon | 8 +- ...onflict_in_imports_namespace_second.carbon | 8 +- .../namespace/fail_decl_in_alias.carbon | 4 +- .../testdata/namespace/fail_duplicate.carbon | 4 +- .../testdata/namespace/fail_modifiers.carbon | 22 ++-- .../testdata/namespace/fail_params.carbon | 10 +- .../namespace/fail_unresolved_scope.carbon | 2 +- .../fail_and_or_not_in_function.carbon | 12 +- .../fail_and_or_partial_constant.carbon | 8 +- .../builtin/fail_assignment_to_error.carbon | 4 +- .../fail_assignment_to_non_assignable.carbon | 16 +-- .../fail_redundant_compound_access.carbon | 4 +- .../builtin/fail_type_mismatch.carbon | 4 +- .../fail_type_mismatch_assignment.carbon | 4 +- .../builtin/fail_type_mismatch_once.carbon | 4 +- .../builtin/fail_unimplemented_op.carbon | 2 +- .../testdata/operators/overloaded/eq.carbon | 12 +- .../overloaded/fail_assign_non_ref.carbon | 8 +- .../operators/overloaded/fail_no_impl.carbon | 8 +- .../overloaded/fail_no_impl_for_arg.carbon | 12 +- .../operators/overloaded/ordered.carbon | 8 +- .../package_expr/fail_not_found.carbon | 2 +- .../packages/fail_api_not_found.carbon | 6 +- .../fail_conflict_no_namespaces.carbon | 8 +- .../check/testdata/packages/fail_cycle.carbon | 10 +- .../packages/fail_duplicate_api.carbon | 8 +- .../testdata/packages/fail_extension.carbon | 26 ++--- .../packages/fail_import_default.carbon | 8 +- .../packages/fail_import_invalid.carbon | 18 +-- .../packages/fail_import_repeat.carbon | 16 +-- .../packages/fail_import_type_error.carbon | 8 +- .../fail_name_with_import_failure.carbon | 2 +- .../packages/fail_package_main.carbon | 8 +- .../no_prelude/cross_package_export.carbon | 22 ++-- .../no_prelude/cross_package_import.carbon | 46 ++++---- .../packages/no_prelude/export_import.carbon | 4 +- .../packages/no_prelude/export_mixed.carbon | 2 +- .../packages/no_prelude/export_name.carbon | 26 ++--- .../no_prelude/fail_export_name_member.carbon | 6 +- .../no_prelude/fail_export_name_params.carbon | 2 +- .../packages/no_prelude/fail_modifiers.carbon | 30 ++--- .../implicit_imports_entities.carbon | 16 +-- .../no_prelude/missing_prelude.carbon | 6 +- .../pointer/fail_address_of_error.carbon | 6 +- .../pointer/fail_address_of_value.carbon | 28 ++--- .../testdata/pointer/fail_deref_error.carbon | 4 +- .../pointer/fail_deref_function.carbon | 4 +- .../pointer/fail_deref_namespace.carbon | 4 +- .../pointer/fail_deref_not_pointer.carbon | 12 +- .../testdata/pointer/fail_deref_type.carbon | 6 +- .../pointer/fail_type_mismatch.carbon | 4 +- .../testdata/return/fail_call_in_type.carbon | 2 +- .../testdata/return/fail_error_in_type.carbon | 2 +- .../testdata/return/fail_let_in_type.carbon | 8 +- .../return/fail_missing_return.carbon | 2 +- .../fail_missing_return_empty_tuple.carbon | 2 +- .../fail_return_var_no_returned_var.carbon | 2 +- .../fail_return_with_returned_var.carbon | 8 +- .../fail_returned_var_no_return_type.carbon | 4 +- .../return/fail_returned_var_shadow.carbon | 8 +- .../return/fail_returned_var_type.carbon | 4 +- .../testdata/return/fail_type_mismatch.carbon | 4 +- .../return/fail_value_disallowed.carbon | 4 +- .../testdata/return/fail_value_missing.carbon | 4 +- .../testdata/return/fail_var_in_type.carbon | 2 +- .../struct/fail_access_into_invalid.carbon | 2 +- .../testdata/struct/fail_assign_empty.carbon | 2 +- .../struct/fail_assign_to_empty.carbon | 2 +- .../struct/fail_duplicate_name.carbon | 20 ++-- .../struct/fail_field_name_mismatch.carbon | 4 +- .../struct/fail_field_type_mismatch.carbon | 2 +- .../testdata/struct/fail_keyword_name.carbon | 6 +- .../struct/fail_member_access_type.carbon | 2 +- .../struct/fail_member_of_function.carbon | 2 +- .../struct/fail_non_member_access.carbon | 2 +- .../struct/fail_too_few_values.carbon | 2 +- .../testdata/struct/fail_type_assign.carbon | 4 +- .../testdata/struct/fail_value_as_type.carbon | 4 +- toolchain/check/testdata/struct/import.carbon | 10 +- .../no_prelude/fail_assign_nested.carbon | 2 +- .../no_prelude/fail_nested_incomplete.carbon | 4 +- .../tuple/access/fail_access_error.carbon | 2 +- .../tuple/access/fail_empty_access.carbon | 2 +- .../tuple/access/fail_large_index.carbon | 4 +- .../access/fail_negative_indexing.carbon | 2 +- .../access/fail_non_deterministic_type.carbon | 2 +- .../tuple/access/fail_non_int_indexing.carbon | 4 +- .../tuple/access/fail_non_tuple_access.carbon | 4 +- .../access/fail_out_of_bound_access.carbon | 2 +- .../fail_out_of_bound_not_literal.carbon | 2 +- .../testdata/tuple/fail_assign_nested.carbon | 2 +- .../tuple/fail_element_type_mismatch.carbon | 4 +- .../tuple/fail_nested_incomplete.carbon | 4 +- .../tuple/fail_too_few_element.carbon | 2 +- .../testdata/tuple/fail_type_assign.carbon | 4 +- .../testdata/tuple/fail_value_as_type.carbon | 4 +- toolchain/check/testdata/tuple/import.carbon | 10 +- .../tuple/no_prelude/fail_assign_empty.carbon | 2 +- .../no_prelude/fail_assign_to_empty.carbon | 2 +- .../testdata/var/fail_not_copyable.carbon | 4 +- .../var/fail_storage_is_literal.carbon | 4 +- .../var/fail_todo_control_flow_init.carbon | 20 ++-- .../var/no_prelude/export_name.carbon | 6 +- .../var/no_prelude/fail_duplicate_decl.carbon | 4 +- .../var/no_prelude/fail_generic.carbon | 2 +- .../no_prelude/fail_init_type_mismatch.carbon | 2 +- .../var/no_prelude/fail_init_with_self.carbon | 2 +- .../fail_lookup_outside_scope.carbon | 2 +- .../var/no_prelude/fail_modifiers.carbon | 14 +-- .../no_prelude/fail_namespace_conflict.carbon | 8 +- .../var/no_prelude/import_access.carbon | 4 +- .../no_prelude/fail_designator.carbon | 8 +- .../testdata/while/fail_bad_condition.carbon | 4 +- .../testdata/while/fail_break_continue.carbon | 8 +- toolchain/codegen/codegen.cpp | 4 +- .../testdata/fail_target_triple.carbon | 2 +- toolchain/diagnostics/diagnostic.h | 4 +- toolchain/diagnostics/diagnostic_consumer.cpp | 4 +- .../testdata/fail_multiline_token.carbon | 2 +- toolchain/docs/diagnostics.md | 8 +- toolchain/docs/parse.md | 2 +- toolchain/driver/compile_subcommand.cpp | 20 ++-- toolchain/driver/driver_fuzzer.cpp | 5 +- toolchain/driver/driver_test.cpp | 2 +- .../testdata/fail_errors_in_two_files.carbon | 4 +- .../driver/testdata/fail_errors_sorted.carbon | 4 +- .../testdata/fail_errors_streamed.carbon | 4 +- .../driver/testdata/fail_flush_errors.carbon | 6 +- .../testdata/fail_input_is_directory.carbon | 2 +- .../driver/testdata/fail_missing_file.carbon | 2 +- .../testdata/fail_missing_stdin_output.carbon | 2 +- toolchain/lex/helpers.cpp | 4 +- toolchain/lex/lex.cpp | 20 ++-- toolchain/lex/numeric_literal.cpp | 12 +- toolchain/lex/string_literal.cpp | 36 +++--- .../fail_bad_comment_introducers.carbon | 10 +- ...introducers_mid_block_indent_change.carbon | 6 +- .../testdata/fail_bad_raw_identifier.carbon | 16 +-- .../fail_block_string_second_line.carbon | 2 +- .../testdata/fail_mismatched_brackets.carbon | 6 +- .../fail_mismatched_brackets_2.carbon | 2 +- toolchain/lex/testdata/fail_multifile.carbon | 4 +- .../testdata/fail_trailing_comments.carbon | 6 +- .../basics/fail_before_lowering.carbon | 4 +- toolchain/parse/context.cpp | 20 ++-- toolchain/parse/handle_alias.cpp | 2 +- toolchain/parse/handle_array_expr.cpp | 2 +- toolchain/parse/handle_base.cpp | 2 +- toolchain/parse/handle_binding_pattern.cpp | 3 +- toolchain/parse/handle_brace_expr.cpp | 2 +- toolchain/parse/handle_choice.cpp | 4 +- toolchain/parse/handle_code_block.cpp | 2 +- .../parse/handle_decl_name_and_params.cpp | 6 +- toolchain/parse/handle_decl_scope_loop.cpp | 2 +- toolchain/parse/handle_expr.cpp | 12 +- toolchain/parse/handle_function.cpp | 2 +- toolchain/parse/handle_if_expr.cpp | 4 +- toolchain/parse/handle_impl.cpp | 4 +- toolchain/parse/handle_import_and_package.cpp | 18 +-- toolchain/parse/handle_match.cpp | 20 ++-- toolchain/parse/handle_paren_expr.cpp | 2 +- toolchain/parse/handle_period.cpp | 2 +- toolchain/parse/handle_requirement.cpp | 4 +- toolchain/parse/handle_statement.cpp | 4 +- toolchain/parse/handle_var.cpp | 6 +- .../parse/testdata/alias/fail_syntax.carbon | 22 ++-- .../array/fail_require_close_bracket.carbon | 4 +- .../testdata/array/fail_require_semi.carbon | 2 +- .../parse/testdata/array/fail_syntax.carbon | 26 ++--- .../basics/fail_bracket_recovery.carbon | 8 +- .../basics/fail_invalid_designators.carbon | 4 +- .../basics/fail_modifiers_before_semi.carbon | 2 +- .../basics/fail_no_intro_with_semi.carbon | 2 +- .../basics/fail_no_intro_without_semi.carbon | 2 +- .../basics/fail_paren_match_regression.carbon | 6 +- ...il_alternative_with_implicit_params.carbon | 2 +- ...fail_invalid_alternative_identifier.carbon | 4 +- .../choice/fail_invalid_braces.carbon | 4 +- .../choice/fail_missing_definition.carbon | 2 +- ...il_missing_definition_parameterized.carbon | 2 +- .../fail_qualified_alternative_name.carbon | 2 +- toolchain/parse/testdata/class/adapt.carbon | 10 +- .../parse/testdata/class/fail_base.carbon | 8 +- .../testdata/class/fail_base_misplaced.carbon | 2 +- .../testdata/class/fail_modifiers.carbon | 6 +- .../for/fail_colon_instead_of_in.carbon | 2 +- .../testdata/for/fail_missing_cond.carbon | 8 +- .../parse/testdata/for/fail_missing_in.carbon | 2 +- .../testdata/for/fail_missing_var.carbon | 2 +- .../testdata/for/fail_returned_var.carbon | 2 +- .../testdata/for/fail_square_brackets.carbon | 8 +- .../function/declaration/extern.carbon | 6 +- .../fail_identifier_instead_of_sig.carbon | 2 +- .../fail_missing_implicit_close.carbon | 4 +- .../declaration/fail_missing_name.carbon | 2 +- .../declaration/fail_no_sig_or_semi.carbon | 2 +- .../declaration/fail_only_fn_and_semi.carbon | 2 +- .../fail_repeated_fn_and_semi.carbon | 2 +- ...skip_indented_newline_until_outdent.carbon | 2 +- ...ail_skip_indented_newline_with_semi.carbon | 2 +- ..._skip_indented_newline_without_semi.carbon | 2 +- .../fail_skip_to_newline_without_semi.carbon | 2 +- .../fail_skip_without_semi_to_curly.carbon | 2 +- .../fail_with_identifier_as_param.carbon | 2 +- ...hout_name_and_many_tokens_in_params.carbon | 2 +- .../function/definition/fail_builtin.carbon | 6 +- .../fail_identifier_in_statements.carbon | 2 +- .../deduced_params/fail_no_parens.carbon | 8 +- .../testdata/generics/impl/fail_impl.carbon | 32 ++--- .../impl/fail_out_of_line_member.carbon | 4 +- .../interface/fail_missing_name.carbon | 2 +- .../interface/fail_missing_open_curly.carbon | 4 +- .../interface/fail_self_param_syntax.carbon | 4 +- .../named_constraint/fail_incomplete.carbon | 4 +- .../testdata/if/fail_else_unbraced.carbon | 8 +- .../parse/testdata/if/fail_errors.carbon | 10 +- .../testdata/if/fail_missing_cond.carbon | 2 +- .../testdata/if/fail_square_brackets.carbon | 6 +- .../parse/testdata/if/fail_unbraced.carbon | 6 +- .../if_expr/fail_condition_missing.carbon | 2 +- .../if_expr/fail_else_expr_missing.carbon | 2 +- .../testdata/if_expr/fail_else_missing.carbon | 2 +- .../if_expr/fail_then_expr_missing.carbon | 2 +- .../testdata/if_expr/fail_then_missing.carbon | 2 +- .../testdata/if_expr/fail_top_level_if.carbon | 6 +- .../testdata/index/fail_empty_expr.carbon | 2 +- .../testdata/index/fail_malformed_expr.carbon | 2 +- .../parse/testdata/let/fail_bad_name.carbon | 2 +- .../parse/testdata/let/fail_empty.carbon | 2 +- .../testdata/let/fail_missing_name.carbon | 4 +- .../testdata/let/fail_missing_type.carbon | 2 +- .../parse/testdata/let/fail_no_semi.carbon | 4 +- .../match/fail_cases_after_default.carbon | 6 +- .../match/fail_missing_case_arrow.carbon | 4 +- .../match/fail_missing_case_pattern.carbon | 2 +- .../fail_missing_case_statements_block.carbon | 2 +- .../testdata/match/fail_missing_cases.carbon | 2 +- .../match/fail_missing_cases_block.carbon | 2 +- .../match/fail_missing_default_arrow.carbon | 2 +- ...il_missing_default_statements_block.carbon | 2 +- .../fail_missing_guard_close_paren.carbon | 4 +- .../fail_missing_guard_open_paren.carbon | 4 +- .../match/fail_missing_matched_expr.carbon | 2 +- ...il_unexpected_tokens_in_cases_block.carbon | 12 +- .../member_access/fail_keyword.carbon | 12 +- .../testdata/namespace/fail_arrow.carbon | 2 +- .../testdata/namespace/fail_incomplete.carbon | 12 +- .../namespace/fail_incomplete_name.carbon | 2 +- .../testdata/namespace/fail_modifiers.carbon | 4 +- .../testdata/namespace/fail_no_name.carbon | 2 +- .../operators/fail_chained_assign.carbon | 2 +- .../fail_infix_uneven_space_after.carbon | 2 +- .../fail_infix_uneven_space_before.carbon | 2 +- .../operators/fail_invalid_infix.carbon | 8 +- .../operators/fail_postfix_space.carbon | 2 +- .../fail_postfix_space_before_comma.carbon | 2 +- .../fail_postfix_space_in_call.carbon | 2 +- .../fail_postfix_space_surrounding.carbon | 2 +- .../operators/fail_postincrement.carbon | 4 +- .../operators/fail_precedence_and_or.carbon | 2 +- .../operators/fail_precedence_as.carbon | 14 +-- .../operators/fail_precedence_assign.carbon | 10 +- .../operators/fail_precedence_or_and.carbon | 2 +- .../operators/fail_precedence_where.carbon | 18 +-- .../operators/fail_prefix_repeat.carbon | 2 +- .../operators/fail_prefix_space.carbon | 2 +- ...ail_prefix_uneven_space_with_assign.carbon | 2 +- .../testdata/operators/fail_star_minus.carbon | 2 +- .../testdata/operators/fail_star_star.carbon | 2 +- .../operators/fail_star_star_no_space.carbon | 2 +- .../testdata/operators/fail_variety.carbon | 10 +- .../testdata/package_expr/fail_in_name.carbon | 6 +- .../parse/testdata/packages/export.carbon | 22 ++-- .../testdata/packages/import/export.carbon | 10 +- .../packages/import/fail_after_decl.carbon | 4 +- .../import/fail_after_decl_repeated.carbon | 12 +- .../packages/import/fail_extra_string.carbon | 2 +- .../import/fail_library_is_identifier.carbon | 2 +- .../import/fail_name_is_keyword.carbon | 2 +- .../packages/import/fail_no_name.carbon | 2 +- .../packages/import/fail_no_semi.carbon | 2 +- .../import/fail_omit_library_keyword.carbon | 2 +- .../testdata/packages/import/fail_type.carbon | 2 +- .../packages/library/fail_invalid_name.carbon | 12 +- .../packages/library/fail_semi_before.carbon | 4 +- .../packages/library/fail_too_late.carbon | 4 +- .../packages/package/fail_after_decl.carbon | 4 +- .../packages/package/fail_after_import.carbon | 4 +- .../package/fail_after_package.carbon | 4 +- .../packages/package/fail_extra_string.carbon | 2 +- .../package/fail_library_is_identifier.carbon | 2 +- .../package/fail_library_skips_name.carbon | 2 +- .../package/fail_name_is_keyword.carbon | 2 +- .../packages/package/fail_no_name.carbon | 2 +- .../packages/package/fail_no_semi.carbon | 2 +- .../package/fail_omit_library_keyword.carbon | 2 +- .../packages/package/fail_semi_before.carbon | 4 +- .../package/fail_trailing_impl.carbon | 2 +- .../pointer/fail_pointer_type_in_expr.carbon | 2 +- ...e_instead_of_compound_member_access.carbon | 16 +-- .../testdata/return/fail_expr_no_semi.carbon | 2 +- .../parse/testdata/return/fail_no_semi.carbon | 4 +- .../return/fail_returned_no_var.carbon | 2 +- .../testdata/return/fail_var_no_semi.carbon | 2 +- .../testdata/struct/fail_comma_only.carbon | 2 +- .../struct/fail_comma_repeat_in_type.carbon | 2 +- .../struct/fail_comma_repeat_in_value.carbon | 2 +- .../struct/fail_extra_token_in_type.carbon | 2 +- .../struct/fail_extra_token_in_value.carbon | 2 +- .../struct/fail_identifier_colon.carbon | 2 +- .../struct/fail_identifier_equals.carbon | 2 +- .../struct/fail_identifier_only.carbon | 2 +- .../fail_invalid_struct_designator.carbon | 2 +- .../testdata/struct/fail_missing_type.carbon | 2 +- .../testdata/struct/fail_missing_value.carbon | 2 +- .../struct/fail_mix_type_and_value.carbon | 2 +- .../struct/fail_mix_value_and_type.carbon | 2 +- .../struct/fail_mix_with_unknown.carbon | 8 +- .../struct/fail_no_colon_or_equals.carbon | 2 +- .../testdata/struct/fail_period_only.carbon | 2 +- .../testdata/struct/fail_period_paren.carbon | 2 +- .../struct/fail_period_string_colon.carbon | 2 +- .../struct/fail_period_string_equals.carbon | 2 +- .../struct/fail_type_no_designator.carbon | 2 +- .../parse/testdata/var/fail_bad_name.carbon | 2 +- .../parse/testdata/var/fail_empty.carbon | 2 +- .../parse/testdata/var/fail_no_semi.carbon | 4 +- .../testdata/where_expr/designators.carbon | 12 +- .../testdata/where_expr/fail_rewrite.carbon | 14 +-- .../testdata/where_expr/where_and.carbon | 6 +- .../testdata/while/fail_missing_cond.carbon | 2 +- .../parse/testdata/while/fail_no_semi.carbon | 4 +- .../parse/testdata/while/fail_unbraced.carbon | 2 +- toolchain/source/source_buffer.cpp | 8 +- 578 files changed, 2166 insertions(+), 2173 deletions(-) diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index 016a8e815f4ac..3760ffcef7d9f 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -43,7 +43,7 @@ static auto ResolveCalleeInCall(Context& context, SemIR::LocId loc_id, "{0} argument(s) passed to {1} expecting " "{2} argument(s).", int, llvm::StringLiteral, int); - CARBON_DIAGNOSTIC(InCallToEntity, Note, "Calling {0} declared here.", + CARBON_DIAGNOSTIC(InCallToEntity, Note, "calling {0} declared here", llvm::StringLiteral); context.emitter() .Build(loc_id, CallArgCountMismatch, arg_ids.size(), @@ -128,7 +128,7 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id, default: { if (!callee_function.is_error) { CARBON_DIAGNOSTIC(CallToNonCallable, Error, - "Value of type `{0}` is not callable.", + "value of type `{0}` is not callable", SemIR::TypeId); context.emitter().Emit(loc_id, CallToNonCallable, context.insts().Get(callee_id).type_id()); @@ -154,7 +154,7 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id, DiagnosticAnnotationScope annotate_diagnostics( &context.emitter(), [&](auto& builder) { CARBON_DIAGNOSTIC(IncompleteReturnTypeHere, Note, - "Return type declared here."); + "return type declared here"); builder.Note(callable.return_storage_id, IncompleteReturnTypeHere); }); return CheckFunctionReturnType(context, callee_id, callable, diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index 2d25b0a263a35..7f26358445e5e 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -789,7 +789,7 @@ static auto DiagnoseMissingDefinitions(Context& context, Context::DiagnosticEmitter& emitter) -> void { CARBON_DIAGNOSTIC(MissingDefinitionInImpl, Error, - "No definition found for declaration in impl file"); + "no definition found for declaration in impl file"); for (SemIR::InstId decl_inst_id : context.definitions_required()) { SemIR::Inst decl_inst = context.insts().Get(decl_inst_id); CARBON_KIND_SWITCH(context.insts().Get(decl_inst_id)) { @@ -983,8 +983,8 @@ static auto TrackImport(Map& api_map, explicit_import_map->Insert(import_key, import.node_id); !insert_result.is_inserted()) { CARBON_DIAGNOSTIC(RepeatedImport, Error, - "Library imported more than once."); - CARBON_DIAGNOSTIC(FirstImported, Note, "First import here."); + "library imported more than once"); + CARBON_DIAGNOSTIC(FirstImported, Note, "first import here"); unit_info.emitter.Build(import.node_id, RepeatedImport) .Note(insert_result.value(), FirstImported) .Emit(); @@ -1014,9 +1014,9 @@ static auto TrackImport(Map& api_map, // `impl`. if (is_same_library) { CARBON_DIAGNOSTIC(ExplicitImportApi, Error, - "Explicit import of `api` from `impl` file is " - "redundant with implicit import."); - CARBON_DIAGNOSTIC(ImportSelf, Error, "File cannot import itself."); + "explicit import of `api` from `impl` file is " + "redundant with implicit import"); + CARBON_DIAGNOSTIC(ImportSelf, Error, "file cannot import itself"); bool is_impl = !packaging || packaging->is_impl; unit_info.emitter.Emit(import.node_id, is_impl ? ExplicitImportApi : ImportSelf); @@ -1028,7 +1028,7 @@ static auto TrackImport(Map& api_map, if (is_file_implicit_main && is_import_implicit_current_package && is_import_default_library) { CARBON_DIAGNOSTIC(ImportMainDefaultLibrary, Error, - "Cannot import `Main//default`."); + "cannot import `Main//default`"); unit_info.emitter.Emit(import.node_id, ImportMainDefaultLibrary); return; @@ -1040,7 +1040,7 @@ static auto TrackImport(Map& api_map, if (is_same_package || (is_file_implicit_main && is_explicit_main)) { CARBON_DIAGNOSTIC( ImportCurrentPackageByName, Error, - "Imports from the current package must omit the package name."); + "imports from the current package must omit the package name"); unit_info.emitter.Emit(import.node_id, ImportCurrentPackageByName); return; } @@ -1048,7 +1048,7 @@ static auto TrackImport(Map& api_map, // Diagnose explicit imports from `Main`. if (is_explicit_main) { CARBON_DIAGNOSTIC(ImportMainPackage, Error, - "Cannot import `Main` from other packages."); + "cannot import `Main` from other packages"); unit_info.emitter.Emit(import.node_id, ImportMainPackage); return; } @@ -1088,8 +1088,8 @@ static auto TrackImport(Map& api_map, // The imported api is missing. package_imports.has_load_error = true; CARBON_DIAGNOSTIC(LibraryApiNotFound, Error, - "Corresponding API for '{0}' not found.", std::string); - CARBON_DIAGNOSTIC(ImportNotFound, Error, "Imported API '{0}' not found.", + "corresponding API for '{0}' not found", std::string); + CARBON_DIAGNOSTIC(ImportNotFound, Error, "imported API '{0}' not found", std::string); unit_info.emitter.Emit( import.node_id, @@ -1117,10 +1117,10 @@ static auto BuildApiMapAndDiagnosePackaging( // APIs. if (import_key.first == ExplicitMainName) { CARBON_DIAGNOSTIC(ExplicitMainPackage, Error, - "`Main//default` must omit `package` declaration."); + "`Main//default` must omit `package` declaration"); CARBON_DIAGNOSTIC( ExplicitMainLibrary, Error, - "Use `library` declaration in `Main` package libraries."); + "use `library` declaration in `Main` package libraries"); unit_info.emitter.Emit(packaging->names.node_id, import_key.second.empty() ? ExplicitMainPackage : ExplicitMainLibrary); @@ -1140,13 +1140,13 @@ static auto BuildApiMapAndDiagnosePackaging( insert_result.value()->unit->tokens->source().filename(); if (packaging) { CARBON_DIAGNOSTIC(DuplicateLibraryApi, Error, - "Library's API previously provided by `{0}`.", + "library's API previously provided by `{0}`", std::string); unit_info.emitter.Emit(packaging->names.node_id, DuplicateLibraryApi, prev_filename.str()); } else { CARBON_DIAGNOSTIC(DuplicateMainApi, Error, - "Main//default previously provided by `{0}`.", + "`Main//default` previously provided by `{0}`", std::string); // Use the invalid node because there's no node to associate with. unit_info.emitter.Emit(Parse::NodeId::Invalid, DuplicateMainApi, @@ -1166,7 +1166,7 @@ static auto BuildApiMapAndDiagnosePackaging( auto want_ext = is_impl ? ImplExt : ApiExt; if (is_api_with_impl_ext || !filename.ends_with(want_ext)) { CARBON_DIAGNOSTIC(IncorrectExtension, Error, - "File extension of `{0}` required for `{1}`.", + "file extension of `{0}` required for `{1}`", llvm::StringLiteral, Lex::TokenKind); auto diag = unit_info.emitter.Build( packaging ? packaging->names.node_id : Parse::NodeId::Invalid, @@ -1174,7 +1174,7 @@ static auto BuildApiMapAndDiagnosePackaging( is_impl ? Lex::TokenKind::Impl : Lex::TokenKind::Api); if (is_api_with_impl_ext) { CARBON_DIAGNOSTIC(IncorrectExtensionImplNote, Note, - "File extension of `{0}` only allowed for `{1}`.", + "file extension of `{0}` only allowed for `{1}`", llvm::StringLiteral, Lex::TokenKind); diag.Note(Parse::NodeId::Invalid, IncorrectExtensionImplNote, ImplExt, Lex::TokenKind::Impl); @@ -1270,8 +1270,8 @@ auto CheckParseTrees( } else { // The import hasn't been checked, indicating a cycle. CARBON_DIAGNOSTIC(ImportCycleDetected, Error, - "Import cannot be used due to a cycle. Cycle " - "must be fixed to import."); + "import cannot be used due to a cycle; cycle " + "must be fixed to import"); unit_info.emitter.Emit(import_it->names.node_id, ImportCycleDetected); // Make this look the same as an import which wasn't found. diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index fc77e2c582cc0..3dd34a3e69124 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -70,8 +70,7 @@ Context::Context(const Lex::TokenizedBuffer& tokens, DiagnosticEmitter& emitter, } auto Context::TODO(SemIRLoc loc, std::string label) -> bool { - CARBON_DIAGNOSTIC(SemanticsTodo, Error, "Semantics TODO: `{0}`.", - std::string); + CARBON_DIAGNOSTIC(SemanticsTodo, Error, "semantics TODO: `{0}`", std::string); emitter_->Emit(loc, SemanticsTodo, std::move(label)); return false; } @@ -202,9 +201,8 @@ auto Context::ReplaceInstBeforeConstantUse(SemIR::InstId inst_id, auto Context::DiagnoseDuplicateName(SemIRLoc dup_def, SemIRLoc prev_def) -> void { CARBON_DIAGNOSTIC(NameDeclDuplicate, Error, - "Duplicate name being declared in the same scope."); - CARBON_DIAGNOSTIC(NameDeclPrevious, Note, - "Name is previously declared here."); + "duplicate name being declared in the same scope"); + CARBON_DIAGNOSTIC(NameDeclPrevious, Note, "name is previously declared here"); emitter_->Build(dup_def, NameDeclDuplicate) .Note(prev_def, NameDeclPrevious) .Emit(); @@ -212,8 +210,7 @@ auto Context::DiagnoseDuplicateName(SemIRLoc dup_def, SemIRLoc prev_def) auto Context::DiagnoseNameNotFound(SemIRLoc loc, SemIR::NameId name_id) -> void { - CARBON_DIAGNOSTIC(NameNotFound, Error, "Name `{0}` not found.", - SemIR::NameId); + CARBON_DIAGNOSTIC(NameNotFound, Error, "name `{0}` not found", SemIR::NameId); emitter_->Emit(loc, NameNotFound, name_id); } @@ -223,11 +220,11 @@ auto Context::NoteIncompleteClass(SemIR::ClassId class_id, CARBON_CHECK(!class_info.is_defined(), "Class is not incomplete"); if (class_info.definition_id.is_valid()) { CARBON_DIAGNOSTIC(ClassIncompleteWithinDefinition, Note, - "Class is incomplete within its definition."); + "class is incomplete within its definition"); builder.Note(class_info.definition_id, ClassIncompleteWithinDefinition); } else { CARBON_DIAGNOSTIC(ClassForwardDeclaredHere, Note, - "Class was forward declared here."); + "class was forward declared here"); builder.Note(class_info.latest_decl_id(), ClassForwardDeclaredHere); } } @@ -238,12 +235,12 @@ auto Context::NoteUndefinedInterface(SemIR::InterfaceId interface_id, CARBON_CHECK(!interface_info.is_defined(), "Interface is not incomplete"); if (interface_info.is_being_defined()) { CARBON_DIAGNOSTIC(InterfaceUndefinedWithinDefinition, Note, - "Interface is currently being defined."); + "interface is currently being defined"); builder.Note(interface_info.definition_id, InterfaceUndefinedWithinDefinition); } else { CARBON_DIAGNOSTIC(InterfaceForwardDeclaredHere, Note, - "Interface was forward declared here."); + "interface was forward declared here"); builder.Note(interface_info.latest_decl_id(), InterfaceForwardDeclaredHere); } } @@ -374,10 +371,10 @@ static auto DiagnoseInvalidQualifiedNameAccess(Context& context, SemIRLoc loc, auto class_info = context.classes().Get(class_type->class_id); CARBON_DIAGNOSTIC(ClassInvalidMemberAccess, Error, - "Cannot access {0} member `{1}` of type `{2}`.", + "cannot access {0} member `{1}` of type `{2}`", SemIR::AccessKind, SemIR::NameId, SemIR::TypeId); CARBON_DIAGNOSTIC(ClassMemberDefinition, Note, - "The {0} member `{1}` is defined here.", SemIR::AccessKind, + "the {0} member `{1}` is defined here", SemIR::AccessKind, SemIR::NameId); auto parent_type_id = class_info.self_type_id; @@ -491,7 +488,7 @@ auto Context::LookupQualifiedName(SemIRLoc loc, SemIR::NameId name_id, // Add test coverage once this is possible. CARBON_DIAGNOSTIC( NameAmbiguousDueToExtend, Error, - "Ambiguous use of name `{0}` found in multiple extended scopes.", + "ambiguous use of name `{0}` found in multiple extended scopes", SemIR::NameId); emitter_->Emit(loc, NameAmbiguousDueToExtend, name_id); // TODO: Add notes pointing to the scopes. @@ -554,9 +551,8 @@ static auto GetCorePackage(Context& context, SemIRLoc loc) } } - CARBON_DIAGNOSTIC( - CoreNotFound, Error, - "Package `Core` implicitly referenced here, but not found."); + CARBON_DIAGNOSTIC(CoreNotFound, Error, + "package `Core` implicitly referenced here, but not found"); context.emitter().Emit(loc, CoreNotFound); return SemIR::NameScopeId::Invalid; } @@ -574,7 +570,7 @@ auto Context::LookupNameInCore(SemIRLoc loc, llvm::StringRef name) if (!inst_id.is_valid()) { CARBON_DIAGNOSTIC( CoreNameNotFound, Error, - "Name `Core.{0}` implicitly referenced here, but not found.", + "name `Core.{0}` implicitly referenced here, but not found", SemIR::NameId); emitter_->Emit(loc, CoreNameNotFound, name_id); return SemIR::InstId::BuiltinError; diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 62da182ac013f..81ee19719a506 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -234,10 +234,10 @@ static auto ConvertTupleToArray(Context& context, SemIR::TupleType tuple_type, if (tuple_elem_types.size() != array_bound) { CARBON_DIAGNOSTIC( ArrayInitFromLiteralArgCountMismatch, Error, - "Cannot initialize array of {0} element(s) from {1} initializer(s).", + "cannot initialize array of {0} element(s) from {1} initializer(s)", uint64_t, size_t); CARBON_DIAGNOSTIC(ArrayInitFromExprArgCountMismatch, Error, - "Cannot initialize array of {0} element(s) from tuple " + "cannot initialize array of {0} element(s) from tuple " "with {1} element(s).", uint64_t, size_t); context.emitter().Emit(value_loc_id, @@ -318,7 +318,7 @@ static auto ConvertTupleToTuple(Context& context, SemIR::TupleType src_type, // Check that the tuples are the same size. if (src_elem_types.size() != dest_elem_types.size()) { CARBON_DIAGNOSTIC(TupleInitElementCountMismatch, Error, - "Cannot initialize tuple of {0} element(s) from tuple " + "cannot initialize tuple of {0} element(s) from tuple " "with {1} element(s).", size_t, size_t); context.emitter().Emit(value_loc_id, TupleInitElementCountMismatch, @@ -406,7 +406,7 @@ static auto ConvertStructToStructOrClass(Context& context, // exist in the destination or vice versa in the diagnostic. if (src_elem_fields.size() != dest_elem_fields.size()) { CARBON_DIAGNOSTIC(StructInitElementCountMismatch, Error, - "Cannot initialize {0} with {1} field(s) from struct " + "cannot initialize {0} with {1} field(s) from struct " "with {2} field(s).", llvm::StringLiteral, size_t, size_t); context.emitter().Emit( @@ -460,14 +460,14 @@ static auto ConvertStructToStructOrClass(Context& context, if (literal_elems_id.is_valid()) { CARBON_DIAGNOSTIC( StructInitMissingFieldInLiteral, Error, - "Missing value for field `{0}` in struct initialization.", + "missing value for field `{0}` in struct initialization", SemIR::NameId); context.emitter().Emit(value_loc_id, StructInitMissingFieldInLiteral, dest_field.name_id); } else { CARBON_DIAGNOSTIC(StructInitMissingFieldInConversion, Error, - "Cannot convert from struct type `{0}` to `{1}`: " - "missing field `{2}` in source type.", + "cannot convert from struct type `{0}` to `{1}`: " + "missing field `{2}` in source type", SemIR::TypeId, SemIR::TypeId, SemIR::NameId); context.emitter().Emit( value_loc_id, StructInitMissingFieldInConversion, value.type_id(), @@ -535,8 +535,8 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, auto& dest_class_info = context.classes().Get(dest_type.class_id); if (dest_class_info.inheritance_kind == SemIR::Class::Abstract) { CARBON_DIAGNOSTIC(ConstructionOfAbstractClass, Error, - "Cannot construct instance of abstract class. " - "Consider using `partial {0}` instead.", + "cannot construct instance of abstract class; " + "consider using `partial {0}` instead", SemIR::TypeId); context.emitter().Emit(value_id, ConstructionOfAbstractClass, target.type_id); @@ -909,7 +909,7 @@ static auto PerformCopy(Context& context, SemIR::InstId expr_id) // TODO: We don't yet have rules for whether and when a class type is // copyable, or how to perform the copy. CARBON_DIAGNOSTIC(CopyOfUncopyableType, Error, - "Cannot copy value of type `{0}`.", SemIR::TypeId); + "cannot copy value of type `{0}`", SemIR::TypeId); context.emitter().Emit(expr_id, CopyOfUncopyableType, type_id); return SemIR::InstId::BuiltinError; } @@ -931,7 +931,7 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, // We should provide a better diagnostic for inappropriate use of // namespace names, and allow use of functions as values. CARBON_DIAGNOSTIC(UseOfNonExprAsValue, Error, - "Expression cannot be used as a value."); + "expression cannot be used as a value"); context.emitter().Emit(expr_id, UseOfNonExprAsValue); return SemIR::InstId::BuiltinError; } @@ -939,13 +939,13 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, // We can only perform initialization for complete types. if (!context.TryToCompleteType(target.type_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInInit, Error, - "Initialization of incomplete type `{0}`.", + "initialization of incomplete type `{0}`", SemIR::TypeId); CARBON_DIAGNOSTIC(IncompleteTypeInValueConversion, Error, - "Forming value of incomplete type `{0}`.", + "forming value of incomplete type `{0}`", SemIR::TypeId); CARBON_DIAGNOSTIC(IncompleteTypeInConversion, Error, - "Invalid use of incomplete type `{0}`.", + "invalid use of incomplete type `{0}`", SemIR::TypeId); return context.emitter().Build(loc_id, target.is_initializer() @@ -978,10 +978,10 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, }; expr_id = BuildUnaryOperator(context, loc_id, op, expr_id, [&] { CARBON_DIAGNOSTIC(ImplicitAsConversionFailure, Error, - "Cannot implicitly convert from `{0}` to `{1}`.", + "cannot implicitly convert from `{0}` to `{1}`", SemIR::TypeId, SemIR::TypeId); CARBON_DIAGNOSTIC(ExplicitAsConversionFailure, Error, - "Cannot convert from `{0}` to `{1}` with `as`.", + "cannot convert from `{0}` to `{1}` with `as`", SemIR::TypeId, SemIR::TypeId); return context.emitter().Build(loc_id, target.kind == ConversionTarget::ExplicitAs @@ -1126,7 +1126,7 @@ auto ConvertForExplicitAs(Context& context, Parse::NodeId as_node, {.kind = ConversionTarget::ExplicitAs, .type_id = type_id}); } -CARBON_DIAGNOSTIC(InCallToFunction, Note, "Calling function declared here."); +CARBON_DIAGNOSTIC(InCallToFunction, Note, "calling function declared here"); // Convert the object argument in a method call to match the `self` parameter. static auto ConvertSelf(Context& context, SemIR::LocId call_loc_id, @@ -1137,7 +1137,7 @@ static auto ConvertSelf(Context& context, SemIR::LocId call_loc_id, SemIR::InstId self_id) -> SemIR::InstId { if (!self_id.is_valid()) { CARBON_DIAGNOSTIC(MissingObjectInMethodCall, Error, - "Missing object argument in method call."); + "missing object argument in method call"); context.emitter() .Build(call_loc_id, MissingObjectInMethodCall) .Note(callee_loc, InCallToFunction) @@ -1149,7 +1149,7 @@ static auto ConvertSelf(Context& context, SemIR::LocId call_loc_id, &context.emitter(), [&](auto& builder) { CARBON_DIAGNOSTIC( InCallToFunctionSelf, Note, - "Initializing `{0}` parameter of method declared here.", + "initializing `{0}` parameter of method declared here", llvm::StringLiteral); builder.Note(self_param_id, InCallToFunctionSelf, addr_pattern ? llvm::StringLiteral("addr self") @@ -1168,7 +1168,7 @@ static auto ConvertSelf(Context& context, SemIR::LocId call_loc_id, break; default: CARBON_DIAGNOSTIC(AddrSelfIsNonRef, Error, - "`addr self` method cannot be invoked on a value."); + "`addr self` method cannot be invoked on a value"); context.emitter().Emit(TokenOnly(call_loc_id), AddrSelfIsNonRef); return SemIR::InstId::BuiltinError; } @@ -1228,7 +1228,7 @@ auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id, &context.emitter(), [&](auto& builder) { CARBON_DIAGNOSTIC( InCallToFunctionParam, Note, - "Initializing parameter {0} of function declared here.", int); + "initializing parameter {0} of function declared here", int); builder.Note(callee.callee_loc, InCallToFunctionParam, diag_param_index + 1); }); @@ -1281,7 +1281,7 @@ auto ExprAsType(Context& context, SemIR::LocId loc_id, SemIR::InstId value_id) auto type_const_id = context.constant_values().Get(type_inst_id); if (!type_const_id.is_constant()) { CARBON_DIAGNOSTIC(TypeExprEvaluationFailure, Error, - "Cannot evaluate type expression."); + "cannot evaluate type expression"); context.emitter().Emit(loc_id, TypeExprEvaluationFailure); return SemIR::TypeId::Error; } diff --git a/toolchain/check/decl_name_stack.cpp b/toolchain/check/decl_name_stack.cpp index cb8eeeed51dd0..8e7704a6a565c 100644 --- a/toolchain/check/decl_name_stack.cpp +++ b/toolchain/check/decl_name_stack.cpp @@ -140,8 +140,8 @@ auto DeclNameStack::AddName(NameContext name_context, SemIR::InstId target_id, // TODO: Point at the declaration for the scoped entity. CARBON_DIAGNOSTIC( QualifiedDeclOutsideScopeEntity, Error, - "Out-of-line declaration requires a declaration in " - "scoped entity."); + "out-of-line declaration requires a declaration in " + "scoped entity"); context_->emitter().Emit(name_context.loc_id, QualifiedDeclOutsideScopeEntity); } @@ -312,7 +312,7 @@ static auto DiagnoseQualifiedDeclInIncompleteClassScope(Context& context, SemIR::ClassId class_id) -> void { CARBON_DIAGNOSTIC(QualifiedDeclInIncompleteClassScope, Error, - "Cannot declare a member of incomplete class `{0}`.", + "cannot declare a member of incomplete class `{0}`", SemIR::TypeId); auto builder = context.emitter().Build(loc, QualifiedDeclInIncompleteClassScope, @@ -327,7 +327,7 @@ static auto DiagnoseQualifiedDeclInUndefinedInterfaceScope( Context& context, SemIRLoc loc, SemIR::InterfaceId interface_id, SemIR::InstId interface_inst_id) -> void { CARBON_DIAGNOSTIC(QualifiedDeclInUndefinedInterfaceScope, Error, - "Cannot declare a member of undefined interface `{0}`.", + "cannot declare a member of undefined interface `{0}`", std::string); auto builder = context.emitter().Build( loc, QualifiedDeclInUndefinedInterfaceScope, @@ -345,9 +345,9 @@ static auto DiagnoseQualifiedDeclInImportedPackage(Context& context, SemIRLoc import_loc) -> void { CARBON_DIAGNOSTIC(QualifiedDeclOutsidePackage, Error, - "Imported packages cannot be used for declarations."); + "imported packages cannot be used for declarations"); CARBON_DIAGNOSTIC(QualifiedDeclOutsidePackageSource, Note, - "Package imported here."); + "package imported here"); context.emitter() .Build(use_loc, QualifiedDeclOutsidePackage) .Note(import_loc, QualifiedDeclOutsidePackageSource) @@ -360,10 +360,10 @@ static auto DiagnoseQualifiedDeclInNonScope(Context& context, SemIRLoc use_loc, SemIRLoc non_scope_entity_loc) -> void { CARBON_DIAGNOSTIC(QualifiedNameInNonScope, Error, - "Name qualifiers are only allowed for entities that " - "provide a scope."); + "name qualifiers are only allowed for entities that " + "provide a scope"); CARBON_DIAGNOSTIC(QualifiedNameNonScopeEntity, Note, - "Referenced non-scope entity declared here."); + "referenced non-scope entity declared here"); context.emitter() .Build(use_loc, QualifiedNameInNonScope) .Note(non_scope_entity_loc, QualifiedNameNonScopeEntity) diff --git a/toolchain/check/deduce.cpp b/toolchain/check/deduce.cpp index 34223629235cb..c2dc2172af8cc 100644 --- a/toolchain/check/deduce.cpp +++ b/toolchain/check/deduce.cpp @@ -79,7 +79,7 @@ class DeductionWorklist { static auto NoteGenericHere(Context& context, SemIR::GenericId generic_id, Context::DiagnosticBuilder& diag) -> void { CARBON_DIAGNOSTIC(DeductionGenericHere, Note, - "While deducing parameters of generic declared here."); + "while deducing parameters of generic declared here"); diag.Note(context.generics().Get(generic_id).decl_id, DeductionGenericHere); } @@ -141,7 +141,7 @@ auto DeduceGenericCallArguments( param_id)) { CARBON_DIAGNOSTIC( InitializingGenericParam, Note, - "Initializing generic parameter `{0}` declared here.", + "initializing generic parameter `{0}` declared here", SemIR::NameId); builder.Note( param_id, InitializingGenericParam, @@ -188,8 +188,8 @@ auto DeduceGenericCallArguments( result_arg_ids[index.index] != arg_const_inst_id) { // TODO: Include the two different deduced values. CARBON_DIAGNOSTIC(DeductionInconsistent, Error, - "Inconsistent deductions for value of generic " - "parameter `{0}`.", + "inconsistent deductions for value of generic " + "parameter `{0}`", SemIR::NameId); auto diag = context.emitter().Build(loc_id, DeductionInconsistent, entity_name.name_id); @@ -221,7 +221,7 @@ auto DeduceGenericCallArguments( auto entity_name_id = context.insts().GetAs(binding_id).entity_name_id; CARBON_DIAGNOSTIC(DeductionIncomplete, Error, - "Cannot deduce value for generic parameter `{0}`.", + "cannot deduce value for generic parameter `{0}`", SemIR::NameId); auto diag = context.emitter().Build( loc_id, DeductionIncomplete, diff --git a/toolchain/check/eval.cpp b/toolchain/check/eval.cpp index c53d4afc33e58..5f0faefe10216 100644 --- a/toolchain/check/eval.cpp +++ b/toolchain/check/eval.cpp @@ -512,7 +512,7 @@ static auto PerformArrayIndex(EvalContext& eval_context, SemIR::Inst inst) .Get(bound->int_id) .ule(index_val.getZExtValue())) { CARBON_DIAGNOSTIC(ArrayIndexOutOfBounds, Error, - "Array index `{0}` is past the end of type `{1}`.", + "array index `{0}` is past the end of type `{1}`", TypedInt, SemIR::TypeId); eval_context.emitter().Emit( index_inst.index_id, ArrayIndexOutOfBounds, @@ -553,7 +553,7 @@ static auto ValidateIntType(Context& context, SemIRLoc loc, (context.types().IsSignedInt(bit_width->type_id) && bit_width_val.isNegative())) { CARBON_DIAGNOSTIC(IntWidthNotPositive, Error, - "Integer type width of {0} is not positive.", TypedInt); + "integer type width of {0} is not positive", TypedInt); context.emitter().Emit( loc, IntWidthNotPositive, {.type = bit_width->type_id, .value = bit_width_val}); @@ -564,8 +564,8 @@ static auto ValidateIntType(Context& context, SemIRLoc loc, constexpr int MaxIntWidth = 1 << 23; if (bit_width_val.ugt(MaxIntWidth)) { CARBON_DIAGNOSTIC(IntWidthTooLarge, Error, - "Integer type width of {0} is greater than the " - "maximum supported width of {1}.", + "integer type width of {0} is greater than the " + "maximum supported width of {1}", TypedInt, int); context.emitter().Emit(loc, IntWidthTooLarge, {.type = bit_width->type_id, .value = bit_width_val}, @@ -598,7 +598,7 @@ static auto ValidateFloatBitWidth(Context& context, SemIRLoc loc, return true; } - CARBON_DIAGNOSTIC(CompileTimeFloatBitWidth, Error, "Bit width must be 64."); + CARBON_DIAGNOSTIC(CompileTimeFloatBitWidth, Error, "bit width must be 64"); context.emitter().Emit(loc, CompileTimeFloatBitWidth); return false; } @@ -617,7 +617,7 @@ static auto ValidateFloatType(Context& context, SemIRLoc loc, // Issues a diagnostic for a compile-time division by zero. static auto DiagnoseDivisionByZero(Context& context, SemIRLoc loc) -> void { - CARBON_DIAGNOSTIC(CompileTimeDivisionByZero, Error, "Division by zero."); + CARBON_DIAGNOSTIC(CompileTimeDivisionByZero, Error, "division by zero"); context.emitter().Emit(loc, CompileTimeDivisionByZero); } @@ -634,7 +634,7 @@ static auto PerformBuiltinUnaryIntOp(Context& context, SemIRLoc loc, if (context.types().IsSignedInt(op.type_id) && op_val.isMinSignedValue()) { CARBON_DIAGNOSTIC(CompileTimeIntegerNegateOverflow, Error, - "Integer overflow in negation of {0}.", TypedInt); + "integer overflow in negation of {0}", TypedInt); context.emitter().Emit(loc, CompileTimeIntegerNegateOverflow, {.type = op.type_id, .value = op_val}); } @@ -750,10 +750,9 @@ static auto PerformBuiltinBinaryIntOp(Context& context, SemIRLoc loc, : llvm::StringLiteral(">>"); if (rhs_val.uge(lhs_val.getBitWidth()) || (rhs_val.isNegative() && context.types().IsSignedInt(rhs.type_id))) { - CARBON_DIAGNOSTIC( - CompileTimeShiftOutOfRange, Error, - "Shift distance not in range [0, {0}) in {1} {2} {3}.", unsigned, - TypedInt, llvm::StringLiteral, TypedInt); + CARBON_DIAGNOSTIC(CompileTimeShiftOutOfRange, Error, + "shift distance not in range [0, {0}) in {1} {2} {3}", + unsigned, TypedInt, llvm::StringLiteral, TypedInt); context.emitter().Emit(loc, CompileTimeShiftOutOfRange, lhs_val.getBitWidth(), {.type = lhs.type_id, .value = lhs_val}, op_str, @@ -777,7 +776,7 @@ static auto PerformBuiltinBinaryIntOp(Context& context, SemIRLoc loc, if (overflow) { CARBON_DIAGNOSTIC(CompileTimeIntegerOverflow, Error, - "Integer overflow in calculation {0} {1} {2}.", TypedInt, + "integer overflow in calculation {0} {1} {2}", TypedInt, llvm::StringLiteral, TypedInt); context.emitter().Emit(loc, CompileTimeIntegerOverflow, {.type = lhs.type_id, .value = lhs_val}, op_str, @@ -1134,7 +1133,7 @@ auto TryEvalInstInContext(EvalContext& eval_context, SemIR::InstId inst_id, if (eval_context.types().IsSignedInt(int_bound->type_id) && bound_val.isNegative()) { CARBON_DIAGNOSTIC(ArrayBoundNegative, Error, - "Array bound of {0} is negative.", TypedInt); + "array bound of {0} is negative", TypedInt); eval_context.emitter().Emit( bound_id, ArrayBoundNegative, {.type = int_bound->type_id, .value = bound_val}); @@ -1142,7 +1141,7 @@ auto TryEvalInstInContext(EvalContext& eval_context, SemIR::InstId inst_id, } if (bound_val.getActiveBits() > 64) { CARBON_DIAGNOSTIC(ArrayBoundTooLarge, Error, - "Array bound of {0} is too large.", TypedInt); + "array bound of {0} is too large", TypedInt); eval_context.emitter().Emit( bound_id, ArrayBoundTooLarge, {.type = int_bound->type_id, .value = bound_val}); diff --git a/toolchain/check/function.cpp b/toolchain/check/function.cpp index 2e09ed2c10b93..0656aa5925faa 100644 --- a/toolchain/check/function.cpp +++ b/toolchain/check/function.cpp @@ -34,11 +34,11 @@ auto CheckFunctionTypeMatches(Context& context, prev_return_type_id)) { CARBON_DIAGNOSTIC( FunctionRedeclReturnTypeDiffers, Error, - "Function redeclaration differs because return type is `{0}`.", + "function redeclaration differs because return type is `{0}`", SemIR::TypeId); CARBON_DIAGNOSTIC( FunctionRedeclReturnTypeDiffersNoReturn, Error, - "Function redeclaration differs because no return type is provided."); + "function redeclaration differs because no return type is provided"); auto diag = new_return_type_id.is_valid() ? context.emitter().Build(new_function.latest_decl_id(), @@ -48,13 +48,13 @@ auto CheckFunctionTypeMatches(Context& context, FunctionRedeclReturnTypeDiffersNoReturn); if (prev_return_type_id.is_valid()) { CARBON_DIAGNOSTIC(FunctionRedeclReturnTypePrevious, Note, - "Previously declared with return type `{0}`.", + "previously declared with return type `{0}`", SemIR::TypeId); diag.Note(prev_function.latest_decl_id(), FunctionRedeclReturnTypePrevious, prev_return_type_id); } else { CARBON_DIAGNOSTIC(FunctionRedeclReturnTypePreviousNoReturn, Note, - "Previously declared with no return type."); + "previously declared with no return type"); diag.Note(prev_function.latest_decl_id(), FunctionRedeclReturnTypePreviousNoReturn); } @@ -77,7 +77,7 @@ auto CheckFunctionReturnType(Context& context, SemIRLoc loc, if (return_info.init_repr.kind == SemIR::InitRepr::Incomplete) { auto diagnose_incomplete_return_type = [&] { CARBON_DIAGNOSTIC(IncompleteTypeInFunctionReturnType, Error, - "Function returns incomplete type `{0}`.", + "function returns incomplete type `{0}`", SemIR::TypeId); return context.emitter().Build(loc, IncompleteTypeInFunctionReturnType, return_info.type_id); diff --git a/toolchain/check/generic.cpp b/toolchain/check/generic.cpp index b64b4234342d4..f502ee9bccf84 100644 --- a/toolchain/check/generic.cpp +++ b/toolchain/check/generic.cpp @@ -426,7 +426,7 @@ auto RequireGenericParams(Context& context, SemIR::InstBlockId block_id) for (auto& inst_id : context.inst_blocks().Get(block_id)) { if (!context.constant_values().Get(inst_id).is_constant()) { CARBON_DIAGNOSTIC(GenericParamMustBeConstant, Error, - "Parameters of generic types must be constant."); + "parameters of generic types must be constant"); context.emitter().Emit(inst_id, GenericParamMustBeConstant); // Replace the parameter with an invalid instruction so that we don't try diff --git a/toolchain/check/handle_alias.cpp b/toolchain/check/handle_alias.cpp index 3b6d88bf813fe..f3233c77299c2 100644 --- a/toolchain/check/handle_alias.cpp +++ b/toolchain/check/handle_alias.cpp @@ -54,7 +54,7 @@ auto HandleParseNode(Context& context, Parse::AliasId /*node_id*/) -> bool { alias_value_id = inst->value_id; } else { CARBON_DIAGNOSTIC(AliasRequiresNameRef, Error, - "Alias initializer must be a name reference."); + "alias initializer must be a name reference"); context.emitter().Emit(expr_node, AliasRequiresNameRef); alias_type_id = SemIR::TypeId::Error; alias_value_id = SemIR::InstId::BuiltinError; diff --git a/toolchain/check/handle_array.cpp b/toolchain/check/handle_array.cpp index fad50be42a20c..7794ab679e458 100644 --- a/toolchain/check/handle_array.cpp +++ b/toolchain/check/handle_array.cpp @@ -39,8 +39,7 @@ auto HandleParseNode(Context& context, Parse::ArrayExprId node_id) -> bool { // comptime fn F(n: i32) -> type { return [i32; n]; } auto bound_inst = context.constant_values().Get(bound_inst_id); if (!bound_inst.is_constant()) { - CARBON_DIAGNOSTIC(InvalidArrayExpr, Error, - "Array bound is not a constant."); + CARBON_DIAGNOSTIC(InvalidArrayExpr, Error, "array bound is not a constant"); context.emitter().Emit(bound_inst_id, InvalidArrayExpr); context.node_stack().Push(node_id, SemIR::InstId::BuiltinError); return true; diff --git a/toolchain/check/handle_binding_pattern.cpp b/toolchain/check/handle_binding_pattern.cpp index ea9cadc466130..1c7b39d22d94d 100644 --- a/toolchain/check/handle_binding_pattern.cpp +++ b/toolchain/check/handle_binding_pattern.cpp @@ -73,7 +73,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, !context.node_stack().PeekIs()) { CARBON_DIAGNOSTIC( SelfOutsideImplicitParamList, Error, - "`self` can only be declared in an implicit parameter list."); + "`self` can only be declared in an implicit parameter list"); context.emitter().Emit(node_id, SelfOutsideImplicitParamList); } @@ -87,7 +87,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, if (is_generic) { CARBON_DIAGNOSTIC( CompileTimeBindingInVarDecl, Error, - "`var` declaration cannot declare a compile-time binding."); + "`var` declaration cannot declare a compile-time binding"); context.emitter().Emit(type_node, CompileTimeBindingInVarDecl); } auto binding_id = @@ -99,7 +99,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, auto parent_class_decl = context.GetCurrentScopeAs(); cast_type_id = context.AsCompleteType(cast_type_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInVarDecl, Error, - "{0} has incomplete type `{1}`.", llvm::StringLiteral, + "{0} has incomplete type `{1}`", llvm::StringLiteral, SemIR::TypeId); return context.emitter().Build(type_node, IncompleteTypeInVarDecl, parent_class_decl @@ -171,7 +171,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id, case Parse::NodeKind::LetIntroducer: { cast_type_id = context.AsCompleteType(cast_type_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInLetDecl, Error, - "`let` binding has incomplete type `{0}`.", + "`let` binding has incomplete type `{0}`", SemIR::TypeId); return context.emitter().Build(type_node, IncompleteTypeInLetDecl, cast_type_id); @@ -216,7 +216,7 @@ auto HandleParseNode(Context& context, Parse::AddrId node_id) -> bool { node_id, {.type_id = self_param->type_id, .inner_id = self_param_id}); } else { CARBON_DIAGNOSTIC(AddrOnNonSelfParam, Error, - "`addr` can only be applied to a `self` parameter."); + "`addr` can only be applied to a `self` parameter"); context.emitter().Emit(TokenOnly(node_id), AddrOnNonSelfParam); context.node_stack().Push(node_id, self_param_id); } diff --git a/toolchain/check/handle_export.cpp b/toolchain/check/handle_export.cpp index 1389e10fb6b5f..32b939b354952 100644 --- a/toolchain/check/handle_export.cpp +++ b/toolchain/check/handle_export.cpp @@ -45,8 +45,8 @@ auto HandleParseNode(Context& context, Parse::ExportDeclId node_id) -> bool { if (inst.Is()) { CARBON_DIAGNOSTIC(ExportRedundant, Warning, - "`export` matches previous `export`."); - CARBON_DIAGNOSTIC(ExportPrevious, Note, "Previous `export` here."); + "`export` matches previous `export`"); + CARBON_DIAGNOSTIC(ExportPrevious, Note, "previous `export` here"); context.emitter() .Build(node_id, ExportRedundant) // Use the location of the export itself, not the exported instruction. @@ -58,9 +58,9 @@ auto HandleParseNode(Context& context, Parse::ExportDeclId node_id) -> bool { auto import_ref = context.insts().TryGetAs(inst_id); if (!import_ref) { CARBON_DIAGNOSTIC(ExportNotImportedEntity, Error, - "Only imported entities are valid for `export`."); + "only imported entities are valid for `export`"); CARBON_DIAGNOSTIC(ExportNotImportedEntitySource, Note, - "Name is declared here."); + "name is declared here"); context.emitter() .Build(node_id, ExportNotImportedEntity) .Note(inst_id, ExportNotImportedEntitySource) diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index d97871eaae877..c06bd8c174d80 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -325,8 +325,8 @@ static auto BuildFunctionDecl(Context& context, context.GetBuiltinType(SemIR::BuiltinInstKind::IntType) && return_type_id != context.GetTupleType({}))) { CARBON_DIAGNOSTIC(InvalidMainRunSignature, Error, - "Invalid signature for `Main.Run` function. Expected " - "`fn ()` or `fn () -> i32`."); + "invalid signature for `Main.Run` function; expected " + "`fn ()` or `fn () -> i32`"); context.emitter().Emit(node_id, InvalidMainRunSignature); } } @@ -374,7 +374,7 @@ static auto HandleFunctionDefinitionAfterSignature( context.TryToCompleteType(param.type_id, [&] { CARBON_DIAGNOSTIC( IncompleteTypeInFunctionParam, Error, - "Parameter has incomplete type `{0}` in function definition.", + "parameter has incomplete type `{0}` in function definition", SemIR::TypeId); return context.emitter().Build(param_id, IncompleteTypeInFunctionParam, param.type_id); @@ -424,7 +424,7 @@ auto HandleParseNode(Context& context, Parse::FunctionDefinitionId node_id) if (context.functions().Get(function_id).return_storage_id.is_valid()) { CARBON_DIAGNOSTIC( MissingReturnStatement, Error, - "Missing `return` at end of function with declared return type."); + "missing `return` at end of function with declared return type"); context.emitter().Emit(TokenOnly(node_id), MissingReturnStatement); } else { context.AddInst(node_id, {}); @@ -468,7 +468,7 @@ static auto LookupBuiltinFunctionKind(Context& context, auto kind = SemIR::BuiltinFunctionKind::ForBuiltinName(builtin_name); if (kind == SemIR::BuiltinFunctionKind::None) { CARBON_DIAGNOSTIC(UnknownBuiltinFunctionName, Error, - "Unknown builtin function name \"{0}\".", std::string); + "unknown builtin function name \"{0}\"", std::string); context.emitter().Emit(name_id, UnknownBuiltinFunctionName, builtin_name.str()); } @@ -519,7 +519,7 @@ auto HandleParseNode(Context& context, function.builtin_function_kind = builtin_kind; } else { CARBON_DIAGNOSTIC(InvalidBuiltinSignature, Error, - "Invalid signature for builtin function \"{0}\".", + "invalid signature for builtin function \"{0}\"", std::string); context.emitter().Emit(fn_node_id, InvalidBuiltinSignature, builtin_kind.name().str()); diff --git a/toolchain/check/handle_impl.cpp b/toolchain/check/handle_impl.cpp index 36a2596b65691..70f27ac0f9928 100644 --- a/toolchain/check/handle_impl.cpp +++ b/toolchain/check/handle_impl.cpp @@ -88,7 +88,7 @@ auto HandleParseNode(Context& context, Parse::DefaultSelfImplAsId node_id) auto self_type_id = GetDefaultSelfType(context); if (!self_type_id.is_valid()) { CARBON_DIAGNOSTIC(ImplAsOutsideClass, Error, - "`impl as` can only be used in a class."); + "`impl as` can only be used in a class"); context.emitter().Emit(node_id, ImplAsOutsideClass); self_type_id = SemIR::TypeId::Error; } @@ -112,14 +112,14 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, // TODO: This is also valid in a mixin. if (!TryAsClassScope(context, parent_scope_id)) { CARBON_DIAGNOSTIC(ExtendImplOutsideClass, Error, - "`extend impl` can only be used in a class."); + "`extend impl` can only be used in a class"); context.emitter().Emit(node_id, ExtendImplOutsideClass); return; } if (params_node.is_valid()) { CARBON_DIAGNOSTIC(ExtendImplForall, Error, - "Cannot `extend` a parameterized `impl`."); + "cannot `extend` a parameterized `impl`"); context.emitter().Emit(extend_node, ExtendImplForall); parent_scope.has_error = true; return; @@ -128,7 +128,7 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, if (context.parse_tree().node_kind(self_type_node) == Parse::NodeKind::TypeImplAs) { CARBON_DIAGNOSTIC(ExtendImplSelfAs, Error, - "Cannot `extend` an `impl` with an explicit self type."); + "cannot `extend` an `impl` with an explicit self type"); auto diag = context.emitter().Build(extend_node, ExtendImplSelfAs); // If the explicit self type is not the default, just bail out. @@ -144,7 +144,7 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, context.parse_tree_and_subtrees().ExtractAs( self_type_node)) { CARBON_DIAGNOSTIC(ExtendImplSelfAsDefault, Note, - "Remove the explicit `Self` type here."); + "remove the explicit `Self` type here"); diag.Note(self_as->type_expr, ExtendImplSelfAsDefault); } diag.Emit(); @@ -160,10 +160,9 @@ static auto ExtendImpl(Context& context, Parse::NodeId extend_node, auto& interface = context.interfaces().Get(interface_type->interface_id); if (!interface.is_defined()) { - CARBON_DIAGNOSTIC( - ExtendUndefinedInterface, Error, - "`extend impl` requires a definition for interface `{0}`.", - SemIR::TypeId); + CARBON_DIAGNOSTIC(ExtendUndefinedInterface, Error, + "`extend impl` requires a definition for interface `{0}`", + SemIR::TypeId); auto diag = context.emitter().Build(node_id, ExtendUndefinedInterface, constraint_id); context.NoteUndefinedInterface(interface_type->interface_id, diag); @@ -246,10 +245,10 @@ auto HandleParseNode(Context& context, Parse::ImplDefinitionStartId node_id) if (impl_info.is_defined()) { CARBON_DIAGNOSTIC(ImplRedefinition, Error, - "Redefinition of `impl {0} as {1}`.", SemIR::TypeId, + "redefinition of `impl {0} as {1}`", SemIR::TypeId, SemIR::TypeId); CARBON_DIAGNOSTIC(ImplPreviousDefinition, Note, - "Previous definition was here."); + "previous definition was here"); context.emitter() .Build(node_id, ImplRedefinition, impl_info.self_id, impl_info.constraint_id) diff --git a/toolchain/check/handle_index.cpp b/toolchain/check/handle_index.cpp index c236503f5b545..8b20d1730b04d 100644 --- a/toolchain/check/handle_index.cpp +++ b/toolchain/check/handle_index.cpp @@ -55,7 +55,7 @@ auto HandleParseNode(Context& context, Parse::IndexExprId node_id) -> bool { default: { if (operand_type_id != SemIR::TypeId::Error) { CARBON_DIAGNOSTIC(TypeNotIndexable, Error, - "Type `{0}` does not support indexing.", + "type `{0}` does not support indexing", SemIR::TypeId); context.emitter().Emit(node_id, TypeNotIndexable, operand_type_id); } diff --git a/toolchain/check/handle_let_and_var.cpp b/toolchain/check/handle_let_and_var.cpp index 5b35f07daff2b..1662e4a7c0100 100644 --- a/toolchain/check/handle_let_and_var.cpp +++ b/toolchain/check/handle_let_and_var.cpp @@ -70,8 +70,8 @@ static auto BuildAssociatedConstantDecl(Context& context, auto binding_pattern = pattern.inst.TryAs(); if (!binding_pattern) { CARBON_DIAGNOSTIC(ExpectedSymbolicBindingInAssociatedConstant, Error, - "Pattern in associated constant declaration must be a " - "single `:!` binding."); + "pattern in associated constant declaration must be a " + "single `:!` binding"); context.emitter().Emit(pattern.loc_id, ExpectedSymbolicBindingInAssociatedConstant); context.name_scopes().Get(interface_info.scope_id).has_error = true; @@ -229,7 +229,7 @@ auto HandleParseNode(Context& context, Parse::LetDeclId node_id) -> bool { if (!decl_info->init_id) { CARBON_DIAGNOSTIC( ExpectedInitializerAfterLet, Error, - "Expected `=`; `let` declaration must have an initializer."); + "expected `=`; `let` declaration must have an initializer"); context.emitter().Emit(TokenOnly(node_id), ExpectedInitializerAfterLet); } diff --git a/toolchain/check/handle_literal.cpp b/toolchain/check/handle_literal.cpp index 9e095ab62a155..1242aa9347588 100644 --- a/toolchain/check/handle_literal.cpp +++ b/toolchain/check/handle_literal.cpp @@ -34,7 +34,7 @@ static auto MakeI32Literal(Context& context, Parse::NodeId node_id, auto val = context.ints().Get(int_id); if (val.getActiveBits() > 31) { CARBON_DIAGNOSTIC(IntLiteralTooLargeForI32, Error, - "Integer literal with value {0} does not fit in i32.", + "integer literal with value {0} does not fit in i32", llvm::APSInt); context.emitter().Emit(node_id, IntLiteralTooLargeForI32, llvm::APSInt(val, /*isUnsigned=*/true)); @@ -72,7 +72,7 @@ auto HandleParseNode(Context& context, Parse::RealLiteralId node_id) -> bool { if (real_value.mantissa.getActiveBits() > 64) { CARBON_DIAGNOSTIC(RealMantissaTooLargeForI64, Error, - "Real mantissa with value {0} does not fit in i64.", + "real mantissa with value {0} does not fit in i64", llvm::APSInt); context.emitter().Emit(node_id, RealMantissaTooLargeForI64, llvm::APSInt(real_value.mantissa, true)); @@ -82,7 +82,7 @@ auto HandleParseNode(Context& context, Parse::RealLiteralId node_id) -> bool { if (real_value.exponent.getSignificantBits() > 64) { CARBON_DIAGNOSTIC(RealExponentTooLargeForI64, Error, - "Real exponent with value {0} does not fit in i64.", + "real exponent with value {0} does not fit in i64", llvm::APSInt); context.emitter().Emit(node_id, RealExponentTooLargeForI64, llvm::APSInt(real_value.exponent, false)); @@ -126,8 +126,8 @@ static auto HandleIntOrUnsignedIntTypeLiteral(Context& context, IntId size_id) -> bool { if (!(context.ints().Get(size_id) & 3).isZero()) { CARBON_DIAGNOSTIC(IntWidthNotMultipleOf8, Error, - "Bit width of integer type literal must be a multiple of " - "8. Use `Core.{0}({1})` instead.", + "bit width of integer type literal must be a multiple of " + "8; use `Core.{0}({1})` instead", std::string, llvm::APSInt); context.emitter().Emit( node_id, IntWidthNotMultipleOf8, int_kind.is_signed() ? "Int" : "UInt", diff --git a/toolchain/check/handle_loop_statement.cpp b/toolchain/check/handle_loop_statement.cpp index 79ba30266161b..c296eaf6edb28 100644 --- a/toolchain/check/handle_loop_statement.cpp +++ b/toolchain/check/handle_loop_statement.cpp @@ -97,7 +97,7 @@ auto HandleParseNode(Context& context, Parse::BreakStatementStartId node_id) auto& stack = context.break_continue_stack(); if (stack.empty()) { CARBON_DIAGNOSTIC(BreakOutsideLoop, Error, - "`break` can only be used in a loop."); + "`break` can only be used in a loop"); context.emitter().Emit(node_id, BreakOutsideLoop); } else { context.AddInst(node_id, @@ -122,7 +122,7 @@ auto HandleParseNode(Context& context, Parse::ContinueStatementStartId node_id) auto& stack = context.break_continue_stack(); if (stack.empty()) { CARBON_DIAGNOSTIC(ContinueOutsideLoop, Error, - "`continue` can only be used in a loop."); + "`continue` can only be used in a loop"); context.emitter().Emit(node_id, ContinueOutsideLoop); } else { context.AddInst(node_id, diff --git a/toolchain/check/handle_modifier.cpp b/toolchain/check/handle_modifier.cpp index 66845a771af62..7faed2ddf64d4 100644 --- a/toolchain/check/handle_modifier.cpp +++ b/toolchain/check/handle_modifier.cpp @@ -9,12 +9,12 @@ namespace Carbon::Check { -CARBON_DIAGNOSTIC(ModifierPrevious, Note, "`{0}` previously appeared here.", +CARBON_DIAGNOSTIC(ModifierPrevious, Note, "`{0}` previously appeared here", Lex::TokenKind); static auto DiagnoseRepeated(Context& context, Parse::NodeId first_node, Parse::NodeId second_node) -> void { - CARBON_DIAGNOSTIC(ModifierRepeated, Error, "`{0}` repeated on declaration.", + CARBON_DIAGNOSTIC(ModifierRepeated, Error, "`{0}` repeated on declaration", Lex::TokenKind); context.emitter() .Build(second_node, ModifierRepeated, context.token_kind(second_node)) @@ -25,7 +25,7 @@ static auto DiagnoseRepeated(Context& context, Parse::NodeId first_node, static auto DiagnoseNotAllowedWith(Context& context, Parse::NodeId first_node, Parse::NodeId second_node) -> void { CARBON_DIAGNOSTIC(ModifierNotAllowedWith, Error, - "`{0}` not allowed on declaration with `{1}`.", + "`{0}` not allowed on declaration with `{1}`", Lex::TokenKind, Lex::TokenKind); context.emitter() .Build(second_node, ModifierNotAllowedWith, @@ -79,7 +79,7 @@ static auto HandleModifier(Context& context, Parse::NodeId node_id, CARBON_CHECK(closest_later_modifier.is_valid()); CARBON_DIAGNOSTIC(ModifierMustAppearBefore, Error, - "`{0}` must appear before `{1}`.", Lex::TokenKind, + "`{0}` must appear before `{1}`", Lex::TokenKind, Lex::TokenKind); context.emitter() .Build(node_id, ModifierMustAppearBefore, context.token_kind(node_id), diff --git a/toolchain/check/handle_name.cpp b/toolchain/check/handle_name.cpp index b5d5138da9333..a28213456839d 100644 --- a/toolchain/check/handle_name.cpp +++ b/toolchain/check/handle_name.cpp @@ -46,7 +46,7 @@ auto HandleParseNode(Context& context, Parse::PointerMemberAccessExprId node_id) auto diagnose_not_pointer = [&context, &node_id](SemIR::TypeId not_pointer_type_id) { CARBON_DIAGNOSTIC(ArrowOperatorOfNonPointer, Error, - "Cannot apply `->` operator to non-pointer type `{0}`.", + "cannot apply `->` operator to non-pointer type `{0}`", SemIR::TypeId); auto builder = context.emitter().Build( diff --git a/toolchain/check/handle_operator.cpp b/toolchain/check/handle_operator.cpp index eca65b148dffc..dd4b225a56c44 100644 --- a/toolchain/check/handle_operator.cpp +++ b/toolchain/check/handle_operator.cpp @@ -77,7 +77,7 @@ auto HandleParseNode(Context& context, Parse::InfixOperatorEqualId node_id) lhs_cat != SemIR::ExprCategory::DurableRef && lhs_cat != SemIR::ExprCategory::Error) { CARBON_DIAGNOSTIC(AssignmentToNonAssignable, Error, - "Expression is not assignable."); + "expression is not assignable"); context.emitter().Emit(lhs_node, AssignmentToNonAssignable); } // TODO: Destroy the old value before reinitializing. This will require @@ -231,13 +231,13 @@ auto HandleParseNode(Context& context, Parse::PrefixOperatorAmpId node_id) break; case SemIR::ExprCategory::EphemeralRef: CARBON_DIAGNOSTIC(AddrOfEphemeralRef, Error, - "Cannot take the address of a temporary object."); + "cannot take the address of a temporary object"); context.emitter().Emit(TokenOnly(node_id), AddrOfEphemeralRef); value_id = SemIR::InstId::BuiltinError; break; default: CARBON_DIAGNOSTIC(AddrOfNonRef, Error, - "Cannot take the address of non-reference expression."); + "cannot take the address of non-reference expression"); context.emitter().Emit(TokenOnly(node_id), AddrOfNonRef); value_id = SemIR::InstId::BuiltinError; break; @@ -263,7 +263,7 @@ auto HandleParseNode(Context& context, Parse::PrefixOperatorConstId node_id) if (context.insts().Get(value_id).kind() == SemIR::ConstType::Kind) { CARBON_DIAGNOSTIC(RepeatedConst, Warning, "`const` applied repeatedly to the same type has no " - "additional effect."); + "additional effect"); context.emitter().Emit(node_id, RepeatedConst); } auto inner_type_id = ExprAsType(context, node_id, value_id); @@ -306,7 +306,7 @@ auto HandleParseNode(Context& context, Parse::PrefixOperatorStarId node_id) [&context, &node_id](SemIR::TypeId not_pointer_type_id) { CARBON_DIAGNOSTIC( DerefOfNonPointer, Error, - "Cannot dereference operand of non-pointer type `{0}`.", + "cannot dereference operand of non-pointer type `{0}`", SemIR::TypeId); auto builder = context.emitter().Build( @@ -316,7 +316,7 @@ auto HandleParseNode(Context& context, Parse::PrefixOperatorStarId node_id) if (not_pointer_type_id == SemIR::TypeId::TypeType) { CARBON_DIAGNOSTIC( DerefOfType, Note, - "To form a pointer type, write the `*` after the pointee type."); + "to form a pointer type, write the `*` after the pointee type"); builder.Note(TokenOnly(node_id), DerefOfType); } diff --git a/toolchain/check/handle_struct.cpp b/toolchain/check/handle_struct.cpp index fa15834451249..f3a3c7ecf1ba8 100644 --- a/toolchain/check/handle_struct.cpp +++ b/toolchain/check/handle_struct.cpp @@ -80,10 +80,10 @@ static auto DiagnoseDuplicateNames(Context& context, auto result = names.Insert(field_inst.name_id, field_inst_id); if (!result.is_inserted()) { CARBON_DIAGNOSTIC(StructNameDuplicate, Error, - "Duplicated field name `{1}` in {0}.", std::string, + "duplicated field name `{1}` in {0}", std::string, SemIR::NameId); CARBON_DIAGNOSTIC(StructNamePrevious, Note, - "Field with the same name here."); + "field with the same name here"); context.emitter() .Build(field_inst_id, StructNameDuplicate, construct.str(), field_inst.name_id) diff --git a/toolchain/check/impl.cpp b/toolchain/check/impl.cpp index bc1844349b776..9660244faf334 100644 --- a/toolchain/check/impl.cpp +++ b/toolchain/check/impl.cpp @@ -23,7 +23,7 @@ static auto NoteAssociatedFunction(Context& context, Context::DiagnosticBuilder& builder, SemIR::FunctionId function_id) -> void { CARBON_DIAGNOSTIC(ImplAssociatedFunctionHere, Note, - "Associated function {0} declared here.", SemIR::NameId); + "associated function {0} declared here", SemIR::NameId); const auto& function = context.functions().Get(function_id); builder.Note(function.latest_decl_id(), ImplAssociatedFunctionHere, function.name_id); @@ -86,7 +86,7 @@ static auto CheckAssociatedFunctionImplementation( context.insts().TryGetAs(impl_decl_id); if (!impl_function_decl) { CARBON_DIAGNOSTIC(ImplFunctionWithNonFunction, Error, - "Associated function {0} implemented by non-function.", + "associated function {0} implemented by non-function", SemIR::NameId); auto builder = context.emitter().Build( impl_decl_id, ImplFunctionWithNonFunction, @@ -130,7 +130,7 @@ static auto BuildInterfaceWitness( const auto& interface = context.interfaces().Get(interface_type.interface_id); if (!context.TryToDefineType(interface_type_id, [&] { CARBON_DIAGNOSTIC(ImplOfUndefinedInterface, Error, - "Implementation of undefined interface {0}.", + "implementation of undefined interface {0}", SemIR::NameId); return context.emitter().Build( impl.definition_id, ImplOfUndefinedInterface, interface.name_id); @@ -172,7 +172,7 @@ static auto BuildInterfaceWitness( } else { CARBON_DIAGNOSTIC( ImplMissingFunction, Error, - "Missing implementation of {0} in impl of interface {1}.", + "missing implementation of {0} in impl of interface {1}", SemIR::NameId, SemIR::NameId); auto builder = context.emitter().Build(impl.definition_id, ImplMissingFunction, diff --git a/toolchain/check/import.cpp b/toolchain/check/import.cpp index 98c5a2f768945..c41ff906c1809 100644 --- a/toolchain/check/import.cpp +++ b/toolchain/check/import.cpp @@ -534,7 +534,7 @@ auto ImportNameFromOtherPackage( // Annotate diagnostics as occurring during this name lookup. DiagnosticAnnotationScope annotate_diagnostics( &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC(InNameLookup, Note, "In name lookup for `{0}`.", + CARBON_DIAGNOSTIC(InNameLookup, Note, "in name lookup for `{0}`", SemIR::NameId); builder.Note(loc, InNameLookup, name_id); }); diff --git a/toolchain/check/member_access.cpp b/toolchain/check/member_access.cpp index 7179f33891600..30f11e1a7fc13 100644 --- a/toolchain/check/member_access.cpp +++ b/toolchain/check/member_access.cpp @@ -37,7 +37,7 @@ static auto GetAsLookupScope(Context& context, SemIR::LocId loc_id, context.TryToDefineType( context.GetTypeIdForTypeConstant(base_const_id), [&] { CARBON_DIAGNOSTIC(QualifiedExprInIncompleteClassScope, Error, - "Member access into incomplete class `{0}`.", + "member access into incomplete class `{0}`", std::string); return context.emitter().Build( loc_id, QualifiedExprInIncompleteClassScope, @@ -51,7 +51,7 @@ static auto GetAsLookupScope(Context& context, SemIR::LocId loc_id, context.TryToDefineType( context.GetTypeIdForTypeConstant(base_const_id), [&] { CARBON_DIAGNOSTIC(QualifiedExprInUndefinedInterfaceScope, Error, - "Member access into undefined interface `{0}`.", + "member access into undefined interface `{0}`", std::string); return context.emitter().Build( loc_id, QualifiedExprInUndefinedInterfaceScope, @@ -218,7 +218,7 @@ static auto PerformImplLookup( if (!witness_id.is_valid()) { if (missing_impl_diagnoser) { CARBON_DIAGNOSTIC(MissingImplInMemberAccessNote, Note, - "Type `{1}` does not implement interface `{0}`.", + "type `{1}` does not implement interface `{0}`", SemIR::NameId, SemIR::TypeId); (*missing_impl_diagnoser)() .Note(loc_id, MissingImplInMemberAccessNote, interface.name_id, @@ -226,8 +226,8 @@ static auto PerformImplLookup( .Emit(); } else { CARBON_DIAGNOSTIC(MissingImplInMemberAccess, Error, - "Cannot access member of interface `{0}` in type `{1}` " - "that does not implement that interface.", + "cannot access member of interface `{0}` in type `{1}` " + "that does not implement that interface", SemIR::NameId, SemIR::TypeId); context.emitter().Emit(loc_id, MissingImplInMemberAccess, interface.name_id, @@ -388,10 +388,9 @@ static auto ValidateTupleIndex(Context& context, SemIR::LocId loc_id, -> const llvm::APInt* { const auto& index_val = context.ints().Get(index_inst.int_id); if (index_val.uge(size)) { - CARBON_DIAGNOSTIC( - TupleIndexOutOfBounds, Error, - "Tuple element index `{0}` is past the end of type `{1}`.", TypedInt, - SemIR::TypeId); + CARBON_DIAGNOSTIC(TupleIndexOutOfBounds, Error, + "tuple element index `{0}` is past the end of type `{1}`", + TypedInt, SemIR::TypeId); context.emitter().Emit(loc_id, TupleIndexOutOfBounds, {.type = index_inst.type_id, .value = index_val}, operand_inst.type_id()); @@ -417,7 +416,7 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id, auto base_type_id = context.insts().Get(base_id).type_id(); if (!context.TryToCompleteType(base_type_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInMemberAccess, Error, - "Member access into object of incomplete type `{0}`.", + "member access into object of incomplete type `{0}`", SemIR::TypeId); return context.emitter().Build(base_id, IncompleteTypeInMemberAccess, base_type_id); @@ -450,7 +449,7 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id, } } CARBON_DIAGNOSTIC(QualifiedExprNameNotFound, Error, - "Type `{0}` does not have a member `{1}`.", + "type `{0}` does not have a member `{1}`", SemIR::TypeId, SemIR::NameId); context.emitter().Emit(loc_id, QualifiedExprNameNotFound, base_type_id, name_id); @@ -459,7 +458,7 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id, if (base_type_id != SemIR::TypeId::Error) { CARBON_DIAGNOSTIC(QualifiedExprUnsupported, Error, - "Type `{0}` does not support qualified expressions.", + "type `{0}` does not support qualified expressions", SemIR::TypeId); context.emitter().Emit(loc_id, QualifiedExprUnsupported, base_type_id); } @@ -508,8 +507,8 @@ auto PerformCompoundMemberAccess( // because the base expression is not used for anything. if (member_id == member_expr_id && member.type_id() != SemIR::TypeId::Error) { CARBON_DIAGNOSTIC(CompoundMemberAccessDoesNotUseBase, Error, - "Member name of type `{0}` in compound member access is " - "not an instance member or an interface member.", + "member name of type `{0}` in compound member access is " + "not an instance member or an interface member", SemIR::TypeId); context.emitter().Emit(loc_id, CompoundMemberAccessDoesNotUseBase, member.type_id()); @@ -528,8 +527,8 @@ auto PerformTupleAccess(Context& context, SemIR::LocId loc_id, auto tuple_type = context.types().TryGetAs(tuple_type_id); if (!tuple_type) { CARBON_DIAGNOSTIC(TupleIndexOnANonTupleType, Error, - "Type `{0}` does not support tuple indexing. Only " - "tuples can be indexed that way.", + "type `{0}` does not support tuple indexing; only " + "tuples can be indexed that way", SemIR::TypeId); context.emitter().Emit(loc_id, TupleIndexOnANonTupleType, tuple_type_id); return SemIR::InstId::BuiltinError; @@ -546,7 +545,7 @@ auto PerformTupleAccess(Context& context, SemIR::LocId loc_id, } else if (!index_const_id.is_template()) { // TODO: Decide what to do if the index is a symbolic constant. CARBON_DIAGNOSTIC(TupleIndexNotConstant, Error, - "Tuple index must be a constant."); + "tuple index must be a constant"); context.emitter().Emit(loc_id, TupleIndexNotConstant); return SemIR::InstId::BuiltinError; } diff --git a/toolchain/check/merge.cpp b/toolchain/check/merge.cpp index ae00a8f7b5f4b..ab769ef2b323c 100644 --- a/toolchain/check/merge.cpp +++ b/toolchain/check/merge.cpp @@ -11,14 +11,14 @@ namespace Carbon::Check { -CARBON_DIAGNOSTIC(RedeclPrevDecl, Note, "Previously declared here."); +CARBON_DIAGNOSTIC(RedeclPrevDecl, Note, "previously declared here"); // Diagnoses a redeclaration which is redundant. static auto DiagnoseRedundant(Context& context, Lex::TokenKind decl_kind, SemIR::NameId name_id, SemIRLoc new_loc, SemIRLoc prev_loc) -> void { CARBON_DIAGNOSTIC(RedeclRedundant, Error, - "Redeclaration of `{0} {1}` is redundant.", Lex::TokenKind, + "redeclaration of `{0} {1}` is redundant", Lex::TokenKind, SemIR::NameId); context.emitter() .Build(new_loc, RedeclRedundant, decl_kind, name_id) @@ -30,9 +30,9 @@ static auto DiagnoseRedundant(Context& context, Lex::TokenKind decl_kind, static auto DiagnoseRedef(Context& context, Lex::TokenKind decl_kind, SemIR::NameId name_id, SemIRLoc new_loc, SemIRLoc prev_loc) -> void { - CARBON_DIAGNOSTIC(RedeclRedef, Error, "Redefinition of `{0} {1}`.", + CARBON_DIAGNOSTIC(RedeclRedef, Error, "redefinition of `{0} {1}`", Lex::TokenKind, SemIR::NameId); - CARBON_DIAGNOSTIC(RedeclPrevDef, Note, "Previously defined here."); + CARBON_DIAGNOSTIC(RedeclPrevDef, Note, "previously defined here"); context.emitter() .Build(new_loc, RedeclRedef, decl_kind, name_id) .Note(prev_loc, RedeclPrevDef) @@ -44,7 +44,7 @@ static auto DiagnoseExternMismatch(Context& context, Lex::TokenKind decl_kind, SemIR::NameId name_id, SemIRLoc new_loc, SemIRLoc prev_loc) -> void { CARBON_DIAGNOSTIC(RedeclExternMismatch, Error, - "Redeclarations of `{0} {1}` must match use of `extern`.", + "redeclarations of `{0} {1}` must match use of `extern`", Lex::TokenKind, SemIR::NameId); context.emitter() .Build(new_loc, RedeclExternMismatch, decl_kind, name_id) @@ -59,7 +59,7 @@ static auto DiagnoseExternLibraryInImporter(Context& context, SemIRLoc new_loc, SemIRLoc prev_loc) -> void { CARBON_DIAGNOSTIC(ExternLibraryInImporter, Error, - "Cannot declare imported `{0} {1}` as `extern library`.", + "cannot declare imported `{0} {1}` as `extern library`", Lex::TokenKind, SemIR::NameId); context.emitter() .Build(new_loc, ExternLibraryInImporter, decl_kind, name_id) @@ -72,10 +72,10 @@ static auto DiagnoseExternLibraryIncorrect(Context& context, SemIRLoc new_loc, SemIRLoc prev_loc) -> void { CARBON_DIAGNOSTIC( ExternLibraryIncorrect, Error, - "Declaration in {0} doesn't match `extern library` declaration.", + "declaration in {0} doesn't match `extern library` declaration", SemIR::LibraryNameId); CARBON_DIAGNOSTIC(ExternLibraryExpected, Note, - "Previously declared with `extern library` here."); + "previously declared with `extern library` here"); context.emitter() .Build(new_loc, ExternLibraryIncorrect, context.sem_ir().library_id()) .Note(prev_loc, ExternLibraryExpected) @@ -86,7 +86,7 @@ auto DiagnoseExternRequiresDeclInApiFile(Context& context, SemIRLoc loc) -> void { CARBON_DIAGNOSTIC( ExternRequiresDeclInApiFile, Error, - "`extern` entities must have a declaration in the API file."); + "`extern` entities must have a declaration in the API file"); context.emitter().Build(loc, ExternRequiresDeclInApiFile).Emit(); } @@ -203,10 +203,10 @@ static auto CheckRedeclParam(Context& context, // params. auto diagnose = [&]() { CARBON_DIAGNOSTIC(RedeclParamDiffers, Error, - "Redeclaration differs at {0}parameter {1}.", + "redeclaration differs at {0}parameter {1}", llvm::StringLiteral, int32_t); CARBON_DIAGNOSTIC(RedeclParamPrevious, Note, - "Previous declaration's corresponding {0}parameter here.", + "previous declaration's corresponding {0}parameter here", llvm::StringLiteral); context.emitter() .Build(new_param_ref_id, RedeclParamDiffers, param_diag_label, @@ -269,10 +269,10 @@ static auto CheckRedeclParams(Context& context, SemIRLoc new_decl_loc, // If exactly one of the parameter lists was present, they differ. if (new_param_refs_id.is_valid() != prev_param_refs_id.is_valid()) { CARBON_DIAGNOSTIC(RedeclParamListDiffers, Error, - "Redeclaration differs because of {1}{0}parameter list.", + "redeclaration differs because of {1}{0}parameter list", llvm::StringLiteral, llvm::StringLiteral); CARBON_DIAGNOSTIC(RedeclParamListPrevious, Note, - "Previously declared with{1} {0}parameter list.", + "previously declared with{1} {0}parameter list", llvm::StringLiteral, llvm::StringLiteral); context.emitter() .Build( @@ -290,10 +290,10 @@ static auto CheckRedeclParams(Context& context, SemIRLoc new_decl_loc, if (new_param_ref_ids.size() != prev_param_ref_ids.size()) { CARBON_DIAGNOSTIC( RedeclParamCountDiffers, Error, - "Redeclaration differs because of {0}parameter count of {1}.", + "redeclaration differs because of {0}parameter count of {1}", llvm::StringLiteral, int32_t); CARBON_DIAGNOSTIC(RedeclParamCountPrevious, Note, - "Previously declared with {0}parameter count of {1}.", + "previously declared with {0}parameter count of {1}", llvm::StringLiteral, int32_t); context.emitter() .Build(new_decl_loc, RedeclParamCountDiffers, param_diag_label, @@ -367,9 +367,9 @@ static auto CheckRedeclParamSyntax(Context& context, for (auto [new_node_id, prev_node_id] : llvm::zip(new_range, prev_range)) { if (!IsNodeSyntaxEqual(context, new_node_id, prev_node_id)) { CARBON_DIAGNOSTIC(RedeclParamSyntaxDiffers, Error, - "Redeclaration syntax differs here."); + "redeclaration syntax differs here"); CARBON_DIAGNOSTIC(RedeclParamSyntaxPrevious, Note, - "Comparing with previous declaration here."); + "comparing with previous declaration here"); context.emitter() .Build(new_node_id, RedeclParamSyntaxDiffers) .Note(prev_node_id, RedeclParamSyntaxPrevious) diff --git a/toolchain/check/modifiers.cpp b/toolchain/check/modifiers.cpp index 17092bd271644..e53836fb310ec 100644 --- a/toolchain/check/modifiers.cpp +++ b/toolchain/check/modifiers.cpp @@ -13,14 +13,13 @@ static auto DiagnoseNotAllowed(Context& context, Parse::NodeId modifier_node, llvm::StringRef context_string, SemIR::LocId context_loc_id) -> void { CARBON_DIAGNOSTIC(ModifierNotAllowedOn, Error, - "`{0}` not allowed on `{1}` declaration{2}.", - Lex::TokenKind, Lex::TokenKind, std::string); + "`{0}` not allowed on `{1}` declaration{2}", Lex::TokenKind, + Lex::TokenKind, std::string); auto diag = context.emitter().Build(modifier_node, ModifierNotAllowedOn, context.token_kind(modifier_node), decl_kind, context_string.str()); if (context_loc_id.is_valid()) { - CARBON_DIAGNOSTIC(ModifierNotInContext, Note, - "Containing definition here."); + CARBON_DIAGNOSTIC(ModifierNotInContext, Note, "containing definition here"); diag.Note(context_loc_id, ModifierNotInContext); } diag.Emit(); @@ -136,7 +135,7 @@ auto RestrictExternModifierOnDecl(Context& context, // This prints an error for `extern library`, but doesn't drop it because we // assume there is some other, correct value that we just don't know here. CARBON_DIAGNOSTIC(ExternLibraryIsCurrentLibrary, Error, - "`extern library` cannot specify the current library."); + "`extern library` cannot specify the current library"); context.emitter().Emit(introducer.modifier_node_id(ModifierOrder::Extern), ExternLibraryIsCurrentLibrary); introducer.extern_library = SemIR::LibraryNameId::Error; @@ -145,8 +144,8 @@ auto RestrictExternModifierOnDecl(Context& context, if (is_definition && introducer.extern_library.is_valid()) { CARBON_DIAGNOSTIC(ExternLibraryOnDefinition, Error, - "A library cannot be provided for an `extern` modifier " - "on a definition."); + "a library cannot be provided for an `extern` modifier " + "on a definition"); context.emitter().Emit(introducer.modifier_node_id(ModifierOrder::Extern), ExternLibraryOnDefinition); } diff --git a/toolchain/check/name_component.cpp b/toolchain/check/name_component.cpp index 7c92754303cd5..d43d41d1154b7 100644 --- a/toolchain/check/name_component.cpp +++ b/toolchain/check/name_component.cpp @@ -58,7 +58,7 @@ auto PopNameComponentWithoutParams(Context& context, Lex::TokenKind introducer) NameComponent name = PopNameComponent(context); if (name.implicit_params_id.is_valid() || name.params_id.is_valid()) { CARBON_DIAGNOSTIC(UnexpectedDeclNameParams, Error, - "`{0}` declaration cannot have parameters.", + "`{0}` declaration cannot have parameters", Lex::TokenKind); // Point to the lexically first parameter list in the diagnostic. context.emitter().Emit(name.implicit_params_id.is_valid() diff --git a/toolchain/check/return.cpp b/toolchain/check/return.cpp index aa3c495efea8b..9f966fed50ec9 100644 --- a/toolchain/check/return.cpp +++ b/toolchain/check/return.cpp @@ -32,7 +32,7 @@ static auto GetCurrentReturnedVar(Context& context) -> SemIR::InstId { static auto NoteNoReturnTypeProvided(Context::DiagnosticBuilder& diag, const SemIR::Function& function) { CARBON_DIAGNOSTIC(ReturnTypeOmittedNote, Note, - "There was no return type provided."); + "there was no return type provided"); diag.Note(function.latest_decl_id(), ReturnTypeOmittedNote); } @@ -41,14 +41,14 @@ static auto NoteReturnType(Context::DiagnosticBuilder& diag, const SemIR::Function& function, SemIR::TypeId return_type_id) { CARBON_DIAGNOSTIC(ReturnTypeHereNote, Note, - "Return type of function is `{0}`.", SemIR::TypeId); + "return type of function is `{0}`", SemIR::TypeId); diag.Note(function.return_storage_id, ReturnTypeHereNote, return_type_id); } // Produces a note pointing at the currently in scope `returned var`. static auto NoteReturnedVar(Context::DiagnosticBuilder& diag, SemIR::InstId returned_var_id) { - CARBON_DIAGNOSTIC(ReturnedVarHere, Note, "`returned var` was declared here."); + CARBON_DIAGNOSTIC(ReturnedVarHere, Note, "`returned var` was declared here"); diag.Note(returned_var_id, ReturnedVarHere); } @@ -69,7 +69,7 @@ auto CheckReturnedVar(Context& context, Parse::NodeId returned_node, // A `returned var` requires an explicit return type. if (!return_info.type_id.is_valid()) { CARBON_DIAGNOSTIC(ReturnedVarWithNoReturnType, Error, - "Cannot declare a `returned var` in this function."); + "cannot declare a `returned var` in this function"); auto diag = context.emitter().Build(returned_node, ReturnedVarWithNoReturnType); NoteNoReturnTypeProvided(diag, function); @@ -80,8 +80,8 @@ auto CheckReturnedVar(Context& context, Parse::NodeId returned_node, // The declared type of the var must match the return type of the function. if (return_info.type_id != type_id) { CARBON_DIAGNOSTIC(ReturnedVarWrongType, Error, - "Type `{0}` of `returned var` does not match " - "return type of enclosing function.", + "type `{0}` of `returned var` does not match " + "return type of enclosing function", SemIR::TypeId); auto diag = context.emitter().Build(type_node, ReturnedVarWrongType, type_id); @@ -103,8 +103,8 @@ auto RegisterReturnedVar(Context& context, SemIR::InstId bind_id) -> void { auto existing_id = context.scope_stack().SetReturnedVarOrGetExisting(bind_id); if (existing_id.is_valid()) { CARBON_DIAGNOSTIC(ReturnedVarShadowed, Error, - "Cannot declare a `returned var` in the scope of " - "another `returned var`."); + "cannot declare a `returned var` in the scope of " + "another `returned var`"); auto diag = context.emitter().Build(bind_id, ReturnedVarShadowed); NoteReturnedVar(diag, existing_id); diag.Emit(); @@ -118,7 +118,7 @@ auto BuildReturnWithNoExpr(Context& context, Parse::ReturnStatementId node_id) if (return_type_id.is_valid()) { CARBON_DIAGNOSTIC(ReturnStatementMissingExpr, Error, - "Missing return value."); + "missing return value"); auto diag = context.emitter().Build(node_id, ReturnStatementMissingExpr); NoteReturnType(diag, function, return_type_id); diag.Emit(); @@ -138,7 +138,7 @@ auto BuildReturnWithExpr(Context& context, Parse::ReturnStatementId node_id, if (!return_info.type_id.is_valid()) { CARBON_DIAGNOSTIC( ReturnStatementDisallowExpr, Error, - "No return expression should be provided in this context."); + "no return expression should be provided in this context"); auto diag = context.emitter().Build(node_id, ReturnStatementDisallowExpr); NoteNoReturnTypeProvided(diag, function); diag.Emit(); @@ -146,7 +146,7 @@ auto BuildReturnWithExpr(Context& context, Parse::ReturnStatementId node_id, } else if (returned_var_id.is_valid()) { CARBON_DIAGNOSTIC( ReturnExprWithReturnedVar, Error, - "Can only `return var;` in the scope of a `returned var`."); + "can only `return var;` in the scope of a `returned var`"); auto diag = context.emitter().Build(node_id, ReturnExprWithReturnedVar); NoteReturnedVar(diag, returned_var_id); diag.Emit(); @@ -174,7 +174,7 @@ auto BuildReturnVar(Context& context, Parse::ReturnStatementId node_id) if (!returned_var_id.is_valid()) { CARBON_DIAGNOSTIC(ReturnVarWithNoReturnedVar, Error, - "`return var;` with no `returned var` in scope."); + "`return var;` with no `returned var` in scope"); context.emitter().Emit(node_id, ReturnVarWithNoReturnedVar); returned_var_id = SemIR::InstId::BuiltinError; } diff --git a/toolchain/check/sem_ir_diagnostic_converter.cpp b/toolchain/check/sem_ir_diagnostic_converter.cpp index 74c2be1d54569..131fd38290326 100644 --- a/toolchain/check/sem_ir_diagnostic_converter.cpp +++ b/toolchain/check/sem_ir_diagnostic_converter.cpp @@ -47,7 +47,7 @@ auto SemIRDiagnosticConverter::ConvertLoc(SemIRLoc loc, // TODO: Add an "In implicit import of prelude." note for the case where we // don't have a location. if (import_loc_id.is_valid()) { - CARBON_DIAGNOSTIC(InImport, Note, "In import."); + CARBON_DIAGNOSTIC(InImport, Note, "in import"); context_fn(in_import_loc, InImport); } diff --git a/toolchain/check/testdata/alias/fail_bool_value.carbon b/toolchain/check/testdata/alias/fail_bool_value.carbon index 57f028c180a6c..84b1e63a3cbae 100644 --- a/toolchain/check/testdata/alias/fail_bool_value.carbon +++ b/toolchain/check/testdata/alias/fail_bool_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_bool_value.carbon -// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: ERROR: Alias initializer must be a name reference. +// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference // CHECK:STDERR: alias a = false; // CHECK:STDERR: ^~~~~ alias a = false; diff --git a/toolchain/check/testdata/alias/fail_builtins.carbon b/toolchain/check/testdata/alias/fail_builtins.carbon index 7874e01602281..dc169cd29aa5c 100644 --- a/toolchain/check/testdata/alias/fail_builtins.carbon +++ b/toolchain/check/testdata/alias/fail_builtins.carbon @@ -8,13 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_builtins.carbon -// CHECK:STDERR: fail_builtins.carbon:[[@LINE+4]]:11: ERROR: Alias initializer must be a name reference. +// CHECK:STDERR: fail_builtins.carbon:[[@LINE+4]]:11: error: alias initializer must be a name reference // CHECK:STDERR: alias a = i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: alias a = i32; -// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: ERROR: Alias initializer must be a name reference. +// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference // CHECK:STDERR: alias b = bool; // CHECK:STDERR: ^~~~ alias b = bool; diff --git a/toolchain/check/testdata/alias/fail_control_flow.carbon b/toolchain/check/testdata/alias/fail_control_flow.carbon index 9e166a5a3ba37..69ce51afd902d 100644 --- a/toolchain/check/testdata/alias/fail_control_flow.carbon +++ b/toolchain/check/testdata/alias/fail_control_flow.carbon @@ -8,15 +8,15 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_control_flow.carbon -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: ERROR: Alias initializer must be a name reference. +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ alias a = true or false; diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index fce46c348ae03..f1f047cd98a07 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -53,7 +53,7 @@ library "[[@TEST_NAME]]"; import library "export"; -// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+3]]:8: ERROR: Name `C` not found. +// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+3]]:8: error: name `C` not found // CHECK:STDERR: var c: C = {}; // CHECK:STDERR: ^ var c: C = {}; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon index d6155b6596762..73f2d897efe8f 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon @@ -14,7 +14,7 @@ class D {} alias c = C; var d: D = {}; -// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: ERROR: Package `Core` implicitly referenced here, but not found. +// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: let c_var: c = d; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ let c_var: c = d; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon index 84d49d7370f21..9656040f434d8 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon @@ -11,16 +11,16 @@ namespace NS; fn F() -> {} { - // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+8]]:9: ERROR: Name `NS` not found. + // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+8]]:9: error: name `NS` not found // CHECK:STDERR: alias NS.a = {}; // CHECK:STDERR: ^~ // CHECK:STDERR: - // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: ERROR: Alias initializer must be a name reference. + // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: error: alias initializer must be a name reference // CHECK:STDERR: alias NS.a = {}; // CHECK:STDERR: ^~ // CHECK:STDERR: alias NS.a = {}; - // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: ERROR: Name `a` not found. + // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error: name `a` not found // CHECK:STDERR: return NS.a; // CHECK:STDERR: ^~~~ return NS.a; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon index 7d47bba4016d8..1311b72c89dfb 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon @@ -10,40 +10,40 @@ class Class {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:1: ERROR: `abstract` not allowed on `alias` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:1: error: `abstract` not allowed on `alias` declaration // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: ERROR: `base` not allowed on declaration with `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: error: `base` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:15: ERROR: `default` not allowed on declaration with `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:15: error: `default` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:23: ERROR: `final` not allowed on declaration with `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:23: error: `final` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract base default final alias A = Class; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `impl` not allowed on `alias` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `impl` not allowed on `alias` declaration // CHECK:STDERR: impl alias B = Class; // CHECK:STDERR: ^~~~ // CHECK:STDERR: impl alias B = Class; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: ERROR: `extern` not allowed on `alias` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `extern` not allowed on `alias` declaration // CHECK:STDERR: extern alias C = Class; // CHECK:STDERR: ^~~~~~ extern alias C = Class; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon index d1fd15f7c0c2b..102ea34071742 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon @@ -11,20 +11,20 @@ class C {} alias a = C; -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: error: duplicate name being declared in the same scope // CHECK:STDERR: var a: C = {}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: Name is previously declared here. +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: name is previously declared here // CHECK:STDERR: alias a = C; // CHECK:STDERR: ^ // CHECK:STDERR: var a: C = {}; var b: C = {}; -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope // CHECK:STDERR: alias b = C; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: Name is previously declared here. +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: name is previously declared here // CHECK:STDERR: var b: C = {}; // CHECK:STDERR: ^ alias b = C; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon index 68cbb84fd9eba..8817318f323a6 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon @@ -11,7 +11,7 @@ fn F() { var a: () = (); var b: ()* = &a; - // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: ERROR: Alias initializer must be a name reference. + // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: error: alias initializer must be a name reference // CHECK:STDERR: alias c = *b; // CHECK:STDERR: ^~ alias c = *b; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon index bb8639e5a3716..1077c382900ee 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon @@ -8,11 +8,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/fail_params.carbon -// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:8: ERROR: `alias` declaration cannot have parameters. +// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:8: error: `alias` declaration cannot have parameters // CHECK:STDERR: alias A(T:! type) = T*; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: ERROR: Alias initializer must be a name reference. +// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: error: alias initializer must be a name reference // CHECK:STDERR: alias A(T:! type) = T*; // CHECK:STDERR: ^~ alias A(T:! type) = T*; diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index 2494c159a482b..c844973f2823e 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -58,10 +58,10 @@ var b: () = a_alias; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_var3.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_var3.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import library "var2"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: var2.carbon:8:5: ERROR: Semantics TODO: `Non-constant ImportRefLoaded (comes up with var)`. +// CHECK:STDERR: var2.carbon:8:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` // CHECK:STDERR: var b: () = a_alias; // CHECK:STDERR: ^ import library "var2"; diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index 1c4aac6aa407a..3edfd8234e2e6 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -35,7 +35,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:11: ERROR: Name `A` not found. +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:11: error: name `A` not found // CHECK:STDERR: var inst: A = {}; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -47,7 +47,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: ERROR: Name `A` not found. +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error: name `A` not found // CHECK:STDERR: var inst: Test.A = {}; // CHECK:STDERR: ^~~~~~ var inst: Test.A = {}; diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 0713970c02def..f09108c91ed89 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -10,7 +10,7 @@ fn Negate(n: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: ERROR: Array bound of -1 is negative. +// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: error: array bound of -1 is negative // CHECK:STDERR: var a: [i32; Negate(1)]; // CHECK:STDERR: ^~~~~~~ var a: [i32; Negate(1)]; diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index cda82f13c9c33..ce45093a4c503 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -11,20 +11,20 @@ // TODO: Once we preserve the full value of integer literals in SemIR, check // that we reject the array bound being too large. -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: ERROR: Integer literal with value 39999999999999999993 does not fit in i32. +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 39999999999999999993 does not fit in i32 // CHECK:STDERR: var a: [i32; 39999999999999999993]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var a: [i32; 39999999999999999993]; -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: ERROR: Cannot implicitly convert from `i32` to `type`. +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: Type `i32` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: ERROR: Integer literal with value 39999999999999999993 does not fit in i32. +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: error: integer literal with value 39999999999999999993 does not fit in i32 // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ var b: [1; 39999999999999999993]; diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index 33c3c7db833c2..07f63b3f44622 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -10,10 +10,10 @@ class Incomplete; -// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: ERROR: Variable has incomplete type `[Incomplete; 1]`. +// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error: Variable has incomplete type `[Incomplete; 1]` // CHECK:STDERR: var a: [Incomplete; 1]; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: Class was forward declared here. +// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var a: [Incomplete; 1]; diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 1c4a9aa520b00..8fb92850b7e56 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_invalid_type.carbon -// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: ERROR: Cannot implicitly convert from `i32` to `type`. +// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: Type `i32` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ var a: [1; 1]; diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 225359a78bfc6..7561abffffc84 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound.carbon -// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: ERROR: Cannot initialize array of 1 element(s) from 3 initializer(s). +// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: error: cannot initialize array of 1 element(s) from 3 initializer(s) // CHECK:STDERR: var a: [i32; 1] = (1, 2, 3); // CHECK:STDERR: ^~~~~~~~~ var a: [i32; 1] = (1, 2, 3); diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index 634c05339ce04..63864b398e281 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon var a: [i32; 3] = (1, 2, 3); -// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: ERROR: Array index `3` is past the end of type `[i32; 3]`. +// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: error: array index `3` is past the end of type `[i32; 3]` // CHECK:STDERR: var b: i32 = a[{.index = 3}.index]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ var b: i32 = a[{.index = 3}.index]; diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 47ea8bff664ff..61801716b9130 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -8,33 +8,33 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_type_mismatch.carbon -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: ERROR: Cannot implicitly convert from `String` to `i32`. +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: Type `String` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); var t1: (i32, String, String); -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: ERROR: Cannot implicitly convert from `String` to `i32`. +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` // CHECK:STDERR: var b: [i32; 3] = t1; // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: Type `String` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: [i32; 3] = t1; // CHECK:STDERR: ^~ // CHECK:STDERR: var b: [i32; 3] = t1; -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: ERROR: Cannot initialize array of 3 element(s) from 2 initializer(s). +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: error: cannot initialize array of 3 element(s) from 2 initializer(s) // CHECK:STDERR: var c: [i32; 3] = (1, 2); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: var c: [i32; 3] = (1, 2); var t2: (i32, i32); -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: ERROR: Cannot initialize array of 3 element(s) from tuple with 2 element(s). +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: error: cannot initialize array of 3 element(s) from tuple with 2 element(s). // CHECK:STDERR: var d: [i32; 3] = t2; // CHECK:STDERR: ^~ var d: [i32; 3] = t2; diff --git a/toolchain/check/testdata/array/fail_undefined_bound.carbon b/toolchain/check/testdata/array/fail_undefined_bound.carbon index e0e567d4be0ed..6c071fe92485a 100644 --- a/toolchain/check/testdata/array/fail_undefined_bound.carbon +++ b/toolchain/check/testdata/array/fail_undefined_bound.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_undefined_bound.carbon -// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: ERROR: Semantics TODO: `HandleArrayExprWithoutBounds`. +// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: error: semantics TODO: `HandleArrayExprWithoutBounds` // CHECK:STDERR: var a: [i32; ]; // CHECK:STDERR: ^~~~~~~ var a: [i32; ]; diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 13fbdcd9ecbd5..5330d9fa01d48 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -76,7 +76,7 @@ let b_value: B = ({.x = 1, .y = 2} as A) as B; // a copy to perform initialization. It's not clear whether that is the right // behavior. -// CHECK:STDERR: fail_init_class.carbon:[[@LINE+4]]:17: ERROR: Cannot copy value of type `B`. +// CHECK:STDERR: fail_init_class.carbon:[[@LINE+4]]:17: error: cannot copy value of type `B` // CHECK:STDERR: var b_init: B = ({.x = 1, .y = 2} as A) as B; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -97,10 +97,10 @@ class B { // We do not try to implicitly convert from the first operand of `as` to the // adapted type of the second operand. -// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+6]]:12: ERROR: Cannot convert from `{.x: i32}` to `B` with `as`. +// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+6]]:12: error: cannot convert from `{.x: i32}` to `B` with `as` // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: Type `{.x: i32}` does not implement interface `As`. +// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: type `{.x: i32}` does not implement interface `As` // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ var b: B = {.x = 1} as B; diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 73a17a6abf98b..c255da428bd0b 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/as/fail_no_conversion.carbon -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:21: ERROR: Cannot convert from `i32` to `(i32, i32)` with `as`. +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:21: error: cannot convert from `i32` to `(i32, i32)` with `as` // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: Type `i32` does not implement interface `As`. +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: type `i32` does not implement interface `As` // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ let n: (i32, i32) = 1 as (i32, i32); diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 12510f08baeba..766b29af8c41d 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/as/fail_not_type.carbon -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+6]]:19: ERROR: Cannot implicitly convert from `i32` to `type`. +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+6]]:19: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: Type `i32` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ let n: i32 = 1 as 2; diff --git a/toolchain/check/testdata/basics/fail_bad_run.carbon b/toolchain/check/testdata/basics/fail_bad_run.carbon index 024e3b04f5ec4..10b3caab7ceb2 100644 --- a/toolchain/check/testdata/basics/fail_bad_run.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run.carbon @@ -8,11 +8,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_bad_run.carbon -// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+7]]:1: ERROR: Invalid signature for `Main.Run` function. Expected `fn ()` or `fn () -> i32`. +// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+7]]:1: error: invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` // CHECK:STDERR: fn Run() -> String {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+3]]:21: ERROR: Missing `return` at end of function with declared return type. +// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+3]]:21: error: missing `return` at end of function with declared return type // CHECK:STDERR: fn Run() -> String {} // CHECK:STDERR: ^ fn Run() -> String {} diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index 5aae129a323f3..4391cf2427b48 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_bad_run_2.carbon -// CHECK:STDERR: fail_bad_run_2.carbon:[[@LINE+3]]:1: ERROR: Invalid signature for `Main.Run` function. Expected `fn ()` or `fn () -> i32`. +// CHECK:STDERR: fail_bad_run_2.carbon:[[@LINE+3]]:1: error: invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` // CHECK:STDERR: fn Run(n: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~ fn Run(n: i32) {} diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index d6e04bd512448..5b3b25f5e927d 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_non_type_as_type.carbon -// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+6]]:1: ERROR: Cannot implicitly convert from `i32` to `type`. +// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: Type `i32` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var x: type = 42; diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 117c7499332d8..35f316a0b0183 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -8,31 +8,31 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: ERROR: Integer literal with value 39999999999999999993 does not fit in i32. +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 39999999999999999993 does not fit in i32 // CHECK:STDERR: let a: i32 = 39999999999999999993; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let a: i32 = 39999999999999999993; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: ERROR: Integer literal with value 2147483648 does not fit in i32. +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 2147483648 does not fit in i32 // CHECK:STDERR: let b: i32 = 2_147_483_648; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: let b: i32 = 2_147_483_648; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: ERROR: Integer literal with value 2147483648 does not fit in i32. +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 2147483648 does not fit in i32 // CHECK:STDERR: let c: i32 = 0x8000_0000; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: let c: i32 = 0x8000_0000; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: ERROR: Real mantissa with value 399999999999999999930 does not fit in i64. +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: real mantissa with value 399999999999999999930 does not fit in i64 // CHECK:STDERR: let d: f64 = 39999999999999999993.0e3; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let d: f64 = 39999999999999999993.0e3; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+3]]:14: ERROR: Real exponent with value 39999999999999999992 does not fit in i64. +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+3]]:14: error: real exponent with value 39999999999999999992 does not fit in i64 // CHECK:STDERR: let e: f64 = 5.0e39999999999999999993; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ let e: f64 = 5.0e39999999999999999993; diff --git a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon index 623cb71dfedde..43b35faae3bd5 100644 --- a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon +++ b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon var x: i32; -// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:14: ERROR: Type `i32` does not support qualified expressions. +// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:14: error: type `i32` does not support qualified expressions // CHECK:STDERR: var y: i32 = x.b; // CHECK:STDERR: ^~~ var y: i32 = x.b; diff --git a/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon b/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon index 77e0d4ea114d4..f66c859c9e123 100644 --- a/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon +++ b/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon fn Main() { - // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+3]]:3: ERROR: Name `x` not found. + // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+3]]:3: error: name `x` not found // CHECK:STDERR: x; // CHECK:STDERR: ^ x; diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 9442fb697e782..27a1e1738803e 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -18,28 +18,28 @@ var test_i64: i64; // --- fail_iN_bad_width.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Name `i0` not found. +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: error: name `i0` not found // CHECK:STDERR: var test_i0: i0; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_i0: i0; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Bit width of integer type literal must be a multiple of 8. Use `Core.Int(1)` instead. +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: error: bit width of integer type literal must be a multiple of 8; use `Core.Int(1)` instead // CHECK:STDERR: var test_i1: i1; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_i1: i1; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:15: ERROR: Bit width of integer type literal must be a multiple of 8. Use `Core.Int(15)` instead. +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:15: error: bit width of integer type literal must be a multiple of 8; use `Core.Int(15)` instead // CHECK:STDERR: var test_i15: i15; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_i15: i15; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:23: ERROR: Integer type width of 1000000000 is greater than the maximum supported width of 8388608. +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:23: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 // CHECK:STDERR: var test_i1000000000: i1000000000; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: var test_i1000000000: i1000000000; // TODO: This diagnostic is not very good. -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:33: ERROR: Integer literal with value 10000000000000000000 does not fit in i32. +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:33: error: integer literal with value 10000000000000000000 does not fit in i32 // CHECK:STDERR: var test_i10000000000000000000: i10000000000000000000; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -55,28 +55,28 @@ var test_u64: u64; // --- fail_uN_bad_width.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Name `u0` not found. +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: error: name `u0` not found // CHECK:STDERR: var test_u0: u0; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_u0: u0; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Bit width of integer type literal must be a multiple of 8. Use `Core.UInt(1)` instead. +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: error: bit width of integer type literal must be a multiple of 8; use `Core.UInt(1)` instead // CHECK:STDERR: var test_u1: u1; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_u1: u1; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:15: ERROR: Bit width of integer type literal must be a multiple of 8. Use `Core.UInt(15)` instead. +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:15: error: bit width of integer type literal must be a multiple of 8; use `Core.UInt(15)` instead // CHECK:STDERR: var test_u15: u15; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_u15: u15; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:23: ERROR: Integer type width of 1000000000 is greater than the maximum supported width of 8388608. +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:23: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 // CHECK:STDERR: var test_u1000000000: u1000000000; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: var test_u1000000000: u1000000000; // TODO: This diagnostic is not very good. -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:33: ERROR: Integer literal with value 10000000000000000000 does not fit in i32. +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:33: error: integer literal with value 10000000000000000000 does not fit in i32 // CHECK:STDERR: var test_u10000000000000000000: u10000000000000000000; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -85,12 +85,12 @@ var test_u10000000000000000000: u10000000000000000000; // --- fail_fN_bad_width.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Name `f0` not found. +// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: error: name `f0` not found // CHECK:STDERR: var test_f0: f0; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_f0: f0; -// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: ERROR: Semantics TODO: `Currently only f64 is allowed`. +// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: error: semantics TODO: `Currently only f64 is allowed` // CHECK:STDERR: var test_f1: f1; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -104,7 +104,7 @@ var test_f1000000000000: f1000000000000; library "[[@TEST_NAME]]"; // TODO: Some or all of these should eventually work. -// CHECK:STDERR: fail_fN_todo_unsupported.carbon:[[@LINE+3]]:15: ERROR: Semantics TODO: `Currently only f64 is allowed`. +// CHECK:STDERR: fail_fN_todo_unsupported.carbon:[[@LINE+3]]:15: error: semantics TODO: `Currently only f64 is allowed` // CHECK:STDERR: var test_f16: f16; // CHECK:STDERR: ^~~ var test_f16: f16; diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index 7853e6d9bea27..1651d5eb3355c 100644 --- a/toolchain/check/testdata/builtins/float/add.carbon +++ b/toolchain/check/testdata/builtins/float/add.carbon @@ -22,17 +22,17 @@ var x: f64 = Add(2.2, 2.3); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.add". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.add" // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.add"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.add"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.add". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.add" // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.add"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.add"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: ERROR: Invalid signature for builtin function "float.add". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.add" // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.add"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn BadReturnType(a: f64, b: f64) -> bool = "float.add"; diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index a7f1a897857ae..830c2c9ce7d76 100644 --- a/toolchain/check/testdata/builtins/float/div.carbon +++ b/toolchain/check/testdata/builtins/float/div.carbon @@ -24,17 +24,17 @@ let c: f64 = Div(0.0, 0.0); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.div". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.div"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.div"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.div". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: ERROR: Invalid signature for builtin function "float.div". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.div" // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.div"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn BadReturnType(a: f64, b: f64) -> bool = "float.div"; diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index be57cdec19872..c9bee6442ea57 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -28,7 +28,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: ERROR: Invalid signature for builtin function "float.eq". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.eq" // CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index e03029056c989..afcc3fc0a6a49 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -32,14 +32,14 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+4]]:20: ERROR: Bit width must be 64. +// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+4]]:20: error: bit width must be 64 // CHECK:STDERR: var invalid_float: Float(32); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: var invalid_float: Float(32); var dyn_size: i32 = 64; -// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+3]]:10: ERROR: Cannot evaluate type expression. +// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression // CHECK:STDERR: var dyn: Float(dyn_size); // CHECK:STDERR: ^~~~~~~~~~~~~~~ var dyn: Float(dyn_size); diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index d36cf7f2cd985..d3cb45ee31dd9 100644 --- a/toolchain/check/testdata/builtins/float/mul.carbon +++ b/toolchain/check/testdata/builtins/float/mul.carbon @@ -22,17 +22,17 @@ var x: f64 = Mul(2.0, 0.5); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.mul". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.mul"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.mul"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.mul". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: ERROR: Invalid signature for builtin function "float.mul". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.mul" // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.mul"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn BadReturnType(a: f64, b: f64) -> bool = "float.mul"; diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 39f316fb2c39c..29dcb5eb5c772 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -22,17 +22,17 @@ let a: f64 = Negate(1.5); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.negate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" // CHECK:STDERR: fn TooFew() -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew() -> f64 = "float.negate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.negate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.negate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" // CHECK:STDERR: fn BadReturnType(a: f64) -> bool = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -40,10 +40,10 @@ fn BadReturnType(a: f64) -> bool = "float.negate"; fn JustRight(a: f64) -> f64 = "float.negate"; fn RuntimeCallTooFew(a: f64) -> f64 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: ERROR: 1 argument(s) passed to function expecting 0 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-17]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-17]]:1: calling function declared here // CHECK:STDERR: fn TooFew() -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -51,10 +51,10 @@ fn RuntimeCallTooFew(a: f64) -> f64 { } fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: ERROR: 3 argument(s) passed to function expecting 2 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-23]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-23]]:1: calling function declared here // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -62,10 +62,10 @@ fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { } fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: ERROR: 2 argument(s) passed to function expecting 1 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-29]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-29]]:1: calling function declared here // CHECK:STDERR: fn BadReturnType(a: f64) -> bool = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return BadReturnType(a, b); diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index c242b7f458cab..6ba9f1c068f6a 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -28,7 +28,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: ERROR: Invalid signature for builtin function "float.neq". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.neq" // CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index 18bfced36cc3b..c8889225a2b0e 100644 --- a/toolchain/check/testdata/builtins/float/sub.carbon +++ b/toolchain/check/testdata/builtins/float/sub.carbon @@ -22,17 +22,17 @@ var x: f64 = Sub(2.0, 0.5); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.sub". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.sub"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.sub"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "float.sub". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: ERROR: Invalid signature for builtin function "float.sub". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.sub" // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.sub"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn BadReturnType(a: f64, b: f64) -> bool = "float.sub"; diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index fa72169032c12..1a7a11974eb54 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -28,7 +28,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: ERROR: Invalid signature for builtin function "int.eq". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "int.eq" // CHECK:STDERR: fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index d64afa18b016f..036c8e062fd17 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -30,12 +30,12 @@ fn Negate(a: i32) -> i32 = "int.snegate"; // Shift greater than size is disallowed. let size_1: i32 = LeftShift(1, 31); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: ERROR: Shift distance not in range [0, 32) in 1 << 32. +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error: shift distance not in range [0, 32) in 1 << 32 // CHECK:STDERR: let size_2: i32 = LeftShift(1, 32); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: let size_2: i32 = LeftShift(1, 32); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: ERROR: Shift distance not in range [0, 32) in 1 << 33. +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error: shift distance not in range [0, 32) in 1 << 33 // CHECK:STDERR: let size_3: i32 = LeftShift(1, 33); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -43,7 +43,7 @@ let size_3: i32 = LeftShift(1, 33); // Overflow is allowed if the shift distance is in bounds. let overflow_1: i32 = LeftShift(1000, 31); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:23: ERROR: Shift distance not in range [0, 32) in 1000 << 32. +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:23: error: shift distance not in range [0, 32) in 1000 << 32 // CHECK:STDERR: let overflow_2: i32 = LeftShift(1000, 32); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -51,14 +51,14 @@ let overflow_2: i32 = LeftShift(1000, 32); // Oversize shifts aren't allowed even if there's no overflow. let no_overflow_1: i32 = LeftShift(0, 31); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:26: ERROR: Shift distance not in range [0, 32) in 0 << 32. +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:26: error: shift distance not in range [0, 32) in 0 << 32 // CHECK:STDERR: let no_overflow_2: i32 = LeftShift(0, 32); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: let no_overflow_2: i32 = LeftShift(0, 32); // Negative shifts aren't allowed either. -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:21: ERROR: Shift distance not in range [0, 32) in 1 << -1. +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:21: error: shift distance not in range [0, 32) in 1 << -1 // CHECK:STDERR: let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDERR: ^~~~~~~~~~ let negative: i32 = LeftShift(1, Negate(1)); diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 10f63efd2729f..8de12f2776222 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -38,7 +38,7 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_zero_size.carbon:[[@LINE+4]]:8: ERROR: Integer type width of 0 is not positive. +// CHECK:STDERR: fail_zero_size.carbon:[[@LINE+4]]:8: error: integer type width of 0 is not positive // CHECK:STDERR: var n: Int(0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ import library "types"; fn Negate(n: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: ERROR: Integer type width of -1 is not positive. +// CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: error: integer type width of -1 is not positive // CHECK:STDERR: var n: Int(Negate(1)); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -64,7 +64,7 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: ERROR: Integer type width of 1000000000 is greater than the maximum supported width of 8388608. +// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 // CHECK:STDERR: var m: Int(1000000000); // CHECK:STDERR: ^~~~ var m: Int(1000000000); diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index c25127819dfb6..c03c9536c5bc4 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -38,7 +38,7 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_zero_size.carbon:[[@LINE+4]]:8: ERROR: Integer type width of 0 is not positive. +// CHECK:STDERR: fail_zero_size.carbon:[[@LINE+4]]:8: error: integer type width of 0 is not positive // CHECK:STDERR: var n: UInt(0); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ import library "types"; fn Negate(n: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: ERROR: Integer type width of -1 is not positive. +// CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: error: integer type width of -1 is not positive // CHECK:STDERR: var n: UInt(Negate(1)); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -64,7 +64,7 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: ERROR: Integer type width of 1000000000 is greater than the maximum supported width of 8388608. +// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 // CHECK:STDERR: var m: UInt(1000000000); // CHECK:STDERR: ^~~~~ var m: UInt(1000000000); diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 5af956319ccf0..5c5432de29c2b 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -47,19 +47,19 @@ fn Negate(a: i32) -> i32 = "int.snegate"; // Shift greater than size is disallowed. let size_1: i32 = RightShift(1, 31); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: ERROR: Shift distance not in range [0, 32) in 1 >> 32. +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error: shift distance not in range [0, 32) in 1 >> 32 // CHECK:STDERR: let size_2: i32 = RightShift(1, 32); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: let size_2: i32 = RightShift(1, 32); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: ERROR: Shift distance not in range [0, 32) in 1 >> 33. +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error: shift distance not in range [0, 32) in 1 >> 33 // CHECK:STDERR: let size_3: i32 = RightShift(1, 33); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: let size_3: i32 = RightShift(1, 33); // Negative shifts aren't allowed either. -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:21: ERROR: Shift distance not in range [0, 32) in 1 >> -1. +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:21: error: shift distance not in range [0, 32) in 1 >> -1 // CHECK:STDERR: let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDERR: ^~~~~~~~~~~ let negative: i32 = RightShift(1, Negate(1)); diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 6847786f5b9d7..319e98b307bdd 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -23,43 +23,43 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.sadd". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.sadd". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.sadd". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.sadd"; fn JustRight(a: i32, b: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error: array bound is not a constant // CHECK:STDERR: var too_few: [i32; TooFew(1)]; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var too_few: [i32; TooFew(1)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error: array bound is not a constant // CHECK:STDERR: var too_many: [i32; TooMany(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var too_many: [i32; TooMany(1, 2, 3)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error: array bound is not a constant // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: ERROR: 3 argument(s) passed to function expecting 2 argument(s). +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: Calling function declared here. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: calling function declared here // CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -84,7 +84,7 @@ package FailOverflow; fn Add(a: i32, b: i32) -> i32 = "int.sadd"; let a: i32 = Add(0x7FFFFFFF, 0); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: ERROR: Integer overflow in calculation 2147483647 + 1. +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation 2147483647 + 1 // CHECK:STDERR: let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDERR: ^~~~ let b: i32 = Add(0x7FFFFFFF, 1); diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index f4f8f018ff7ef..381fca524640c 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -34,7 +34,7 @@ let a: i32 = Div(Negate(0x7FFF_FFFF), Negate(1)); let b: i32 = Div(Sub(Negate(0x7FFF_FFFF), 1), 1); // -0x8000_0000 / -1 overflows. -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: ERROR: Integer overflow in calculation -2147483648 / -1. +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error: integer overflow in calculation -2147483648 / -1 // CHECK:STDERR: let c: i32 = Div(Sub(Negate(0x7FFF_FFFF), 1), Negate(1)); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -46,13 +46,13 @@ package FailDivByZero; fn Div(a: i32, b: i32) -> i32 = "int.sdiv"; -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: ERROR: Division by zero. +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero // CHECK:STDERR: let a: i32 = Div(1, 0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: let a: i32 = Div(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: ERROR: Division by zero. +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero // CHECK:STDERR: let b: i32 = Div(0, 0); // CHECK:STDERR: ^~~~ let b: i32 = Div(0, 0); diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index a34a0618c8bf4..269c7341ed982 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -35,7 +35,7 @@ let b: i32 = Mod(Sub(Negate(0x7FFF_FFFF), 1), 1); // -0x8000_0000 / -1 overflows, so -0x8000_0000 % -1 is disallowed, even though // its result is representable. -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: ERROR: Integer overflow in calculation -2147483648 % -1. +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error: integer overflow in calculation -2147483648 % -1 // CHECK:STDERR: let c: i32 = Mod(Sub(Negate(0x7FFF_FFFF), 1), Negate(1)); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -49,13 +49,13 @@ fn Mod(a: i32, b: i32) -> i32 = "int.smod"; // Remainder of division by zero is not defined. -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: ERROR: Division by zero. +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero // CHECK:STDERR: let a: i32 = Mod(1, 0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: let a: i32 = Mod(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: ERROR: Division by zero. +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero // CHECK:STDERR: let b: i32 = Mod(0, 0); // CHECK:STDERR: ^~~~ let b: i32 = Mod(0, 0); diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 6ce2d5f6d867f..67904722720f9 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -26,7 +26,7 @@ package FailOverflow; fn Mul(a: i32, b: i32) -> i32 = "int.smul"; let a: i32 = Mul(0x7FFF, 0x10000); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: ERROR: Integer overflow in calculation 32768 * 65536. +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation 32768 * 65536 // CHECK:STDERR: let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDERR: ^~~~ let b: i32 = Mul(0x8000, 0x10000); diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index 89bbc9e4fdfe9..9b58a5843c9be 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -25,53 +25,53 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.snegate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.snegate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.snegate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate"; fn JustRight(a: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error: array bound is not a constant // CHECK:STDERR: var too_few: [i32; TooFew()]; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var too_few: [i32; TooFew()]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error: array bound is not a constant // CHECK:STDERR: var too_many: [i32; TooMany(1, 2)]; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var too_many: [i32; TooMany(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error: array bound is not a constant // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1)]; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: ERROR: 2 argument(s) passed to function expecting 1 argument(s). +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: Calling function declared here. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: calling function declared here // CHECK:STDERR: fn JustRight(a: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; fn RuntimeCallTooFew(a: i32) -> i32 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: ERROR: 1 argument(s) passed to function expecting 0 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: calling function declared here // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -79,10 +79,10 @@ fn RuntimeCallTooFew(a: i32) -> i32 { } fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: ERROR: 3 argument(s) passed to function expecting 2 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: calling function declared here // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -90,10 +90,10 @@ fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { } fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: ERROR: 2 argument(s) passed to function expecting 1 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: calling function declared here // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -111,7 +111,7 @@ fn Sub(a: i32, b: i32) -> i32 = "int.ssub"; let a: i32 = Negate(Negate(0x7FFFFFFF)); // -(-INT_MAX - 1) is too large for i32. -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: ERROR: Integer overflow in negation of -2147483648. +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in negation of -2147483648 // CHECK:STDERR: let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDERR: ^~~~~~~ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index 4baf7878e216c..1bea35887db1a 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -27,7 +27,7 @@ fn Sub(a: i32, b: i32) -> i32 = "int.ssub"; let a: i32 = Sub(0, 0x7FFFFFFF); let b: i32 = Sub(Sub(0, 0x7FFFFFFF), 1); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: ERROR: Integer overflow in calculation -2147483647 - 2. +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation -2147483647 - 2 // CHECK:STDERR: let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDERR: ^~~~ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index 0a689c42352ba..fd365e59d9e4f 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -23,43 +23,43 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.uadd". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.uadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.uadd". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.uadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.uadd". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.uadd"; fn JustRight(a: i32, b: i32) -> i32 = "int.uadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error: array bound is not a constant // CHECK:STDERR: var too_few: [i32; TooFew(1)]; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var too_few: [i32; TooFew(1)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error: array bound is not a constant // CHECK:STDERR: var too_many: [i32; TooMany(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var too_many: [i32; TooMany(1, 2, 3)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error: array bound is not a constant // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:21: ERROR: 3 argument(s) passed to function expecting 2 argument(s). +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:21: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: Calling function declared here. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: calling function declared here // CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var bad_call: [i32; JustRight(1, 2, 3)]; diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 5e8468e86ff23..d2cbf673a1873 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -42,13 +42,13 @@ package FailDivByZero; fn Div(a: i32, b: i32) -> i32 = "int.udiv"; -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: ERROR: Division by zero. +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero // CHECK:STDERR: let a: i32 = Div(1, 0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: let a: i32 = Div(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: ERROR: Division by zero. +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero // CHECK:STDERR: let b: i32 = Div(0, 0); // CHECK:STDERR: ^~~~ let b: i32 = Div(0, 0); diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 49e61afb58fc2..70c79bde287c5 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -44,13 +44,13 @@ fn Mod(a: i32, b: i32) -> i32 = "int.umod"; // Remainder of division by zero is not defined. -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: ERROR: Division by zero. +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero // CHECK:STDERR: let a: i32 = Mod(1, 0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: let a: i32 = Mod(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: ERROR: Division by zero. +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero // CHECK:STDERR: let b: i32 = Mod(0, 0); // CHECK:STDERR: ^~~~ let b: i32 = Mod(0, 0); diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index fe1f46014892b..290dde45c9036 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -25,53 +25,53 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.unegate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" // CHECK:STDERR: fn TooFew() -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew() -> i32 = "int.unegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.unegate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.unegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: ERROR: Invalid signature for builtin function "int.unegate". +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.unegate"; fn JustRight(a: i32) -> i32 = "int.unegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error: array bound is not a constant // CHECK:STDERR: var too_few: [i32; TooFew()]; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var too_few: [i32; TooFew()]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error: array bound is not a constant // CHECK:STDERR: var too_many: [i32; TooMany(1, 2)]; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var too_many: [i32; TooMany(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error: array bound is not a constant // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1)]; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: ERROR: 2 argument(s) passed to function expecting 1 argument(s). +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: Calling function declared here. +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: calling function declared here // CHECK:STDERR: fn JustRight(a: i32) -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; fn RuntimeCallTooFew(a: i32) -> i32 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: ERROR: 1 argument(s) passed to function expecting 0 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: calling function declared here // CHECK:STDERR: fn TooFew() -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -79,10 +79,10 @@ fn RuntimeCallTooFew(a: i32) -> i32 { } fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: ERROR: 3 argument(s) passed to function expecting 2 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: calling function declared here // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -90,10 +90,10 @@ fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { } fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: ERROR: 2 argument(s) passed to function expecting 1 argument(s). + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: Calling function declared here. + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: calling function declared here // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return BadReturnType(a, b); diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 76895b6e424a8..8335269b67a0b 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -27,35 +27,35 @@ class Circle { fn Run() { let circle: Circle = Circle.Make(); - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:21: ERROR: Cannot access private member `radius` of type `Circle`. + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:21: error: cannot access private member `radius` of type `Circle` // CHECK:STDERR: let radius: i32 = circle.radius; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-17]]:15: The private member `radius` is defined here. + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-17]]:15: the private member `radius` is defined here // CHECK:STDERR: private var radius: i32; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: let radius: i32 = circle.radius; - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: ERROR: Cannot access private member `radius` of type `Circle`. + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `radius` of type `Circle` // CHECK:STDERR: circle.radius = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-25]]:15: The private member `radius` is defined here. + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-25]]:15: the private member `radius` is defined here // CHECK:STDERR: private var radius: i32; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: circle.radius = 5; - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: ERROR: Cannot access private member `SOME_INTERNAL_CONSTANT` of type `Circle`. + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `SOME_INTERNAL_CONSTANT` of type `Circle` // CHECK:STDERR: circle.SOME_INTERNAL_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-32]]:15: The private member `SOME_INTERNAL_CONSTANT` is defined here. + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-32]]:15: the private member `SOME_INTERNAL_CONSTANT` is defined here // CHECK:STDERR: private let SOME_INTERNAL_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: circle.SOME_INTERNAL_CONSTANT; - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: ERROR: Cannot access private member `SomeInternalFunction` of type `Circle`. + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `SomeInternalFunction` of type `Circle` // CHECK:STDERR: circle.SomeInternalFunction(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-39]]:3: The private member `SomeInternalFunction` is defined here. + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-39]]:3: the private member `SomeInternalFunction` is defined here // CHECK:STDERR: private fn SomeInternalFunction() -> i32 { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -71,10 +71,10 @@ class A { } fn Run() { - // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE+7]]:16: ERROR: Cannot access protected member `x` of type `A`. + // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE+7]]:16: error: cannot access protected member `x` of type `A` // CHECK:STDERR: let x: i32 = A.x; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE-7]]:17: The protected member `x` is defined here. + // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE-7]]:17: the protected member `x` is defined here // CHECK:STDERR: protected var x: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -120,18 +120,18 @@ class A { private let y: i32 = 5; } -// CHECK:STDERR: fail_global_access.carbon:[[@LINE+7]]:14: ERROR: Cannot access protected member `x` of type `A`. +// CHECK:STDERR: fail_global_access.carbon:[[@LINE+7]]:14: error: cannot access protected member `x` of type `A` // CHECK:STDERR: let x: i32 = A.x; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_global_access.carbon:[[@LINE-7]]:17: The protected member `x` is defined here. +// CHECK:STDERR: fail_global_access.carbon:[[@LINE-7]]:17: the protected member `x` is defined here // CHECK:STDERR: protected let x: i32 = 5; // CHECK:STDERR: ^ // CHECK:STDERR: let x: i32 = A.x; -// CHECK:STDERR: fail_global_access.carbon:[[@LINE+6]]:14: ERROR: Cannot access private member `y` of type `A`. +// CHECK:STDERR: fail_global_access.carbon:[[@LINE+6]]:14: error: cannot access private member `y` of type `A` // CHECK:STDERR: let y: i32 = A.y; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_global_access.carbon:[[@LINE-14]]:15: The private member `y` is defined here. +// CHECK:STDERR: fail_global_access.carbon:[[@LINE-14]]:15: the private member `y` is defined here // CHECK:STDERR: private let y: i32 = 5; // CHECK:STDERR: ^ let y: i32 = A.y; diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index e1947841ebbc6..ac11debbec061 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -39,7 +39,7 @@ class AdaptNotExtend { fn F(a: AdaptNotExtend) { // `Adapted` is not extended, so lookup for `F` finds nothing. - // CHECK:STDERR: fail_not_extend.carbon:[[@LINE+3]]:3: ERROR: Name `F` not found. + // CHECK:STDERR: fail_not_extend.carbon:[[@LINE+3]]:3: error: name `F` not found // CHECK:STDERR: a.F(); // CHECK:STDERR: ^~~ a.F(); diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index a4079d9c7d32e..7a3cdf4005a47 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -48,13 +48,13 @@ library "[[@TEST_NAME]]"; import Other library "other_extern"; -// CHECK:STDERR: fail_extern.carbon:[[@LINE+10]]:8: ERROR: Variable has incomplete type `C`. +// CHECK:STDERR: fail_extern.carbon:[[@LINE+10]]:8: error: Variable has incomplete type `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_extern.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import Other library "other_extern"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_extern.carbon:4:1: Class was forward declared here. +// CHECK:STDERR: other_extern.carbon:4:1: class was forward declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,22 +64,22 @@ var c: Other.C = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import Other library "other_define"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_extern.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: other_extern.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import Other library "other_define"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_define.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: other_define.carbon:4:1: name is previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ import Other library "other_define"; import Other library "other_extern"; -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:8: In name lookup for `C`. +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:8: in name lookup for `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -89,22 +89,22 @@ var c: Other.C = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import Other library "other_define"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_conflict.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: other_conflict.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import Other library "other_define"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_define.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: other_define.carbon:4:1: name is previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ import Other library "other_define"; import Other library "other_conflict"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:8: In name lookup for `C`. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:8: in name lookup for `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ var c: Other.C = {}; diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index bfd62196c0698..8e55422228252 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -48,13 +48,13 @@ class SomeClassAdapter { } fn F(a: SomeClassAdapter) { - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: ERROR: Cannot implicitly convert from `SomeClassAdapter` to `SomeClass`. + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` // CHECK:STDERR: a.F(); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: Type `SomeClassAdapter` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: type `SomeClassAdapter` does not implement interface `ImplicitAs` // CHECK:STDERR: a.F(); // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: Initializing `self` parameter of method declared here. + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: initializing `self` parameter of method declared here // CHECK:STDERR: fn F[self: Self](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -75,10 +75,10 @@ class SomeClassAdapter { } fn F(a: SomeClassAdapter) -> i32 { - // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+7]]:10: ERROR: Cannot implicitly convert from `SomeClassAdapter` to `SomeClass`. + // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: Type `SomeClassAdapter` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: type `SomeClassAdapter` does not implement interface `ImplicitAs` // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ fn F(a: SomeClassAdapter) -> i32 { library "[[@TEST_NAME]]"; class StructAdapter { - // CHECK:STDERR: fail_todo_adapt_non_class.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `extending non-class type`. + // CHECK:STDERR: fail_todo_adapt_non_class.carbon:[[@LINE+3]]:3: error: semantics TODO: `extending non-class type` // CHECK:STDERR: extend adapt {.a: i32, .b: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extend adapt {.a: i32, .b: i32}; diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index c4ba94f9e2738..0d7a5557d6b91 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -20,7 +20,7 @@ class Derived { fn Make() -> Derived { // TODO: This should be valid, and should construct an instance of `partial Abstract` as the base. - // CHECK:STDERR: fail_abstract.carbon:[[@LINE+3]]:19: ERROR: Cannot construct instance of abstract class. Consider using `partial Abstract` instead. + // CHECK:STDERR: fail_abstract.carbon:[[@LINE+3]]:19: error: cannot construct instance of abstract class; consider using `partial Abstract` instead // CHECK:STDERR: return {.base = {.a = 1}, .d = 7}; // CHECK:STDERR: ^~~~~~~~ return {.base = {.a = 1}, .d = 7}; diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index ed109914262a6..cf58f8dbbb944 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -13,17 +13,17 @@ library "[[@TEST_NAME]]"; class Bad { - // CHECK:STDERR: fail_not_type.carbon:[[@LINE+7]]:3: ERROR: Cannot implicitly convert from `i32` to `type`. + // CHECK:STDERR: fail_not_type.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: adapt 100; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:3: Type `i32` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:3: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: adapt 100; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: adapt 100; } -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:18: ERROR: Name `F` not found. +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:18: error: name `F` not found // CHECK:STDERR: fn Use(b: Bad) { b.F(); } // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -34,10 +34,10 @@ fn Use(b: Bad) { b.F(); } library "[[@TEST_NAME]]"; class Bad { - // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+7]]:3: ERROR: Cannot implicitly convert from `i32` to `type`. + // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: extend adapt 100; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+4]]:3: Type `i32` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+4]]:3: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: extend adapt 100; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -53,7 +53,7 @@ library "[[@TEST_NAME]]"; class MultipleAdapts { adapt (); - // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: ERROR: Multiple `adapt` declarations in class. + // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: Multiple `adapt` declarations in class. // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: Previous `adapt` declaration is here. @@ -65,7 +65,7 @@ class MultipleAdapts { class MultipleAdaptsSameType { adapt (); - // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: ERROR: Multiple `adapt` declarations in class. + // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: Multiple `adapt` declarations in class. // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: Previous `adapt` declaration is here. @@ -79,14 +79,14 @@ class MultipleAdaptsSameType { library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:1: ERROR: `adapt` declaration can only be used in a class. +// CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:1: error: `adapt` declaration can only be used in a class. // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: adapt {}; interface I { - // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:3: ERROR: `adapt` declaration can only be used in a class. + // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:3: error: `adapt` declaration can only be used in a class. // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -95,7 +95,7 @@ interface I { class C { interface I { - // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+3]]:5: ERROR: `adapt` declaration can only be used in a class. + // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+3]]:5: error: `adapt` declaration can only be used in a class. // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ adapt {}; diff --git a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon index 81667f95e9347..80da74081e279 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon @@ -15,10 +15,10 @@ library "[[@TEST_NAME]]"; class Incomplete; class AdaptIncomplete { - // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:3: ERROR: Adapted type `Incomplete` is an incomplete type. + // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:3: error: Adapted type `Incomplete` is an incomplete type. // CHECK:STDERR: adapt Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-6]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-6]]:1: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ adapt Incomplete; diff --git a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon index 02d0fd120c06b..1082b84032674 100644 --- a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon @@ -11,7 +11,7 @@ class B {} class C1 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: ERROR: `private` not allowed on `adapt` declaration. + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error: `private` not allowed on `adapt` declaration // CHECK:STDERR: private adapt B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -19,7 +19,7 @@ class C1 { } class C2 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: ERROR: `abstract` not allowed on `adapt` declaration. + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error: `abstract` not allowed on `adapt` declaration // CHECK:STDERR: abstract adapt B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -27,7 +27,7 @@ class C2 { } class C3 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: ERROR: `default` not allowed on `adapt` declaration. + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed on `adapt` declaration // CHECK:STDERR: default adapt B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -35,10 +35,10 @@ class C3 { } class C4 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+7]]:10: ERROR: `extend` repeated on declaration. + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+7]]:10: error: `extend` repeated on declaration // CHECK:STDERR: extend extend adapt B; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: `extend` previously appeared here. + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: `extend` previously appeared here // CHECK:STDERR: extend extend adapt B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -46,10 +46,10 @@ class C4 { } class C5 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+6]]:10: ERROR: `base` not allowed on declaration with `extend`. + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+6]]:10: error: `base` not allowed on declaration with `extend` // CHECK:STDERR: extend base adapt B; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+3]]:3: `extend` previously appeared here. + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+3]]:3: `extend` previously appeared here // CHECK:STDERR: extend base adapt B; // CHECK:STDERR: ^~~~~~ extend base adapt B; diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index c8bc3ccefecb5..b00025a1949a4 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; base class Base {} class AdaptWithBase { - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+3]]:3: ERROR: Adapter cannot have a base class. + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+3]]:3: error: Adapter cannot have a base class. // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; @@ -31,7 +31,7 @@ class AdaptWithBase { library "[[@TEST_NAME]]"; class AdaptWithField { - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: ERROR: Adapter cannot have fields. + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error: Adapter cannot have fields. // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; @@ -43,7 +43,7 @@ class AdaptWithField { } class AdaptWithFields { - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: ERROR: Adapter cannot have fields. + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error: Adapter cannot have fields. // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; @@ -65,7 +65,7 @@ base class Base {} class AdaptWithBaseAndFields { extend base: Base; var n: i32; - // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+6]]:3: ERROR: Adapter cannot have a base class. + // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+6]]:3: error: Adapter cannot have a base class. // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE-5]]:3: `base` declaration is here. diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index 3163ab640b910..c2b1fdfd504b4 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_addr_not_self.carbon class Class { - // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+4]]:8: ERROR: `addr` can only be applied to a `self` parameter. + // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+4]]:8: error: `addr` can only be applied to a `self` parameter // CHECK:STDERR: fn F[addr a: Class*](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: fn F[addr a: Class*](); - // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+3]]:8: ERROR: `addr` can only be applied to a `self` parameter. + // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+3]]:8: error: `addr` can only be applied to a `self` parameter // CHECK:STDERR: fn G(addr b: Class*); // CHECK:STDERR: ^~~~ fn G(addr b: Class*); diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index 2b68e65e27748..fcb0575c4f62d 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -14,19 +14,19 @@ class Class { } fn F(c: Class, p: Class*) { - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:6: ERROR: `addr self` method cannot be invoked on a value. + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:6: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: c.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-8]]:13: Initializing `addr self` parameter of method declared here. + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-8]]:13: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: Class*](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: c.F(); - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:6: ERROR: `addr self` method cannot be invoked on a value. + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+7]]:6: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: c.G(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-16]]:13: Initializing `addr self` parameter of method declared here. + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-16]]:13: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn G[addr self: Class](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -35,13 +35,13 @@ fn F(c: Class, p: Class*) { // This call is OK. (*p).F(); - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+9]]:3: ERROR: Cannot implicitly convert from `Class*` to `Class`. + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `Class*` to `Class` // CHECK:STDERR: (*p).G(); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: Type `Class*` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: type `Class*` does not implement interface `ImplicitAs` // CHECK:STDERR: (*p).G(); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-31]]:13: Initializing `addr self` parameter of method declared here. + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-31]]:13: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn G[addr self: Class](); // CHECK:STDERR: ^~~~ (*p).G(); diff --git a/toolchain/check/testdata/class/fail_base_as_declared_name.carbon b/toolchain/check/testdata/class/fail_base_as_declared_name.carbon index d81edeffcdd5b..297a51e054023 100644 --- a/toolchain/check/testdata/class/fail_base_as_declared_name.carbon +++ b/toolchain/check/testdata/class/fail_base_as_declared_name.carbon @@ -10,11 +10,11 @@ namespace N; -// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+7]]:6: ERROR: `.` should be followed by a name. +// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+7]]:6: error: `.` should be followed by a name // CHECK:STDERR: fn N.base() {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+3]]:6: ERROR: Semantics TODO: `HandleInvalidParse`. +// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+3]]:6: error: semantics TODO: `HandleInvalidParse` // CHECK:STDERR: fn N.base() {} // CHECK:STDERR: ^~~~ fn N.base() {} diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 7dc931f9113ba..0836614919aa8 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -14,7 +14,7 @@ class Final { } class DeriveFromError { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: ERROR: Name `error` not found. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: name `error` not found // CHECK:STDERR: extend base: error; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -25,10 +25,10 @@ class DeriveFromError { fn AccessMemberWithInvalidBaseError(p: DeriveFromError*) -> i32 { return (*p).n; } class DeriveFromNonType { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:16: ERROR: Cannot implicitly convert from `i32` to `type`. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:16: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: extend base: 32; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: Type `i32` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: extend base: 32; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -38,7 +38,7 @@ class DeriveFromNonType { fn AccessMemberWithInvalidBasNonType(p: DeriveFromNonType*) -> i32 { return (*p).n; } class DeriveFromi32 { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: ERROR: Deriving from final type `i32`. Base type must be an `abstract` or `base` class. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: Deriving from final type `i32`. Base type must be an `abstract` or `base` class. // CHECK:STDERR: extend base: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -47,10 +47,10 @@ class DeriveFromi32 { // It's not really important whether this conversion produces an error or not, // but it shouldn't crash. -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:53: ERROR: Cannot implicitly convert from `DeriveFromi32*` to `i32*`. +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:53: error: cannot implicitly convert from `DeriveFromi32*` to `i32*` // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:53: Type `DeriveFromi32*` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:53: type `DeriveFromi32*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -59,17 +59,17 @@ fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } fn AccessMemberWithInvalidBasei32(p: DeriveFromi32*) -> i32 { return (*p).n; } class DeriveFromTuple { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: ERROR: Deriving from final type `(Base,)`. Base type must be an `abstract` or `base` class. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: Deriving from final type `(Base,)`. Base type must be an `abstract` or `base` class. // CHECK:STDERR: extend base: (Base,); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: extend base: (Base,); } -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:61: ERROR: Cannot implicitly convert from `DeriveFromTuple*` to `(Base,)*`. +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:61: error: cannot implicitly convert from `DeriveFromTuple*` to `(Base,)*` // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:61: Type `DeriveFromTuple*` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:61: type `DeriveFromTuple*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -80,17 +80,17 @@ fn AccessMemberWithInvalidBaseTuple(p: DeriveFromTuple*) -> i32 { return (*p).n; // TODO: Should we allow this? // We do allow `{.base = {.a: i32, .b: i32}}`. class DeriveFromStruct { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: ERROR: Deriving from final type `{.a: i32, .b: i32}`. Base type must be an `abstract` or `base` class. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: Deriving from final type `{.a: i32, .b: i32}`. Base type must be an `abstract` or `base` class. // CHECK:STDERR: extend base: {.a: i32, .b: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extend base: {.a: i32, .b: i32}; } -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:74: ERROR: Cannot implicitly convert from `DeriveFromStruct*` to `{.a: i32, .b: i32}*`. +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:74: error: cannot implicitly convert from `DeriveFromStruct*` to `{.a: i32, .b: i32}*` // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:74: Type `DeriveFromStruct*` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:74: type `DeriveFromStruct*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -102,20 +102,20 @@ fn AccessMemberWithInvalidBaseStruct(p: DeriveFromStruct*) -> i32 { return (*p). base class Incomplete; class DeriveFromIncomplete { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:16: ERROR: Base `Incomplete` is an incomplete type. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:16: error: Base `Incomplete` is an incomplete type. // CHECK:STDERR: extend base: Incomplete; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE-6]]:1: Class was forward declared here. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE-6]]:1: class was forward declared here // CHECK:STDERR: base class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extend base: Incomplete; } -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:74: ERROR: Cannot implicitly convert from `DeriveFromIncomplete*` to `Incomplete*`. +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:74: error: cannot implicitly convert from `DeriveFromIncomplete*` to `Incomplete*` // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:74: Type `DeriveFromIncomplete*` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:74: type `DeriveFromIncomplete*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -124,7 +124,7 @@ fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return fn AccessMemberWithInvalidBaseIncomplete(p: DeriveFromIncomplete*) -> i32 { return (*p).n; } class DeriveFromFinal { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: ERROR: Deriving from final type `Final`. Base type must be an `abstract` or `base` class. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: Deriving from final type `Final`. Base type must be an `abstract` or `base` class. // CHECK:STDERR: extend base: Final; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -141,7 +141,7 @@ fn AccessMemberWithInvalidBaseFinal_WithMember(p: DeriveFromFinal*) -> i32 { } fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+3]]:10: ERROR: Name `b` not found. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+3]]:10: error: name `b` not found // CHECK:STDERR: return (*p).b; // CHECK:STDERR: ^~~~~~ return (*p).b; diff --git a/toolchain/check/testdata/class/fail_base_method_define.carbon b/toolchain/check/testdata/class/fail_base_method_define.carbon index b44b03cc34ac0..5a46e0ec12dc5 100644 --- a/toolchain/check/testdata/class/fail_base_method_define.carbon +++ b/toolchain/check/testdata/class/fail_base_method_define.carbon @@ -20,13 +20,13 @@ class D { extend base: B; } -// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+4]]:6: ERROR: Out-of-line declaration requires a declaration in scoped entity. +// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+4]]:6: error: out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn D.F() {} // CHECK:STDERR: ^ // CHECK:STDERR: fn D.F() {} -// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+3]]:6: ERROR: Name `C` not found. +// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+3]]:6: error: name `C` not found // CHECK:STDERR: fn D.C.F() {} // CHECK:STDERR: ^ fn D.C.F() {} diff --git a/toolchain/check/testdata/class/fail_base_misplaced.carbon b/toolchain/check/testdata/class/fail_base_misplaced.carbon index 34b1107a7c855..9164de8aee8a0 100644 --- a/toolchain/check/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/check/testdata/class/fail_base_misplaced.carbon @@ -10,18 +10,18 @@ base class B {} -// CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+4]]:1: ERROR: `base` declaration can only be used in a class. +// CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+4]]:1: error: `base` declaration can only be used in a class. // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: extend base: B; fn F() { - // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+7]]:3: ERROR: Expected expression. + // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+7]]:3: error: expected expression // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `HandleInvalidParse`. + // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error: semantics TODO: `HandleInvalidParse` // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~ extend base: B; diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index 64025c787c7be..95ed651eb30c9 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -11,7 +11,7 @@ base class B {} class C1 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: ERROR: `private` not allowed on `base` declaration. + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: error: `private` not allowed on `base` declaration // CHECK:STDERR: private extend base: B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -19,11 +19,11 @@ class C1 { } class C2 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+8]]:3: ERROR: `abstract` not allowed on `base` declaration. + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+8]]:3: error: `abstract` not allowed on `base` declaration // CHECK:STDERR: abstract base: B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: ERROR: Missing `extend` before `base` declaration in class. + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: error: Missing `extend` before `base` declaration in class. // CHECK:STDERR: abstract base: B; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,10 +31,10 @@ class C2 { } class C3 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+7]]:10: ERROR: `default` not allowed on declaration with `extend`. + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+7]]:10: error: `default` not allowed on declaration with `extend` // CHECK:STDERR: extend default base: B; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: `extend` previously appeared here. + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: `extend` previously appeared here // CHECK:STDERR: extend default base: B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -42,10 +42,10 @@ class C3 { } class C4 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+6]]:10: ERROR: `extend` repeated on declaration. + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+6]]:10: error: `extend` repeated on declaration // CHECK:STDERR: extend extend base: B; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+3]]:3: `extend` previously appeared here. + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+3]]:3: `extend` previously appeared here // CHECK:STDERR: extend extend base: B; // CHECK:STDERR: ^~~~~~ extend extend base: B; diff --git a/toolchain/check/testdata/class/fail_base_no_extend.carbon b/toolchain/check/testdata/class/fail_base_no_extend.carbon index 0b6441fa741a7..00e25dc29a569 100644 --- a/toolchain/check/testdata/class/fail_base_no_extend.carbon +++ b/toolchain/check/testdata/class/fail_base_no_extend.carbon @@ -11,7 +11,7 @@ base class B {} class C { - // CHECK:STDERR: fail_base_no_extend.carbon:[[@LINE+3]]:3: ERROR: Missing `extend` before `base` declaration in class. + // CHECK:STDERR: fail_base_no_extend.carbon:[[@LINE+3]]:3: error: Missing `extend` before `base` declaration in class. // CHECK:STDERR: base: B; // CHECK:STDERR: ^~~~~~~~ base: B; diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index 8601b581ace82..9c1398e139b08 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -13,7 +13,7 @@ base class B2 {} class C { extend base: B1; - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+7]]:3: ERROR: Multiple `base` declarations in class. Multiple inheritance is not permitted. + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+7]]:3: error: Multiple `base` declarations in class. Multiple inheritance is not permitted. // CHECK:STDERR: extend base: B2; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: Previous `base` declaration is here. @@ -26,7 +26,7 @@ class C { class D { // TODO: Consider adding a custom diagnostic for this case. extend base: B1; - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+6]]:3: ERROR: Multiple `base` declarations in class. Multiple inheritance is not permitted. + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+6]]:3: error: Multiple `base` declarations in class. Multiple inheritance is not permitted. // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: Previous `base` declaration is here. diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index 329a6909dbff1..543e41f2d71ad 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -14,7 +14,7 @@ class C { extend base: B; } -// CHECK:STDERR: fail_base_unbound.carbon:[[@LINE+3]]:12: ERROR: Expression cannot be used as a value. +// CHECK:STDERR: fail_base_unbound.carbon:[[@LINE+3]]:12: error: expression cannot be used as a value // CHECK:STDERR: let b: B = C.base; // CHECK:STDERR: ^~~~~~ let b: B = C.base; diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 728dc4c650aa6..b9c3458e346df 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -17,10 +17,10 @@ class B { } fn AccessBInA(a: A) -> i32 { - // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+6]]:10: ERROR: Cannot implicitly convert from `A` to `B`. + // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `A` to `B` // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: Type `A` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: type `A` does not implement interface `ImplicitAs` // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ return a.(B.b); diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index f53f2c4827e12..dac1d7b420484 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_convert_to_invalid.carbon class C { - // CHECK:STDERR: fail_convert_to_invalid.carbon:[[@LINE+3]]:10: ERROR: Name `NoSuchType` not found. + // CHECK:STDERR: fail_convert_to_invalid.carbon:[[@LINE+3]]:10: error: name `NoSuchType` not found // CHECK:STDERR: var a: NoSuchType; // CHECK:STDERR: ^~~~~~~~~~ var a: NoSuchType; diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index a38cfd132afdc..67b042030b155 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -21,10 +21,10 @@ class B2 { var b: i32; } -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+7]]:38: ERROR: Cannot implicitly convert from `B2*` to `A1*`. +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+7]]:38: error: cannot implicitly convert from `B2*` to `A1*` // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: Type `B2*` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: type `B2*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -32,10 +32,10 @@ fn ConvertUnrelated(p: B2*) -> A1* { return p; } class Incomplete; -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+6]]:47: ERROR: Cannot implicitly convert from `Incomplete*` to `A2*`. +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+6]]:47: error: cannot implicitly convert from `Incomplete*` to `A2*` // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: Type `Incomplete*` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: type `Incomplete*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } diff --git a/toolchain/check/testdata/class/fail_extend_cycle.carbon b/toolchain/check/testdata/class/fail_extend_cycle.carbon index 0aff724330596..0148685b1a9fe 100644 --- a/toolchain/check/testdata/class/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/fail_extend_cycle.carbon @@ -16,16 +16,16 @@ base class B { extend base: A; } -// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+7]]:1: ERROR: Redefinition of `class A`. +// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+7]]:1: error: redefinition of `class A` // CHECK:STDERR: base class A { // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE-11]]:1: Previously defined here. +// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE-11]]:1: previously defined here // CHECK:STDERR: base class A { // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: base class A { extend base: A; - // CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+3]]:10: ERROR: Name `C` not found. + // CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+3]]:10: error: name `C` not found // CHECK:STDERR: var c: C; // CHECK:STDERR: ^ var c: C; diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index e8a148a1080a1..5e9718f407603 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -10,25 +10,25 @@ class Class { - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: ERROR: `default` not allowed on `var` declaration. + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed on `var` declaration // CHECK:STDERR: default var j: i32; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default var j: i32; - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: ERROR: `final` not allowed on `var` declaration. + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error: `final` not allowed on `var` declaration // CHECK:STDERR: final var k: i32; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: final var k: i32; - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: ERROR: `default` not allowed on `let` declaration outside of an interface. + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed on `let` declaration outside of an interface // CHECK:STDERR: default let l: i32 = 0; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default let l: i32 = 0; - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+3]]:3: ERROR: `final` not allowed on `let` declaration outside of an interface. + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+3]]:3: error: `final` not allowed on `let` declaration outside of an interface // CHECK:STDERR: final let m: i32 = 1; // CHECK:STDERR: ^~~~~ final let m: i32 = 1; diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 38c0b0592787f..e812ab2d108e9 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -15,18 +15,18 @@ class Class(T:! type) { // TODO: The follow-on errors here aren't great. Investigate whether we can // enter the scope anyway if the parameters don't match. -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+14]]:10: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+14]]:10: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: previous declaration's corresponding parameter here // CHECK:STDERR: class Class(T:! type) { // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+7]]:27: ERROR: Name `Self` not found. +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+7]]:27: error: name `Self` not found // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+3]]:36: ERROR: Name `T` not found. +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+3]]:36: error: name `T` not found // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^ fn Class(N:! i32).F[self: Self](n: T) {} diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index b0dec50e156ac..d3f94a20938b8 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -23,26 +23,26 @@ library "[[@TEST_NAME]]"; import library "a"; -// CHECK:STDERR: fail_b.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `class Empty` is redundant. +// CHECK:STDERR: fail_b.carbon:[[@LINE+10]]:1: error: redeclaration of `class Empty` is redundant // CHECK:STDERR: class Empty { // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "a"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: a.carbon:4:1: Previously declared here. +// CHECK:STDERR: a.carbon:4:1: previously declared here // CHECK:STDERR: class Empty { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: class Empty { } -// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:8: ERROR: Variable has incomplete type `Incomplete`. +// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:8: error: Variable has incomplete type `Incomplete` // CHECK:STDERR: var a: Incomplete; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_b.carbon:[[@LINE-18]]:1: In import. +// CHECK:STDERR: fail_b.carbon:[[@LINE-18]]:1: in import // CHECK:STDERR: import library "a"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: a.carbon:7:1: Class was forward declared here. +// CHECK:STDERR: a.carbon:7:1: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var a: Incomplete; diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 11981ae131688..5c8700d0da772 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -10,49 +10,49 @@ class Class; -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:4: ERROR: Cannot declare a member of incomplete class `Class`. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:4: error: cannot declare a member of incomplete class `Class` // CHECK:STDERR: fn Class.Function() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-5]]:1: Class was forward declared here. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-5]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fn Class.Function() {} fn CallClassFunction() { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:3: ERROR: Member access into incomplete class `Class`. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:3: error: member access into incomplete class `Class` // CHECK:STDERR: Class.Function(); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-15]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-15]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: Class.Function(); } -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:17: ERROR: Variable has incomplete type `Class`. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:17: error: Variable has incomplete type `Class` // CHECK:STDERR: var global_var: Class; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-25]]:1: Class was forward declared here. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-25]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: var global_var: Class; -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:24: ERROR: Function returns incomplete type `Class`. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:24: error: function returns incomplete type `Class` // CHECK:STDERR: fn ConvertFromStruct() -> Class { return {}; } // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-34]]:1: Class was forward declared here. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-34]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fn ConvertFromStruct() -> Class { return {}; } fn G(p: Class*) -> i32 { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: ERROR: Member access into object of incomplete type `Class`. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error: member access into object of incomplete type `Class` // CHECK:STDERR: return p->n; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-44]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-44]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -60,20 +60,20 @@ fn G(p: Class*) -> i32 { } fn MemberAccess(p: Class*) -> i32 { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:11: ERROR: Member access into object of incomplete type `Class`. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:11: error: member access into object of incomplete type `Class` // CHECK:STDERR: return (*p).n; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-55]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-55]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: return (*p).n; } -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:20: ERROR: Function returns incomplete type `Class`. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:20: error: function returns incomplete type `Class` // CHECK:STDERR: fn Copy(p: Class*) -> Class { // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-65]]:1: Class was forward declared here. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-65]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -82,10 +82,10 @@ fn Copy(p: Class*) -> Class { } fn Let(p: Class*) { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: ERROR: `let` binding has incomplete type `Class`. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error: `let` binding has incomplete type `Class` // CHECK:STDERR: let c: Class = *p; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-77]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-77]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -97,25 +97,25 @@ fn TakeIncomplete(c: Class); fn ReturnIncomplete() -> Class; fn CallTakeIncomplete(p: Class*) { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: ERROR: Forming value of incomplete type `Class`. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: error: forming value of incomplete type `Class` // CHECK:STDERR: TakeIncomplete(*p); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-92]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-92]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-11]]:1: Initializing parameter 1 of function declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-11]]:1: initializing parameter 1 of function declared here // CHECK:STDERR: fn TakeIncomplete(c: Class); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: TakeIncomplete(*p); - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: ERROR: Forming value of incomplete type `Class`. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: error: forming value of incomplete type `Class` // CHECK:STDERR: TakeIncomplete({}); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-104]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-104]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-23]]:1: Initializing parameter 1 of function declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-23]]:1: initializing parameter 1 of function declared here // CHECK:STDERR: fn TakeIncomplete(c: Class); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -123,13 +123,13 @@ fn CallTakeIncomplete(p: Class*) { } fn CallReturnIncomplete() { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+9]]:3: ERROR: Function returns incomplete type `Class`. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+9]]:3: error: function returns incomplete type `Class` // CHECK:STDERR: ReturnIncomplete(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-118]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-118]]:1: class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-35]]:23: Return type declared here. + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-35]]:23: return type declared here // CHECK:STDERR: fn ReturnIncomplete() -> Class; // CHECK:STDERR: ^~~~~~~~ ReturnIncomplete(); diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index eea5a5f5fa739..a0b8342210ce8 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -14,17 +14,17 @@ class Class { } fn F() { - // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: ERROR: Cannot initialize class with 2 field(s) from struct with 1 field(s). + // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: error: cannot initialize class with 2 field(s) from struct with 1 field(s). // CHECK:STDERR: {.a = 1} as Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: {.a = 1} as Class; - // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: ERROR: Missing value for field `b` in struct initialization. + // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: error: missing value for field `b` in struct initialization // CHECK:STDERR: {.a = 1, .c = 2} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: {.a = 1, .c = 2} as Class; - // CHECK:STDERR: fail_init.carbon:[[@LINE+3]]:3: ERROR: Cannot initialize class with 2 field(s) from struct with 3 field(s). + // CHECK:STDERR: fail_init.carbon:[[@LINE+3]]:3: error: cannot initialize class with 2 field(s) from struct with 3 field(s). // CHECK:STDERR: {.a = 1, .b = 2, .c = 3} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ {.a = 1, .b = 2, .c = 3} as Class; diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 24a2bb658f129..7f14d77f6a4ac 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -19,7 +19,7 @@ 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+3]]:18: ERROR: Cannot copy value of type `Class`. + // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+3]]:18: error: cannot copy value of type `Class` // CHECK:STDERR: var c: Class = {.a = 1, .b = 2} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ var c: Class = {.a = 1, .b = 2} as Class; diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 62f73d5314f41..0d695655fdba4 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -18,10 +18,10 @@ class B { fn F(s: {.a: A}, b: B) { // `s` has only a value representation, so this must be invalid. - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+7]]:8: ERROR: `addr self` method cannot be invoked on a value. + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+7]]:8: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: s.a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:13: Initializing `addr self` parameter of method declared here. + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:13: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: A*](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -29,10 +29,10 @@ fn F(s: {.a: A}, b: B) { // `b` has an object representation for `A`, but this is still invalid for // consistency. - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+6]]:8: ERROR: `addr self` method cannot be invoked on a value. + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+6]]:8: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: b.a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:13: Initializing `addr self` parameter of method declared here. + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:13: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: A*](); // CHECK:STDERR: ^~~~ b.a.F(); diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 3e83d2ae0e2f7..319e1ec900c22 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -17,10 +17,10 @@ let T: type = Class; // The class name is required to be written in the same way as in the class // declaration. An expression that evaluates to the class name is not accepted. -// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+6]]:4: ERROR: Name qualifiers are only allowed for entities that provide a scope. +// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+6]]:4: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn T.F() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE-7]]:5: Referenced non-scope entity declared here. +// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE-7]]:5: referenced non-scope entity declared here // CHECK:STDERR: let T: type = Class; // CHECK:STDERR: ^ fn T.F() {} diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index 01400f89cf84f..decfa0855056f 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -20,27 +20,27 @@ fn F(c: Class) { c.WithSelf(); Class.NoSelf(); - // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: ERROR: Missing object argument in method call. + // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: missing object argument in method call // CHECK:STDERR: Class.WithSelf(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-13]]:3: Calling function declared here. + // CHECK:STDERR: fail_method.carbon:[[@LINE-13]]:3: calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Class.WithSelf(); - // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: ERROR: 1 argument(s) passed to function expecting 0 argument(s). + // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: Class.WithSelf(c); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-21]]:3: Calling function declared here. + // CHECK:STDERR: fail_method.carbon:[[@LINE-21]]:3: calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Class.WithSelf(c); - // CHECK:STDERR: fail_method.carbon:[[@LINE+6]]:3: ERROR: Missing object argument in method call. + // CHECK:STDERR: fail_method.carbon:[[@LINE+6]]:3: error: missing object argument in method call // CHECK:STDERR: A(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-30]]:3: Calling function declared here. + // CHECK:STDERR: fail_method.carbon:[[@LINE-30]]:3: calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ A(); diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index 18fde85e0e48c..6960ac7414b91 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -10,19 +10,19 @@ class FinalClass { - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: ERROR: `abstract` not allowed on `fn` declaration in a non-abstract `class` definition. + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `abstract` not allowed on `fn` declaration in a non-abstract `class` definition // CHECK:STDERR: abstract fn Abstract[self: Self](); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: Containing definition here. + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: containing definition here // CHECK:STDERR: class FinalClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: abstract fn Abstract[self: Self](); - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: ERROR: `virtual` not allowed on `fn` declaration in a non-abstract non-base `class` definition. + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `virtual` not allowed on `fn` declaration in a non-abstract non-base `class` definition // CHECK:STDERR: virtual fn Virtual[self: Self](); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-14]]:1: Containing definition here. + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-14]]:1: containing definition here // CHECK:STDERR: class FinalClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,13 +31,13 @@ class FinalClass { abstract class AbstractClass { - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: ERROR: `default` not allowed on `fn` declaration outside of an interface. + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed on `fn` declaration outside of an interface // CHECK:STDERR: default fn Default[self: Self](); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn Default[self: Self](); - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: ERROR: `final` not allowed on `fn` declaration outside of an interface. + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: error: `final` not allowed on `fn` declaration outside of an interface // CHECK:STDERR: final fn Final[self: Self](); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -46,10 +46,10 @@ abstract class AbstractClass { base class BaseClass { - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+6]]:3: ERROR: `abstract` not allowed on `fn` declaration in a non-abstract `class` definition. + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+6]]:3: error: `abstract` not allowed on `fn` declaration in a non-abstract `class` definition // CHECK:STDERR: abstract fn Abstract[self: Self](); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: Containing definition here. + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: containing definition here // CHECK:STDERR: base class BaseClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ abstract fn Abstract[self: Self](); diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index 4aa2eaab5399f..12d4dfbece921 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -10,10 +10,10 @@ class Class { fn F() {} - // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE+6]]:3: ERROR: Redefinition of `fn F`. + // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE+6]]:3: error: redefinition of `fn F` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE-4]]:3: Previously defined here. + // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE-4]]:3: previously defined here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ fn F() {} diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index 709fc63d5643b..a3fb7b0cd6cf1 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -8,63 +8,63 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:18: ERROR: `private` repeated on declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:18: error: `private` repeated on declaration // CHECK:STDERR: private abstract private class DuplicatePrivate; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here // CHECK:STDERR: private abstract private class DuplicatePrivate; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private abstract private class DuplicatePrivate; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:14: ERROR: `protected` not allowed on declaration with `private`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:14: error: `protected` not allowed on declaration with `private` // CHECK:STDERR: private base protected class TwoAccess {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here // CHECK:STDERR: private base protected class TwoAccess {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private base protected class TwoAccess {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: ERROR: `abstract` repeated on declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `abstract` repeated on declaration // CHECK:STDERR: abstract abstract class TwoAbstract; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here // CHECK:STDERR: abstract abstract class TwoAbstract; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract abstract class TwoAbstract; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+15]]:1: ERROR: `protected` not allowed on `class` declaration at file scope, `protected` is only allowed on class members. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+15]]:1: error: `protected` not allowed on `class` declaration at file scope, `protected` is only allowed on class members // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:11: ERROR: `virtual` not allowed on `class` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:11: error: `virtual` not allowed on `class` declaration // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:19: ERROR: `base` not allowed on declaration with `virtual`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:19: error: `base` not allowed on declaration with `virtual` // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:11: `virtual` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:11: `virtual` previously appeared here // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: protected virtual base class Virtual {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: ERROR: `protected` must appear before `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `protected` must appear before `abstract` // CHECK:STDERR: abstract protected class WrongOrder; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here // CHECK:STDERR: abstract protected class WrongOrder; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract protected class WrongOrder; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:10: ERROR: `base` not allowed on declaration with `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:10: error: `base` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base class AbstractAndBase {} // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `abstract` previously appeared here // CHECK:STDERR: abstract base class AbstractAndBase {} // CHECK:STDERR: ^~~~~~~~ abstract base class AbstractAndBase {} diff --git a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon index 6f60150df3464..9b19dab24fc8f 100644 --- a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon +++ b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon @@ -10,7 +10,7 @@ class C {} -// CHECK:STDERR: fail_out_of_line_decl.carbon:[[@LINE+3]]:6: ERROR: Out-of-line declaration requires a declaration in scoped entity. +// CHECK:STDERR: fail_out_of_line_decl.carbon:[[@LINE+3]]:6: error: out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn C.F() {} // CHECK:STDERR: ^ fn C.F() {} diff --git a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon index 56af7fb03f064..918e40a507b7f 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon @@ -13,7 +13,7 @@ library "[[@TEST_NAME]]"; class A; -// CHECK:STDERR: fail_add_base.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_add_base.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. // CHECK:STDERR: base class A {} // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_add_base.carbon:[[@LINE-4]]:1: Previously declared here. @@ -27,7 +27,7 @@ base class A {} library "[[@TEST_NAME]]"; class B; -// CHECK:STDERR: fail_add_abstract.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_add_abstract.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. // CHECK:STDERR: abstract class B {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_add_abstract.carbon:[[@LINE-4]]:1: Previously declared here. @@ -41,7 +41,7 @@ abstract class B {} library "[[@TEST_NAME]]"; base class C; -// CHECK:STDERR: fail_remove_base.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_remove_base.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_remove_base.carbon:[[@LINE-4]]:1: Previously declared here. @@ -55,7 +55,7 @@ class C {} library "[[@TEST_NAME]]"; base class D; -// CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. // CHECK:STDERR: abstract class D {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE-4]]:1: Previously declared here. @@ -69,7 +69,7 @@ abstract class D {} library "[[@TEST_NAME]]"; abstract class E; -// CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE+7]]:1: ERROR: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. // CHECK:STDERR: class E {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE-4]]:1: Previously declared here. @@ -83,7 +83,7 @@ class E {} library "[[@TEST_NAME]]"; abstract class F; -// CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE+6]]:1: ERROR: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE+6]]:1: error: Class redeclared with different inheritance kind. // CHECK:STDERR: base class F {} // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE-4]]:1: Previously declared here. diff --git a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon index 703870e39466a..9c1e8a76209e2 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon @@ -19,7 +19,7 @@ class X { class A { class B; } class Y { - // CHECK:STDERR: fail_redeclaration_scope.carbon:[[@LINE+3]]:9: ERROR: Name `A` not found. + // CHECK:STDERR: fail_redeclaration_scope.carbon:[[@LINE+3]]:9: error: name `A` not found // CHECK:STDERR: class A.B {} // CHECK:STDERR: ^ class A.B {} diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index 2945292bc5467..3b0e57f0e58cd 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -14,10 +14,10 @@ class Class { fn I() {} } -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:1: ERROR: Redefinition of `class Class`. +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:1: error: redefinition of `class Class` // CHECK:STDERR: class Class { // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-9]]:1: Previously defined here. +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-9]]:1: previously defined here // CHECK:STDERR: class Class { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -28,16 +28,16 @@ class Class { } fn Class.F() {} -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+4]]:10: ERROR: Out-of-line declaration requires a declaration in scoped entity. +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+4]]:10: error: out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn Class.G() {} // CHECK:STDERR: ^ // CHECK:STDERR: fn Class.G() {} fn Class.H() {} -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `fn I`. +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `fn I` // CHECK:STDERR: fn Class.I() {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-26]]:3: Previously defined here. +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-26]]:3: previously defined here // CHECK:STDERR: fn I() {} // CHECK:STDERR: ^~~~~~~~ fn Class.I() {} diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 85e2d87eb91c9..9a0de15a65c23 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -15,7 +15,7 @@ class Class { } fn G() -> i32 { - // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: ERROR: Name `F` not found. + // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: error: name `F` not found // CHECK:STDERR: return F(); // CHECK:STDERR: ^ return F(); diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 84b0e1f1e3686..5c62d5bdd8d23 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_self.carbon class Class { - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:8: ERROR: `self` can only be declared in an implicit parameter list. + // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:8: error: `self` can only be declared in an implicit parameter list // CHECK:STDERR: fn F(self: Self); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ class Class { fn G() -> Self; } -// CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:12: ERROR: `self` can only be declared in an implicit parameter list. +// CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:12: error: `self` can only be declared in an implicit parameter list // CHECK:STDERR: fn Class.F(self: Self) { // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -26,12 +26,12 @@ fn Class.F(self: Self) { } fn Class.G() -> Self { - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:7: ERROR: `self` can only be declared in an implicit parameter list. + // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:7: error: `self` can only be declared in an implicit parameter list // CHECK:STDERR: var self: Self; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: var self: Self; - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:10: ERROR: Cannot copy value of type `Class`. + // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:10: error: cannot copy value of type `Class` // CHECK:STDERR: return self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -43,13 +43,13 @@ class WrongSelf { } fn CallWrongSelf(ws: WrongSelf) { - // CHECK:STDERR: fail_self.carbon:[[@LINE+9]]:3: ERROR: Cannot implicitly convert from `WrongSelf` to `Class`. + // CHECK:STDERR: fail_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `WrongSelf` to `Class` // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: Type `WrongSelf` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: type `WrongSelf` does not implement interface `ImplicitAs` // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: Initializing `self` parameter of method declared here. + // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: initializing `self` parameter of method declared here // CHECK:STDERR: fn F[self: Class](); // CHECK:STDERR: ^~~~ ws.F(); diff --git a/toolchain/check/testdata/class/fail_self_type_member.carbon b/toolchain/check/testdata/class/fail_self_type_member.carbon index 2a672cd438f41..b6f37df71e37b 100644 --- a/toolchain/check/testdata/class/fail_self_type_member.carbon +++ b/toolchain/check/testdata/class/fail_self_type_member.carbon @@ -14,11 +14,11 @@ class Class { fn F() -> bool { var c1: Class = {.b = true}; - // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+7]]:17: ERROR: Expected identifier after `.`. + // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+7]]:17: error: expected identifier after `.` // CHECK:STDERR: var c2: Class.Self = c1; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+3]]:17: ERROR: Semantics TODO: `Error recovery from keyword name.`. + // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+3]]:17: error: semantics TODO: `Error recovery from keyword name.` // CHECK:STDERR: var c2: Class.Self = c1; // CHECK:STDERR: ^~~~ var c2: Class.Self = c1; diff --git a/toolchain/check/testdata/class/fail_todo_local_class.carbon b/toolchain/check/testdata/class/fail_todo_local_class.carbon index 79ba85ba6c356..e3cb4c65a63f5 100644 --- a/toolchain/check/testdata/class/fail_todo_local_class.carbon +++ b/toolchain/check/testdata/class/fail_todo_local_class.carbon @@ -11,11 +11,11 @@ // TODO: Support parsing classes at function scope. class A { fn F() { - // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+7]]:5: ERROR: Expected expression. + // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+7]]:5: error: expected expression // CHECK:STDERR: class B { // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+3]]:5: ERROR: Semantics TODO: `HandleInvalidParse`. + // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+3]]:5: error: semantics TODO: `HandleInvalidParse` // CHECK:STDERR: class B { // CHECK:STDERR: ^~~~~ class B { diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index b40d58ad6e8f9..c17cadbffe7a2 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -11,7 +11,7 @@ class Class { var field: i32; fn F() -> i32 { - // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+4]]:12: ERROR: Expression cannot be used as a value. + // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+4]]:12: error: expression cannot be used as a value // CHECK:STDERR: return field; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -20,7 +20,7 @@ class Class { } fn G() -> i32 { - // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+3]]:10: ERROR: Expression cannot be used as a value. + // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+3]]:10: error: expression cannot be used as a value // CHECK:STDERR: return Class.field; // CHECK:STDERR: ^~~~~~~~~~~ return Class.field; diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index eacb9e0e4b0e7..4d8ccce4e4c69 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -14,7 +14,7 @@ class Class { fn G(c: Class) -> i32 { // TODO: Mention the scope in which we looked for the name. - // CHECK:STDERR: fail_unknown_member.carbon:[[@LINE+3]]:10: ERROR: Name `something` not found. + // CHECK:STDERR: fail_unknown_member.carbon:[[@LINE+3]]:10: error: name `something` not found // CHECK:STDERR: return c.something; // CHECK:STDERR: ^~~~~~~~~~~ return c.something; diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 5235198533d16..3042d0a22a822 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -25,10 +25,10 @@ library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} -// CHECK:STDERR: fail_too_few.carbon:[[@LINE+7]]:8: ERROR: 1 argument(s) passed to generic class expecting 2 argument(s). +// CHECK:STDERR: fail_too_few.carbon:[[@LINE+7]]:8: error: 1 argument(s) passed to generic class expecting 2 argument(s). // CHECK:STDERR: var a: Class(i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_too_few.carbon:[[@LINE-5]]:1: Calling generic class declared here. +// CHECK:STDERR: fail_too_few.carbon:[[@LINE-5]]:1: calling generic class declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -40,10 +40,10 @@ library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} -// CHECK:STDERR: fail_too_many.carbon:[[@LINE+7]]:8: ERROR: 3 argument(s) passed to generic class expecting 2 argument(s). +// CHECK:STDERR: fail_too_many.carbon:[[@LINE+7]]:8: error: 3 argument(s) passed to generic class expecting 2 argument(s). // CHECK:STDERR: var a: Class(i32*, 1, 2); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_too_many.carbon:[[@LINE-5]]:1: Calling generic class declared here. +// CHECK:STDERR: fail_too_many.carbon:[[@LINE-5]]:1: calling generic class declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -55,13 +55,13 @@ library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: ERROR: Cannot implicitly convert from `i32` to `type`. +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: Type `i32` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:13: Initializing generic parameter `T` declared here. +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:13: initializing generic parameter `T` declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^ var a: Class(5, i32*); diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index f9ef44835dea0..a1a721d23daa5 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -55,10 +55,10 @@ import library "foo"; fn Use() { // TODO: Include the generic arguments in the formatted type name. - // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+7]]:3: ERROR: Cannot implicitly convert from `CompleteClass` to `CompleteClass`. + // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `CompleteClass` to `CompleteClass` // CHECK:STDERR: var v: CompleteClass(i32*) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: Type `CompleteClass` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: type `CompleteClass` does not implement interface `ImplicitAs` // CHECK:STDERR: var v: CompleteClass(i32*) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -69,18 +69,18 @@ fn Use() { impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+10]]:13: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+10]]:13: error: redeclaration differs at parameter 1 // CHECK:STDERR: class Class(U:! type) { // CHECK:STDERR: ^ -// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "foo"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: foo.carbon:4:13: Previous declaration's corresponding parameter here. +// CHECK:STDERR: foo.carbon:4:13: previous declaration's corresponding parameter here // CHECK:STDERR: class Class(T:! type); // CHECK:STDERR: ^ // CHECK:STDERR: class Class(U:! type) { - // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+3]]:10: ERROR: Name `T` not found. + // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+3]]:10: error: name `T` not found // CHECK:STDERR: var x: T; // CHECK:STDERR: ^ var x: T; diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index b3c8095b05da6..8055048f5b7e8 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -39,10 +39,10 @@ class Class(T:! type) { } fn StaticMemberFunctionCall(T:! type) -> Class(T) { - // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `Class` to `Class`. + // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `Class` to `Class` // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: Type `Class` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: type `Class` does not implement interface `ImplicitAs` // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ return Class(T).Make(); diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index f3ea63c4b8061..a4ff752cdc116 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -30,7 +30,7 @@ library "fail_member_inline.carbon"; class C(T:! type) { fn F() { - // CHECK:STDERR: fail_member_inline.carbon:[[@LINE+3]]:5: ERROR: Expression cannot be used as a value. + // CHECK:STDERR: fail_member_inline.carbon:[[@LINE+3]]:5: error: expression cannot be used as a value // CHECK:STDERR: data; // CHECK:STDERR: ^~~~ data; diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index ae2bbc78473de..08a7306f34d03 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -46,10 +46,10 @@ class NotGeneric { fn F(); } -// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE+7]]:4: ERROR: Redeclaration differs because of parameter list. +// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter list // CHECK:STDERR: fn NotGeneric(T:! type).F() {} // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE-7]]:1: Previously declared without parameter list. +// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE-7]]:1: previously declared without parameter list // CHECK:STDERR: class NotGeneric { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -63,10 +63,10 @@ class Generic(T:! type) { fn TooFew(); } -// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE+7]]:4: ERROR: Redeclaration differs because of parameter count of 0. +// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn Generic().TooFew() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE-7]]:1: Previously declared with parameter count of 1. +// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE-7]]:1: previously declared with parameter count of 1 // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -80,10 +80,10 @@ class Generic(T:! type) { fn TooMany(); } -// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE+7]]:4: ERROR: Redeclaration differs because of parameter count of 2. +// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 2 // CHECK:STDERR: fn Generic(T:! type, U:! type).TooMany() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE-7]]:1: Previously declared with parameter count of 1. +// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE-7]]:1: previously declared with parameter count of 1 // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -97,10 +97,10 @@ class Generic(T:! type) { fn WrongType(); } -// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+6]]:12: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+6]]:12: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Generic(T:! ()).WrongType() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: previous declaration's corresponding parameter here // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^ fn Generic(T:! ()).WrongType() {} diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 283a7214bce46..d7c2631f12823 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -22,10 +22,10 @@ class Generic(T:! type) { library "[[@TEST_NAME]]"; class A; -// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter list. +// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter list // CHECK:STDERR: class A(T:! type) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE-4]]:1: Previously declared without parameter list. +// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE-4]]:1: previously declared without parameter list // CHECK:STDERR: class A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -36,10 +36,10 @@ class A(T:! type) {} library "[[@TEST_NAME]]"; class B(N:! i32); -// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of implicit parameter list. +// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE+7]]:1: error: redeclaration differs because of implicit parameter list // CHECK:STDERR: class B[T:! type](N:! T) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE-4]]:1: Previously declared without implicit parameter list. +// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE-4]]:1: previously declared without implicit parameter list // CHECK:STDERR: class B(N:! i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -50,10 +50,10 @@ class B[T:! type](N:! T) {} library "[[@TEST_NAME]]"; class C(T:! type); -// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter count of 2. +// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 2 // CHECK:STDERR: class C(T:! type, U:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE-4]]:1: Previously declared with parameter count of 1. +// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE-4]]:1: previously declared with parameter count of 1 // CHECK:STDERR: class C(T:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,10 +64,10 @@ class C(T:! type, U:! i32) {} library "[[@TEST_NAME]]"; class D(T:! type); -// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error: redeclaration differs at parameter 1 // CHECK:STDERR: class D(T:! i32) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: previous declaration's corresponding parameter here // CHECK:STDERR: class D(T:! type); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -78,10 +78,10 @@ class D(T:! i32) {} library "[[@TEST_NAME]]"; class E(T:! type); -// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+6]]:9: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+6]]:9: error: redeclaration differs at parameter 1 // CHECK:STDERR: class E(U:! type) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE-4]]:9: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE-4]]:9: previous declaration's corresponding parameter here // CHECK:STDERR: class E(T:! type); // CHECK:STDERR: ^ class E(U:! type) {} diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 0f209057f110c..b17d0080721a5 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -79,10 +79,10 @@ class Square { extend base: Shape; fn GetPosition[self: Self]() -> i32 { - // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE+7]]:12: ERROR: Cannot access private member `y` of type `Shape`. + // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE+7]]:12: error: cannot access private member `y` of type `Shape` // CHECK:STDERR: return self.y; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE-10]]:15: The private member `y` is defined here. + // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE-10]]:15: the private member `y` is defined here // CHECK:STDERR: private var y: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -118,10 +118,10 @@ base class B { class C { extend base: B; - // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE+7]]:12: ERROR: Cannot access private member `F` of type `B`. + // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE+7]]:12: error: cannot access private member `F` of type `B` // CHECK:STDERR: fn G() { Self.F(); } // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE-8]]:3: The private member `F` is defined here. + // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE-8]]:3: the private member `F` is defined here // CHECK:STDERR: private fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -158,19 +158,19 @@ class B { private var internal: Internal; fn G() -> i32 { - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:5: ERROR: Cannot access private member `SOME_PRIVATE_CONSTANT` of type `A`. + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:5: error: cannot access private member `SOME_PRIVATE_CONSTANT` of type `A` // CHECK:STDERR: A.SOME_PRIVATE_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-14]]:15: The private member `SOME_PRIVATE_CONSTANT` is defined here. + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-14]]:15: the private member `SOME_PRIVATE_CONSTANT` is defined here // CHECK:STDERR: private let SOME_PRIVATE_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: A.SOME_PRIVATE_CONSTANT; - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: ERROR: Cannot access protected member `SOME_PROTECTED_CONSTANT` of type `A`. + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error: cannot access protected member `SOME_PROTECTED_CONSTANT` of type `A` // CHECK:STDERR: return A.SOME_PROTECTED_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-24]]:17: The protected member `SOME_PROTECTED_CONSTANT` is defined here. + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-24]]:17: the protected member `SOME_PROTECTED_CONSTANT` is defined here // CHECK:STDERR: protected let SOME_PROTECTED_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -178,10 +178,10 @@ class B { } fn SomeFunc[self: Self]() -> i32{ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: ERROR: Cannot access protected member `INTERNAL_CONSTANT` of type `Internal`. + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error: cannot access protected member `INTERNAL_CONSTANT` of type `Internal` // CHECK:STDERR: return self.internal.INTERNAL_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-30]]:17: The protected member `INTERNAL_CONSTANT` is defined here. + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-30]]:17: the protected member `INTERNAL_CONSTANT` is defined here // CHECK:STDERR: protected let INTERNAL_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -200,10 +200,10 @@ base class A { class B { extend base: A; fn F[self: Self]() { - // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE+6]]:11: ERROR: Cannot access private member `x` of type `A`. + // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE+6]]:11: error: cannot access private member `x` of type `A` // CHECK:STDERR: self.(A.x); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE-9]]:15: The private member `x` is defined here. + // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE-9]]:15: the private member `x` is defined here // CHECK:STDERR: private var x: i32; // CHECK:STDERR: ^~~~~~ self.(A.x); diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index 6057f0f4fed71..ae9b187f43ac1 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -52,19 +52,19 @@ let a: C = {.a = 1, .b = 2}; // Cannot implicitly convert between a type and an adapter for the type. -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: ERROR: Cannot implicitly convert from `C` to `AdaptC`. +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C` to `AdaptC` // CHECK:STDERR: let b: AdaptC = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: Type `C` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: let b: AdaptC = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let b: AdaptC = a; -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: ERROR: Cannot implicitly convert from `AdaptC` to `C`. +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `AdaptC` to `C` // CHECK:STDERR: let c: C = b; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: Type `` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: type `` does not implement interface `ImplicitAs` // CHECK:STDERR: let c: C = b; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -74,19 +74,19 @@ fn MakeC() -> C; fn MakeAdaptC() -> AdaptC; -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: ERROR: Cannot implicitly convert from `C` to `AdaptC`. +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C` to `AdaptC` // CHECK:STDERR: var d: AdaptC = MakeC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: Type `C` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var d: AdaptC = MakeC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var d: AdaptC = MakeC(); -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+6]]:1: ERROR: Cannot implicitly convert from `AdaptC` to `C`. +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `AdaptC` to `C` // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: Type `AdaptC` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: type `AdaptC` does not implement interface `ImplicitAs` // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ var e: C = MakeAdaptC(); diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index fcf09803fbb94..67f60d0434052 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -45,10 +45,10 @@ class C {} library "[[@TEST_NAME]]"; extern class C; -// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE+7]]:4: ERROR: Cannot declare a member of incomplete class `C`. +// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE+7]]:4: error: cannot declare a member of incomplete class `C` // CHECK:STDERR: fn C.F(); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE-4]]:1: Class was forward declared here. +// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE-4]]:1: class was forward declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -65,10 +65,10 @@ extern class C {} library "[[@TEST_NAME]]"; extern class C; -// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `class C` is redundant. +// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -79,10 +79,10 @@ extern class C; library "[[@TEST_NAME]]"; extern class C; -// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `class C` is redundant. +// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -93,7 +93,7 @@ class C; library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_extern_member_class.carbon:[[@LINE+4]]:3: ERROR: `extern` not allowed on `class` declaration that is a member. + // CHECK:STDERR: fail_extern_member_class.carbon:[[@LINE+4]]:3: error: `extern` not allowed on `class` declaration that is a member // CHECK:STDERR: extern class D; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -105,10 +105,10 @@ class C { library "[[@TEST_NAME]]"; extern class C; -// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE+7]]:1: ERROR: Redeclarations of `class C` must match use of `extern`. +// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclarations of `class C` must match use of `extern` // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -119,10 +119,10 @@ class C {} library "[[@TEST_NAME]]"; class C; -// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `class C` is redundant. +// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -132,16 +132,16 @@ extern class C; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+13]]:1: In import. +// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+13]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: decl.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: decl.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+7]]:1: In import. +// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+7]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -152,16 +152,16 @@ import library "decl"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+13]]:1: In import. +// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+13]]:1: in import // CHECK:STDERR: import library "decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: extern_decl.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+7]]:1: In import. +// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+7]]:1: in import // CHECK:STDERR: import library "decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: decl.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: decl.carbon:4:1: name is previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -172,16 +172,16 @@ import library "extern_decl"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+13]]:1: In import. +// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+13]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: def.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: def.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+7]]:1: In import. +// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+7]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -192,29 +192,29 @@ import library "def"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+26]]:1: In import. +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+26]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: decl.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: decl.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+20]]:1: In import. +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+20]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+13]]:1: In import. +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+13]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: def.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: def.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+7]]:1: In import. +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+7]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -226,16 +226,16 @@ import library "def"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+13]]:1: In import. +// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+13]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl_copy.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: extern_decl_copy.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+7]]:1: In import. +// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+7]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: extern_decl.carbon:4:1: name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -248,13 +248,13 @@ library "[[@TEST_NAME]]"; import library "extern_decl"; -// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `class C` is redundant. +// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE+10]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "extern_decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_decl.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern_decl.carbon:4:1: previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -266,13 +266,13 @@ library "[[@TEST_NAME]]"; import library "decl"; -// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `class C` must match use of `extern`. +// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE+10]]:1: error: redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "decl"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: decl.carbon:4:1: Previously declared here. +// CHECK:STDERR: decl.carbon:4:1: previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -284,13 +284,13 @@ library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `class C` must match use of `extern`. +// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE+10]]:1: error: redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "def"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: def.carbon:4:1: Previously declared here. +// CHECK:STDERR: def.carbon:4:1: previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -302,13 +302,13 @@ library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+9]]:1: ERROR: Redeclarations of `class C` must match use of `extern`. +// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+9]]:1: error: redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "def"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: def.carbon:4:1: Previously declared here. +// CHECK:STDERR: def.carbon:4:1: previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ extern class C; diff --git a/toolchain/check/testdata/class/no_prelude/extern_library.carbon b/toolchain/check/testdata/class/no_prelude/extern_library.carbon index 7d3c54bd61525..b949d5a895f1d 100644 --- a/toolchain/check/testdata/class/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern_library.carbon @@ -10,7 +10,7 @@ // --- fail_todo.carbon -// CHECK:STDERR: fail_todo.carbon:[[@LINE+3]]:1: ERROR: Semantics TODO: `extern library`. +// CHECK:STDERR: fail_todo.carbon:[[@LINE+3]]:1: error: semantics TODO: `extern library` // CHECK:STDERR: extern library "foo" class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extern library "foo" class C; diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon index b0b7a288d719e..f156e2ce5fde5 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -33,7 +33,7 @@ var e: C(X).GenericAndParams(X) = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:9: ERROR: Parameters of generic types must be constant. +// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:9: error: parameters of generic types must be constant // CHECK:STDERR: class A[T: type]() {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -43,7 +43,7 @@ class A[T: type]() {} library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:9: ERROR: Parameters of generic types must be constant. +// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:9: error: parameters of generic types must be constant // CHECK:STDERR: class A(T: type) {} // CHECK:STDERR: ^ class A(T: type) {} diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index 44c49dbf2332d..7ab046ef1e5e9 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -30,13 +30,13 @@ class C {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `class C` is redundant. +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+10]]:1: error: redeclaration of `class C` is redundant // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "redecl_after_def"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: redecl_after_def.carbon:4:1: Previously declared here. +// CHECK:STDERR: redecl_after_def.carbon:4:1: previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -52,13 +52,13 @@ class C {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+10]]:1: ERROR: Redefinition of `class C`. +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+10]]:1: error: redefinition of `class C` // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "redef_after_def"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: redef_after_def.carbon:4:1: Previously defined here. +// CHECK:STDERR: redef_after_def.carbon:4:1: previously defined here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -75,13 +75,13 @@ alias B = C; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+9]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class B {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "def_alias"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: def_alias.carbon:5:7: Name is previously declared here. +// CHECK:STDERR: def_alias.carbon:5:7: name is previously declared here // CHECK:STDERR: alias B = C; // CHECK:STDERR: ^ class B {} diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 3d6b864e31dc1..9ceca505a5a81 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -48,7 +48,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:8: ERROR: Name `Def` not found. +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:8: error: name `Def` not found // CHECK:STDERR: var c: Def = {}; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -60,7 +60,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:8: ERROR: Name `Def` not found. +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:8: error: name `Def` not found // CHECK:STDERR: var c: Test.Def = {}; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -78,7 +78,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; -// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:8: ERROR: Name `ForwardWithDef` not found. +// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:8: error: name `ForwardWithDef` not found // CHECK:STDERR: var c: ForwardWithDef = {}; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:8: ERROR: Name `ForwardWithDef` not found. +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:8: error: name `ForwardWithDef` not found // CHECK:STDERR: var c: Test.ForwardWithDef = {}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -110,7 +110,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward"; -// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: ERROR: Name `Forward` not found. +// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found // CHECK:STDERR: fn F(c: Forward*) {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -122,7 +122,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: ERROR: Name `Forward` not found. +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error: name `Forward` not found // CHECK:STDERR: fn F(c: Test.Forward*) {} // CHECK:STDERR: ^~~~~~~~~~~~ fn F(c: Test.Forward*) {} diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon index cb0c445c21dfa..55152a900e7e2 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon @@ -52,7 +52,7 @@ class C; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: ERROR: No definition found for declaration in impl file +// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -66,7 +66,7 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: No definition found for declaration in impl file +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file // CHECK:STDERR: class D; // CHECK:STDERR: ^~~~~~~~ class D; diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 43ab03d5e8210..9596d1c851467 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -37,10 +37,10 @@ library "[[@TEST_NAME]]"; class C {} class Foo(a:! C); -// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:15: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:15: Comparing with previous declaration here. +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:15: comparing with previous declaration here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -80,10 +80,10 @@ class C {} alias D = C; class Foo(a:! C); -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:11: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:11: error: redeclaration differs at parameter 1 // CHECK:STDERR: class Foo(b:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:11: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:11: previous declaration's corresponding parameter here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -97,10 +97,10 @@ class C {} alias D = C; class Foo(a:! C); -// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:15: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:15: Comparing with previous declaration here. +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:15: comparing with previous declaration here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -114,10 +114,10 @@ class C {} alias D = C; class Foo[a:! C](); -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:15: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here // CHECK:STDERR: class Foo[a:! D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:15: Comparing with previous declaration here. +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:15: comparing with previous declaration here // CHECK:STDERR: class Foo[a:! C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -146,14 +146,14 @@ library "[[@TEST_NAME]]"; class C {} class Foo(a:! const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:15: WARNING: `const` applied repeatedly to the same type has no additional effect. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:15: warning: `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: class Foo(a:! const (const C)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:21: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:21: error: redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:21: Comparing with previous declaration here. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:21: comparing with previous declaration here // CHECK:STDERR: class Foo(a:! const C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -169,10 +169,10 @@ base class Base { fn F[addr self: Self*](); } -// CHECK:STDERR: fail_self_type.carbon:[[@LINE+6]]:22: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_self_type.carbon:[[@LINE+6]]:22: error: redeclaration syntax differs here // CHECK:STDERR: fn Base.F[addr self: Base*]() { // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:19: Comparing with previous declaration here. +// CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:19: comparing with previous declaration here // CHECK:STDERR: fn F[addr self: Self*](); // CHECK:STDERR: ^~~~ fn Base.F[addr self: Base*]() { diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 030056713c835..f59c440260a06 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -7,7 +7,7 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon -// CHECK:STDERR: fail_int_mismatch.carbon: ERROR: Main//default previously provided by `int_match.carbon`. +// CHECK:STDERR: fail_int_mismatch.carbon: error: `Main//default` previously provided by `int_match.carbon` // CHECK:STDERR: // --- int_match.carbon @@ -20,10 +20,10 @@ class D(b:! C(1_000)) {} class C(a:! i32) {} class D(b:! C(1000)); -// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+6]]:15: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+6]]:15: error: redeclaration syntax differs here // CHECK:STDERR: class D(b:! C(1_000)) {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: Comparing with previous declaration here. +// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: comparing with previous declaration here // CHECK:STDERR: class D(b:! C(1000)); // CHECK:STDERR: ^~~~ class D(b:! C(1_000)) {} diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 40c48c50405b4..739a936786c8f 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/const/collapse.carbon // OK, `const (const i32)` is the same type as `const i32`. -// CHECK:STDERR: collapse.carbon:[[@LINE+3]]:25: WARNING: `const` applied repeatedly to the same type has no additional effect. +// CHECK:STDERR: collapse.carbon:[[@LINE+3]]:25: warning: `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: fn F(p: const i32**) -> const (const i32)** { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ fn F(p: const i32**) -> const (const i32)** { diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index b32d71502c0ee..773faa5f03c01 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -8,15 +8,15 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/const/fail_collapse.carbon -// CHECK:STDERR: fail_collapse.carbon:[[@LINE+4]]:9: WARNING: `const` applied repeatedly to the same type has no additional effect. +// CHECK:STDERR: fail_collapse.carbon:[[@LINE+4]]:9: warning: `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: fn G(p: const (const i32)**) -> i32** { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn G(p: const (const i32)**) -> i32** { - // CHECK:STDERR: fail_collapse.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `const i32**` to `i32**`. + // CHECK:STDERR: fail_collapse.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const i32**` to `i32**` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: Type `const i32**` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: type `const i32**` does not implement interface `ImplicitAs` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ return p; diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 1dd3059b55447..cf6a1c6514b93 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -10,7 +10,7 @@ // TODO: This creates an array temporary, which we don't yet support evaluating. -// CHECK:STDERR: fail_aggregate.carbon:[[@LINE+3]]:43: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_aggregate.carbon:[[@LINE+3]]:43: error: array bound is not a constant // CHECK:STDERR: var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index a2df9f5f1280b..3da1e252ac4cc 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -10,7 +10,7 @@ // TODO: This should work. fn G(N:! i32) { - // CHECK:STDERR: fail_symbolic.carbon:[[@LINE+3]]:16: ERROR: Semantics TODO: `symbolic array bound`. + // CHECK:STDERR: fail_symbolic.carbon:[[@LINE+3]]:16: error: semantics TODO: `symbolic array bound` // CHECK:STDERR: var k: [i32; N]; // CHECK:STDERR: ^ var k: [i32; N]; diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 75a16c7408d3d..7a743a57abfa4 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -9,30 +9,30 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_redefined.carbon fn A(n: i32, m: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: ERROR: Redefinition of `fn A`. +// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn A` // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 { return n; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: Previously defined here. +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: previously defined here // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 { return n; } fn B(n: i32, m: i32) -> i32 { return n; } -// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: ERROR: Redefinition of `fn B`. +// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn B` // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: Previously defined here. +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: previously defined here // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 { return n; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 = "int.sadd"; fn C(n: i32, m: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_redefined.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `fn C`. +// CHECK:STDERR: fail_redefined.carbon:[[@LINE+6]]:1: error: redefinition of `fn C` // CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: Previously defined here. +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: previously defined here // CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn C(n: i32, m: i32) -> i32 = "int.sadd"; diff --git a/toolchain/check/testdata/function/builtin/fail_unknown.carbon b/toolchain/check/testdata/function/builtin/fail_unknown.carbon index a10dbc09e70a9..627faa2fcc51d 100644 --- a/toolchain/check/testdata/function/builtin/fail_unknown.carbon +++ b/toolchain/check/testdata/function/builtin/fail_unknown.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_unknown.carbon -// CHECK:STDERR: fail_unknown.carbon:[[@LINE+3]]:23: ERROR: Unknown builtin function name "unknown.builtin.name". +// CHECK:STDERR: fail_unknown.carbon:[[@LINE+3]]:23: error: unknown builtin function name "unknown.builtin.name" // CHECK:STDERR: fn UnknownBuiltin() = "unknown.builtin.name"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ fn UnknownBuiltin() = "unknown.builtin.name"; diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index b37b44ef401ff..d06212f045af1 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_not_callable.carbon fn Run() { - // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: ERROR: Value of type `String` is not callable. + // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: error: value of type `String` is not callable // CHECK:STDERR: var x: i32 = "hello"(); // CHECK:STDERR: ^~~~~~~~ var x: i32 = "hello"(); diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 0e9110926b36f..09758bbc36616 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -13,52 +13,52 @@ fn Run1(a: i32) {} fn Run2(a: i32, b: i32) {} fn Main() { - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 1 argument(s) passed to function expecting 0 argument(s). + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: Run0(1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: Calling function declared here. + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: calling function declared here // CHECK:STDERR: fn Run0() {} // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: Run0(1); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 2 argument(s) passed to function expecting 0 argument(s). + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 argument(s) passed to function expecting 0 argument(s). // CHECK:STDERR: Run0(0, 1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: Calling function declared here. + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: calling function declared here // CHECK:STDERR: fn Run0() {} // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: Run0(0, 1); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 0 argument(s) passed to function expecting 1 argument(s). + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: Run1(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: Calling function declared here. + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: calling function declared here // CHECK:STDERR: fn Run1(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run1(); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 2 argument(s) passed to function expecting 1 argument(s). + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 argument(s) passed to function expecting 1 argument(s). // CHECK:STDERR: Run1(0, 1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: Calling function declared here. + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: calling function declared here // CHECK:STDERR: fn Run1(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run1(0, 1); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 0 argument(s) passed to function expecting 2 argument(s). + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: Run2(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: Calling function declared here. + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: calling function declared here // CHECK:STDERR: fn Run2(a: i32, b: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run2(); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: ERROR: 1 argument(s) passed to function expecting 2 argument(s). + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: error: 1 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: Run2(0); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: Calling function declared here. + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: calling function declared here // CHECK:STDERR: fn Run2(a: i32, b: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ Run2(0); diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index aa4f5f21ba542..d0e60142964e0 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -11,13 +11,13 @@ fn G(a: i32) {} fn F() { - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`. + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:3: Type `f64` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:3: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:1: Initializing parameter 1 of function declared here. + // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:1: initializing parameter 1 of function declared here // CHECK:STDERR: fn G(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~ G(1.0); 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 2efef06a47afc..7c04ffb1d8bab 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -11,10 +11,10 @@ fn Foo() -> f64 { return 1.0; } fn Run() { - // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`. + // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: Type `f64` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ var x: i32 = Foo(); diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index 73d6b73ab7cab..05fd5897907aa 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_in_type.carbon -// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+3]]:23: ERROR: Array bound is not a constant. +// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+3]]:23: error: array bound is not a constant // CHECK:STDERR: fn F(n: i32, a: [i32; n]*); // CHECK:STDERR: ^ fn F(n: i32, a: [i32; n]*); diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index f1130a843d318..65f9192554f16 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_redecl.carbon -// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+6]]:14: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+6]]:14: error: duplicate name being declared in the same scope // CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+3]]:6: Name is previously declared here. +// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+3]]:6: name is previously declared here // CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDERR: ^ fn F(n: i32, n: i32); diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 3a13afae5df02..2f3ff465b5e34 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -58,57 +58,57 @@ library "[[@TEST_NAME]]"; import library "api"; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:4:1: Previously declared here. +// CHECK:STDERR: api.carbon:4:1: previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: extern fn A(); -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn B` must match use of `extern`. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclarations of `fn B` must match use of `extern` // CHECK:STDERR: extern fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-16]]:1: In import. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-16]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:5:1: Previously declared here. +// CHECK:STDERR: api.carbon:5:1: previously declared here // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extern fn B(b: i32) -> i32; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn C` must match use of `extern`. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclarations of `fn C` must match use of `extern` // CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-27]]:1: In import. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-27]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:6:1: Previously declared here. +// CHECK:STDERR: api.carbon:6:1: previously declared here // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32}; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `fn D` is redundant. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclaration of `fn D` is redundant // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-38]]:1: In import. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-38]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:7:1: Previously declared here. +// CHECK:STDERR: api.carbon:7:1: previously declared here // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: extern fn D(); -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn E` must match use of `extern`. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+10]]:1: error: redeclarations of `fn E` must match use of `extern` // CHECK:STDERR: extern fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-49]]:1: In import. +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-49]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:10:1: Previously declared here. +// CHECK:STDERR: api.carbon:10:1: previously declared here // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -142,68 +142,68 @@ var e: () = NS.E(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_merge.carbon:[[@LINE+65]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+65]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: extern_api.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+59]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+59]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: api.carbon:4:1: name is previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+52]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+52]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:5:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: extern_api.carbon:5:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+46]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+46]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:5:1: Name is previously declared here. +// CHECK:STDERR: api.carbon:5:1: name is previously declared here // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+39]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+39]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:6:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: extern_api.carbon:6:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+33]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+33]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:6:1: Name is previously declared here. +// CHECK:STDERR: api.carbon:6:1: name is previously declared here // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+26]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+26]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:7:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: extern_api.carbon:7:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+20]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+20]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:7:1: Name is previously declared here. +// CHECK:STDERR: api.carbon:7:1: name is previously declared here // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+13]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+13]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:10:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: extern_api.carbon:10:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+7]]:1: In import. +// CHECK:STDERR: fail_merge.carbon:[[@LINE+7]]:1: in import // CHECK:STDERR: import library "api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:10:1: Name is previously declared here. +// CHECK:STDERR: api.carbon:10:1: name is previously declared here // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -220,68 +220,68 @@ var e: () = NS.E(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+64]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+64]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: api.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+58]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+58]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: extern_api.carbon:4:1: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+51]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+51]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:5:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: api.carbon:5:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+45]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+45]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:5:1: Name is previously declared here. +// CHECK:STDERR: extern_api.carbon:5:1: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+38]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+38]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:6:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: api.carbon:6:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+32]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+32]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:6:1: Name is previously declared here. +// CHECK:STDERR: extern_api.carbon:6:1: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+25]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+25]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:7:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: api.carbon:7:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+19]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+19]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:7:1: Name is previously declared here. +// CHECK:STDERR: extern_api.carbon:7:1: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: api.carbon:10:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: api.carbon:10:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import library "extern_api"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_api.carbon:10:1: Name is previously declared here. +// CHECK:STDERR: extern_api.carbon:10:1: name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import library "extern_api"; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index 9c3ca969936d9..5a1de8f67ea72 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -25,10 +25,10 @@ var x: () = F(); library "[[@TEST_NAME]]"; extern fn F(); -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -39,10 +39,10 @@ extern fn F(); library "[[@TEST_NAME]]"; extern fn F(); -// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant. +// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -53,12 +53,12 @@ fn F(); library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: ERROR: `extern` not allowed on `fn` declaration that is a member. + // CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: error: `extern` not allowed on `fn` declaration that is a member // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: extern fn F(); - // CHECK:STDERR: fail_member_extern.carbon:[[@LINE+3]]:3: ERROR: `extern` not allowed on `fn` declaration that is a member. + // CHECK:STDERR: fail_member_extern.carbon:[[@LINE+3]]:3: error: `extern` not allowed on `fn` declaration that is a member // CHECK:STDERR: extern fn G[self: Self](); // CHECK:STDERR: ^~~~~~ extern fn G[self: Self](); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon index d93da6b5c4421..ac5734db2eef2 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon @@ -28,13 +28,13 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE+10]]:1: ERROR: Declaration in library "extern_library_nonowner" doesn't match `extern library` declaration. +// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE+10]]:1: error: declaration in library "extern_library_nonowner" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "extern_library"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: Previously declared with `extern library` here. +// CHECK:STDERR: extern_library.carbon:4:1: previously declared with `extern library` here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -46,13 +46,13 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. +// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE+10]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "extern_library"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern_library.carbon:4:1: previously declared here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,13 +64,13 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+10]]:1: ERROR: Declaration in library "extern_library_redecl" doesn't match `extern library` declaration. +// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+10]]:1: error: declaration in library "extern_library_redecl" doesn't match `extern library` declaration // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "extern_library"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: Previously declared with `extern library` here. +// CHECK:STDERR: extern_library.carbon:4:1: previously declared with `extern library` here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -86,16 +86,16 @@ extern library "extern_library_owner" fn F(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+13]]:1: In import. +// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+13]]:1: in import // CHECK:STDERR: import library "extern_library"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library_copy.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: extern_library_copy.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+7]]:1: In import. +// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+7]]:1: in import // CHECK:STDERR: import library "extern_library"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: extern_library.carbon:4:1: name is previously declared here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -114,7 +114,7 @@ library "[[@TEST_NAME]]"; import library "extern_library_mismatch" -// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1: ERROR: `import` declarations must end with a `;`. +// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1: error: `import` declarations must end with a `;` // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -124,7 +124,7 @@ extern fn F(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+4]]:1: ERROR: `extern library` cannot specify the current library. +// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+4]]:1: error: `extern library` cannot specify the current library // CHECK:STDERR: extern library "extern_self_library" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -142,13 +142,13 @@ library "[[@TEST_NAME]]"; import library "extern_of_import"; -// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE+9]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. +// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE+9]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: extern library "extern_of_import" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "extern_of_import"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_of_import.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern_of_import.carbon:4:1: previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ extern library "extern_of_import" fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon index 005fe76642c38..de24722aa35bc 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon @@ -28,13 +28,13 @@ package Foo library "[[@TEST_NAME]]"; import library default; -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+9]]:1: ERROR: Declaration in library "wrong_library" doesn't match `extern library` declaration. +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+9]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: default.carbon:4:1: Previously declared with `extern library` here. +// CHECK:STDERR: default.carbon:4:1: previously declared with `extern library` here // CHECK:STDERR: extern library "expected" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extern fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon index 8b2219a8e2ec2..e2686711f83ae 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon @@ -26,13 +26,13 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+9]]:1: ERROR: Declaration in library "wrong_library" doesn't match `extern library` declaration. +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+9]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "extern_library"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern_library.carbon:4:1: Previously declared with `extern library` here. +// CHECK:STDERR: extern_library.carbon:4:1: previously declared with `extern library` here // CHECK:STDERR: extern library default fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extern fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index fc3c0f4bf0290..b450b77ba10f9 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -21,24 +21,24 @@ fn ReturnDUnused() -> D; fn ReturnDUsed() -> D; fn Call() { - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: ERROR: Function returns incomplete type `C`. + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `C` // CHECK:STDERR: ReturnCUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:18: Return type declared here. + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:18: return type declared here // CHECK:STDERR: fn ReturnCUsed() -> C; // CHECK:STDERR: ^~~~ // CHECK:STDERR: ReturnCUsed(); - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: ERROR: Function returns incomplete type `D`. + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `D` // CHECK:STDERR: ReturnDUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: class was forward declared here // CHECK:STDERR: class D; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:18: Return type declared here. + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:18: return type declared here // CHECK:STDERR: fn ReturnDUsed() -> D; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -54,36 +54,36 @@ library "[[@TEST_NAME]]"; import library "incomplete_return"; fn CallFAndGIncomplete() { - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+16]]:3: ERROR: Function returns incomplete type `C`. + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+16]]:3: error: function returns incomplete type `C` // CHECK:STDERR: ReturnCUnused(); // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1: In import. + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1: in import // CHECK:STDERR: import library "incomplete_return"; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:4:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete_return.carbon:4:1: class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-12]]:1: In import. + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-12]]:1: in import // CHECK:STDERR: import library "incomplete_return"; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:7:20: Return type declared here. + // CHECK:STDERR: fail_incomplete_return.carbon:7:20: return type declared here // CHECK:STDERR: fn ReturnCUnused() -> C; // CHECK:STDERR: ^~~~ // CHECK:STDERR: ReturnCUnused(); - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+15]]:3: ERROR: Function returns incomplete type `C`. + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+15]]:3: error: function returns incomplete type `C` // CHECK:STDERR: ReturnCUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1: In import. + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1: in import // CHECK:STDERR: import library "incomplete_return"; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:4:1: Class was forward declared here. + // CHECK:STDERR: fail_incomplete_return.carbon:4:1: class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-29]]:1: In import. + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-29]]:1: in import // CHECK:STDERR: import library "incomplete_return"; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:8:18: Return type declared here. + // CHECK:STDERR: fail_incomplete_return.carbon:8:18: return type declared here // CHECK:STDERR: fn ReturnCUsed() -> C; // CHECK:STDERR: ^~~~ ReturnCUsed(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon index 8a770517264c5..9709b3dbd8817 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon @@ -8,84 +8,84 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `default` not allowed on `fn` declaration outside of an interface. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `default` not allowed on `fn` declaration outside of an interface // CHECK:STDERR: default protected fn WrongOrder(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `protected` must appear before `default`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` must appear before `default` // CHECK:STDERR: default protected fn WrongOrder(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here // CHECK:STDERR: default protected fn WrongOrder(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default protected fn WrongOrder(); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `virtual` not allowed on `fn` declaration outside of a class. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `virtual` not allowed on `fn` declaration outside of a class // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `virtual` repeated on declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `virtual` repeated on declaration // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `virtual` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `virtual` previously appeared here // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `protected` not allowed on declaration with `private`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` not allowed on declaration with `private` // CHECK:STDERR: private protected fn TwoAccess(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here // CHECK:STDERR: private protected fn TwoAccess(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private protected fn TwoAccess(); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `abstract` not allowed on `fn` declaration outside of a class. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `abstract` not allowed on `fn` declaration outside of a class // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: ERROR: `virtual` not allowed on declaration with `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `virtual` not allowed on declaration with `abstract` // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `abstract` previously appeared here // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `base` not allowed on `fn` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `base` not allowed on `fn` declaration // CHECK:STDERR: base fn InvalidModifier(); // CHECK:STDERR: ^~~~ // CHECK:STDERR: base fn InvalidModifier(); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: ERROR: `default` not allowed on `fn` declaration outside of an interface. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: error: `default` not allowed on `fn` declaration outside of an interface // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:9: ERROR: `final` not allowed on declaration with `default`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:9: error: `final` not allowed on declaration with `default` // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: `default` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: `default` previously appeared here // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:15: ERROR: `virtual` not allowed on declaration with `default`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:15: error: `virtual` not allowed on declaration with `default` // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:8: ERROR: `private` must appear before `extern`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:8: error: `private` must appear before `extern` // CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `extern` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `extern` previously appeared here // CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDERR: ^~~~~~ extern private fn ExternOrderAndConflict() {} diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon index 422034455004b..e7569c43ab2d6 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon @@ -8,11 +8,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon -// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+7]]:6: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+7]]:6: error: expected name in binding pattern // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: ERROR: Semantics TODO: `Error recovery from keyword name.`. +// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: error: semantics TODO: `Error recovery from keyword name.` // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDERR: ^ fn F((a: {}, b: {}), c: {}); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon index 9d43a458fd5f9..4c7cc0f62c0b2 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon @@ -9,50 +9,50 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon fn A(); -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn A` is redundant. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn A` is redundant // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn A(); fn B(x: ()); -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn B` is redundant. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn B` is redundant // CHECK:STDERR: fn B(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: fn B(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fn B(x: ()); fn C(); -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter count of 1. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn C(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: Previously declared with parameter count of 0. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared with parameter count of 0 // CHECK:STDERR: fn C(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn C(x: ()); fn D() {} -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn D` is redundant. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn D` is redundant // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: fn D() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn D(); fn E() {} -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `fn E`. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+6]]:1: error: redefinition of `fn E` // CHECK:STDERR: fn E() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: Previously defined here. +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: previously defined here // CHECK:STDERR: fn E() {} // CHECK:STDERR: ^~~~~~~~ fn E() {} diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon index 1aaaf4d99669d..d6b1fced5240e 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon @@ -11,7 +11,7 @@ // --- fail_no_body.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_no_body.carbon:[[@LINE+4]]:1: ERROR: Semantics TODO: `function with positional parameters`. +// CHECK:STDERR: fail_no_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` // CHECK:STDERR: fn A; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -20,7 +20,7 @@ fn A; // --- fail_todo_brace_body.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+4]]:1: ERROR: Semantics TODO: `function with positional parameters`. +// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` // CHECK:STDERR: fn A { // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -31,11 +31,11 @@ fn A { // TODO: We don't have parsing support for this yet. library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+7]]:1: ERROR: Semantics TODO: `function with positional parameters`. +// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+7]]:1: error: semantics TODO: `function with positional parameters` // CHECK:STDERR: fn A => 0; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+3]]:6: ERROR: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+3]]:6: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: fn A => 0; // CHECK:STDERR: ^~ fn A => 0; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon index b88bb4446cc6e..0d55a85b55040 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon @@ -30,17 +30,17 @@ extern fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+14]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+14]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "extern_api"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: extern_api.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern_api.carbon:4:1: previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1: ERROR: No definition found for declaration in impl file +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -56,13 +56,13 @@ fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+9]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+9]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "extern_impl"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: extern_impl.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern_impl.carbon:4:1: previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ extern fn A(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon index 5a2ed6d02e460..6da5ee625bc5d 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon @@ -52,7 +52,7 @@ fn C(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: ERROR: No definition found for declaration in impl file +// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file // CHECK:STDERR: fn C(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -66,7 +66,7 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: No definition found for declaration in impl file +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ fn D(); diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 93034c3712ca4..d82ad2da7ca95 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -47,24 +47,24 @@ library "[[@TEST_NAME]]"; import library "fns"; -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `fn A` is redundant. +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+10]]:1: error: redeclaration of `fn A` is redundant // CHECK:STDERR: fn A() {}; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "fns"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fns.carbon:4:1: Previously declared here. +// CHECK:STDERR: fns.carbon:4:1: previously declared here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn A() {}; -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `fn B` is redundant. +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+10]]:1: error: redeclaration of `fn B` is redundant // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-16]]:1: In import. +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-16]]:1: in import // CHECK:STDERR: import library "fns"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fns.carbon:5:1: Previously declared here. +// CHECK:STDERR: fns.carbon:5:1: previously declared here // CHECK:STDERR: fn B(b: i32) -> i32 { return b; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -76,25 +76,25 @@ library "[[@TEST_NAME]]"; import library "extern"; -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "extern"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern.carbon:4:1: previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fn A(); -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-17]]:1: In import. +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-17]]:1: in import // CHECK:STDERR: import library "extern"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: extern.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern.carbon:4:1: previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -106,13 +106,13 @@ library "[[@TEST_NAME]]"; import library "fns"; -// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+9]]:1: ERROR: Redeclarations of `fn D` must match use of `extern`. +// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+9]]:1: error: redeclarations of `fn D` must match use of `extern` // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "fns"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fns.carbon:7:1: Previously declared here. +// CHECK:STDERR: fns.carbon:7:1: previously declared here // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ extern fn D(); diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index 4209af15f694e..7d86ef99a2c74 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -48,7 +48,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:13: ERROR: Name `Def` not found. +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:13: error: name `Def` not found // CHECK:STDERR: var f: () = Def(); // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -60,7 +60,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: ERROR: Name `Def` not found. +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: error: name `Def` not found // CHECK:STDERR: var f: () = Test.Def(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -78,7 +78,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; -// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:13: ERROR: Name `ForwardWithDef` not found. +// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:13: error: name `ForwardWithDef` not found // CHECK:STDERR: var f: () = ForwardWithDef(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: ERROR: Name `ForwardWithDef` not found. +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: error: name `ForwardWithDef` not found // CHECK:STDERR: var f: () = Test.ForwardWithDef(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -110,7 +110,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward"; -// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:13: ERROR: Name `Forward` not found. +// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:13: error: name `Forward` not found // CHECK:STDERR: var f: () = Forward(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -122,7 +122,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: ERROR: Name `Forward` not found. +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: error: name `Forward` not found // CHECK:STDERR: var f: () = Test.Forward(); // CHECK:STDERR: ^~~~~~~~~~~~ var f: () = Test.Forward(); diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon index cb3c0e0c4589e..6c55f238cbb16 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon @@ -38,10 +38,10 @@ extern fn F() {} library "[[@TEST_NAME]]"; extern fn F(); -// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE+7]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. +// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -52,10 +52,10 @@ fn F() {} library "[[@TEST_NAME]]"; fn F(); -// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE+7]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. +// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -66,18 +66,18 @@ extern fn F() {} library "[[@TEST_NAME]]"; extern fn F(); -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant. +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fn F(); -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-12]]:1: Previously declared here. +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-12]]:1: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -88,10 +88,10 @@ fn F() {} library "[[@TEST_NAME]]"; fn F() {} -// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+7]]:1: ERROR: Redeclaration of `fn F` is redundant. +// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -105,7 +105,7 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: `extern` entities must have a declaration in the API file. +// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error: `extern` entities must have a declaration in the API file // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ extern fn F() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon index fc1be380eabd4..87ab3f27d3f1b 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon @@ -54,13 +54,13 @@ extern fn F(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn F` must match use of `extern`. +// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+10]]:1: error: redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "two_file_impl_mismatch"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1: Previously declared here. +// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1: previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -82,7 +82,7 @@ import library "indirect_two_file_extern"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+4]]:1: ERROR: `extern` entities must have a declaration in the API file. +// CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+4]]:1: error: `extern` entities must have a declaration in the API file // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -104,7 +104,7 @@ impl library "[[@TEST_NAME]]"; import library "in_impl_extern"; -// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: `extern` entities must have a declaration in the API file. +// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error: `extern` entities must have a declaration in the API file // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ extern fn F() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon index d5006930eb403..5e08fb658d5ea 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon @@ -9,57 +9,57 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon fn F(); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter count of 1. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn F(x: ()) {} // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with parameter count of 0. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with parameter count of 0 // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn F(x: ()) {} fn G(x: ()); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter count of 0. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn G() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with parameter count of 1. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with parameter count of 1 // CHECK:STDERR: fn G(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fn G() {} fn H(x: ()); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: ERROR: Package `Core` implicitly referenced here, but not found. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: fn H(x: bool) {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: fn H(x: bool) {} fn I(); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because return type is `()`. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `()` // CHECK:STDERR: fn I() -> () { return (); } // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with no return type. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with no return type // CHECK:STDERR: fn I(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn I() -> () { return (); } fn J() -> (); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because no return type is provided. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because no return type is provided // CHECK:STDERR: fn J() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with return type `()`. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with return type `()` // CHECK:STDERR: fn J() -> (); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fn J() {} fn K() -> (); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: ERROR: Function redeclaration differs because return type is `{}`. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: error: function redeclaration differs because return type is `{}` // CHECK:STDERR: fn K() -> {} { return {}; } // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: Previously declared with return type `()`. +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: previously declared with return type `()` // CHECK:STDERR: fn K() -> (); // CHECK:STDERR: ^~~~~~~~~~~~~ fn K() -> {} { return {}; } diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon index aa7fa5ecb601d..faab2709109ed 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon fn F() {} -// CHECK:STDERR: fail_redef.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `fn F`. +// CHECK:STDERR: fail_redef.carbon:[[@LINE+6]]:1: error: redefinition of `fn F` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redef.carbon:[[@LINE-4]]:1: Previously defined here. +// CHECK:STDERR: fail_redef.carbon:[[@LINE-4]]:1: previously defined here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ fn F() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon index 260461b990fcb..00397ca248326 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon @@ -30,13 +30,13 @@ extern fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "extern_api"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: extern_api.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern_api.carbon:4:1: previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -52,13 +52,13 @@ fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclarations of `fn A` must match use of `extern`. +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+10]]:1: error: redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "extern_impl"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: extern_impl.carbon:4:1: Previously declared here. +// CHECK:STDERR: extern_impl.carbon:4:1: previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -74,13 +74,13 @@ fn A() {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `fn A` is redundant. +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+10]]:1: error: redeclaration of `fn A` is redundant // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "redecl_after_def"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: redecl_after_def.carbon:4:1: Previously declared here. +// CHECK:STDERR: redecl_after_def.carbon:4:1: previously declared here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -96,13 +96,13 @@ fn A() {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+10]]:1: ERROR: Redefinition of `fn A`. +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+10]]:1: error: redefinition of `fn A` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "redef_after_def"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: redef_after_def.carbon:4:1: Previously defined here. +// CHECK:STDERR: redef_after_def.carbon:4:1: previously defined here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -119,13 +119,13 @@ alias B = A; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+9]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn B() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "def_alias"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: def_alias.carbon:5:7: Name is previously declared here. +// CHECK:STDERR: def_alias.carbon:5:7: name is previously declared here // CHECK:STDERR: alias B = A; // CHECK:STDERR: ^ fn B() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index 010d81d25e3fb..80512c7fff48e 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -37,10 +37,10 @@ library "[[@TEST_NAME]]"; class C {} fn Foo(a: C); -// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:11: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:11: Comparing with previous declaration here. +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:11: comparing with previous declaration here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -80,10 +80,10 @@ class C {} alias D = C; fn Foo(a: C); -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:8: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:8: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn Foo(b: D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: previous declaration's corresponding parameter here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -97,10 +97,10 @@ class C {} alias D = C; fn Foo(a: C); -// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:11: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:11: Comparing with previous declaration here. +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:11: comparing with previous declaration here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -114,10 +114,10 @@ class C {} alias D = C; fn Foo[a: C](); -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:11: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here // CHECK:STDERR: fn Foo[a: D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:11: Comparing with previous declaration here. +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:11: comparing with previous declaration here // CHECK:STDERR: fn Foo[a: C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -156,14 +156,14 @@ library "[[@TEST_NAME]]"; class C {} fn Foo(a: const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:11: WARNING: `const` applied repeatedly to the same type has no additional effect. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:11: warning: `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: fn Foo(a: const (const C)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:17: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:17: error: redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: Comparing with previous declaration here. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: comparing with previous declaration here // CHECK:STDERR: fn Foo(a: const C); // CHECK:STDERR: ^ fn Foo(a: const (const C)) {} diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index eb70a284ee289..17fcc66c6381a 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -32,10 +32,10 @@ fn ExplicitAndAlsoDeduced(T:! type, x: T) -> T*; // TODO: This should presumably be accepted. We shouldn't deduce values for parameters with explicitly-specified values. fn CallExplicitAndAlsoDeduced(n: i32) -> i32* { - // CHECK:STDERR: fail_todo_explicit_vs_deduced.carbon:[[@LINE+7]]:10: ERROR: Inconsistent deductions for value of generic parameter `T`. + // CHECK:STDERR: fail_todo_explicit_vs_deduced.carbon:[[@LINE+7]]:10: error: inconsistent deductions for value of generic parameter `T` // CHECK:STDERR: return ExplicitAndAlsoDeduced(A, {}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_explicit_vs_deduced.carbon:[[@LINE-7]]:1: While deducing parameters of generic declared here. + // CHECK:STDERR: fail_todo_explicit_vs_deduced.carbon:[[@LINE-7]]:1: while deducing parameters of generic declared here // CHECK:STDERR: fn ExplicitAndAlsoDeduced(T:! type, x: T) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -59,10 +59,10 @@ library "[[@TEST_NAME]]"; fn TupleParam[T:! type](x: (T, i32)); fn CallTupleParam() { - // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE+7]]:3: ERROR: Cannot deduce value for generic parameter `T`. + // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` // CHECK:STDERR: TupleParam((1, 2)); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE-6]]:1: While deducing parameters of generic declared here. + // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE-6]]:1: while deducing parameters of generic declared here // CHECK:STDERR: fn TupleParam[T:! type](x: (T, i32)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -72,10 +72,10 @@ fn CallTupleParam() { fn StructParam[T:! type](x: {.a: T, .b: i32}); fn CallStructParam() { - // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE+7]]:3: ERROR: Cannot deduce value for generic parameter `T`. + // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` // CHECK:STDERR: StructParam({.a = 1, .b = 2}); // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE-6]]:1: While deducing parameters of generic declared here. + // CHECK:STDERR: fail_todo_deduce_nested.carbon:[[@LINE-6]]:1: while deducing parameters of generic declared here // CHECK:STDERR: fn StructParam[T:! type](x: {.a: T, .b: i32}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -91,10 +91,10 @@ library "[[@TEST_NAME]]"; fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U; fn CallImplicitNotDeducible() { - // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: ERROR: Cannot deduce value for generic parameter `U`. + // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `U` // CHECK:STDERR: ImplicitNotDeducible(42); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: While deducing parameters of generic declared here. + // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: while deducing parameters of generic declared here // CHECK:STDERR: fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -108,10 +108,10 @@ library "[[@TEST_NAME]]"; fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T; fn CallImplicitNotDeducible() { - // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+6]]:3: ERROR: Inconsistent deductions for value of generic parameter `T`. + // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+6]]:3: error: inconsistent deductions for value of generic parameter `T` // CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: While deducing parameters of generic declared here. + // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: while deducing parameters of generic declared here // CHECK:STDERR: fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ImplicitNotDeducible(42, {.x = 12}); diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index 9b6b270b82c8c..5ee0d3109752c 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon -// CHECK:STDERR: fail_todo_param_in_type.carbon:[[@LINE+3]]:24: ERROR: Semantics TODO: `symbolic array bound`. +// CHECK:STDERR: fail_todo_param_in_type.carbon:[[@LINE+3]]:24: error: semantics TODO: `symbolic array bound` // CHECK:STDERR: fn F(N:! i32, a: [i32; N]*); // CHECK:STDERR: ^ fn F(N:! i32, a: [i32; N]*); diff --git a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon index 33cc17d7a9282..cb0fb97481161 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon @@ -10,7 +10,7 @@ fn F(T:! type, U:! type) { var p: T*; - // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+3]]:3: ERROR: Package `Core` implicitly referenced here, but not found. + // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+3]]:3: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: let n: U = *p; // CHECK:STDERR: ^~~~~~~~~~~~~~ let n: U = *p; diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index bdea341e87339..e324b0d109172 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -24,18 +24,18 @@ library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:1: ERROR: Function redeclaration differs because return type is `U*`. +// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `U*` // CHECK:STDERR: fn F(T:! type, U:! type) -> U* { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-5]]:1: Previously declared with return type `T*`. +// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-5]]:1: previously declared with return type `T*` // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn F(T:! type, U:! type) -> U* { - // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:10: ERROR: 1 argument(s) passed to function expecting 2 argument(s). + // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-13]]:1: Calling function declared here. + // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-13]]:1: calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -48,18 +48,18 @@ library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(U:! type, T:! type) -> T* { // CHECK:STDERR: ^ -// CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^ // CHECK:STDERR: fn F(U:! type, T:! type) -> T* { - // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: ERROR: 1 argument(s) passed to function expecting 2 argument(s). + // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: error: 1 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_reorder.carbon:[[@LINE-13]]:1: Calling function declared here. + // CHECK:STDERR: fail_reorder.carbon:[[@LINE-13]]:1: calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -72,18 +72,18 @@ library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:6: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(U:! type, T:! type) -> U* { // CHECK:STDERR: ^ -// CHECK:STDERR: fail_rename.carbon:[[@LINE-5]]:6: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_rename.carbon:[[@LINE-5]]:6: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^ // CHECK:STDERR: fn F(U:! type, T:! type) -> U* { - // CHECK:STDERR: fail_rename.carbon:[[@LINE+6]]:10: ERROR: 1 argument(s) passed to function expecting 2 argument(s). + // CHECK:STDERR: fail_rename.carbon:[[@LINE+6]]:10: error: 1 argument(s) passed to function expecting 2 argument(s). // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_rename.carbon:[[@LINE-13]]:1: Calling function declared here. + // CHECK:STDERR: fail_rename.carbon:[[@LINE-13]]:1: calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return F(T); diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index c26de406fc7a2..9e03eaee0e585 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -13,7 +13,7 @@ fn If1(b: bool) -> i32 { return 1; } else { } -// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: ERROR: Missing `return` at end of function with declared return type. +// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: error: missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -24,7 +24,7 @@ fn If2(b: bool) -> i32 { } else { return 2; } -// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: ERROR: Missing `return` at end of function with declared return type. +// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: error: missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -34,7 +34,7 @@ fn If3(b: bool) -> i32 { if (b) { return 1; } -// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: ERROR: Missing `return` at end of function with declared return type. +// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 8e38708fb2a70..7095251f29fd6 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -13,7 +13,7 @@ fn VarScope(b: bool) -> i32 { var n: i32 = 2; return n; } - // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: ERROR: Name `n` not found. + // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: error: name `n` not found // CHECK:STDERR: return n; // CHECK:STDERR: ^ return n; diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index e209099aad768..061d4384f51c3 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -8,30 +8,30 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/if_expr/fail_not_in_function.carbon -// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+12]]:14: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+12]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+8]]:14: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+8]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+4]]:22: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+4]]:22: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: let x: i32 = if true then 1 else 0; class C { - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+11]]:10: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. + // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+11]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var n: if true then i32 else f64; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+7]]:10: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. + // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+7]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var n: if true then i32 else f64; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+3]]:18: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. + // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+3]]:18: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var n: if true then i32 else f64; // CHECK:STDERR: ^~~~~~~~ var n: if true then i32 else f64; diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index 7f6033a4a4402..0bcdf3370d804 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -16,7 +16,7 @@ fn ConditionIsNonConstant(b: bool) { // We choose to not accept this even if both arms evaluate to the same // constant value, because it notionally involves evaluating a non-constant // condition. - // CHECK:STDERR: fail_non_constant_condition.carbon:[[@LINE+4]]:10: ERROR: Cannot evaluate type expression. + // CHECK:STDERR: fail_non_constant_condition.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression // CHECK:STDERR: var v: if b then i32 else i32 = 1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -28,12 +28,12 @@ fn ConditionIsNonConstant(b: bool) { package NonConstantResult; fn ChosenBranchIsNonConstant(t: type) { - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: ERROR: Cannot evaluate type expression. + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression // CHECK:STDERR: var v: if true then t else i32 = 1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var v: if true then t else i32 = 1; - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+3]]:10: ERROR: Cannot evaluate type expression. + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression // CHECK:STDERR: var w: if false then i32 else t = 1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ var w: if false then i32 else t = 1; diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index afd292f6d83ef..1924b5aa58030 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -13,7 +13,7 @@ interface Simple { } impl i32 as Simple { - // CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+3]]:14: ERROR: Name `Undeclared` not found. + // CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+3]]:14: error: name `Undeclared` not found // CHECK:STDERR: fn G[self: Undeclared](); // CHECK:STDERR: ^~~~~~~~~~ fn G[self: Undeclared](); diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index 2eaedb74a934a..facfcf2a99208 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -13,7 +13,7 @@ interface GenericInterface(T:! type) { } class C { - // CHECK:STDERR: fail_extend_impl_forall.carbon:[[@LINE+3]]:3: ERROR: Cannot `extend` a parameterized `impl`. + // CHECK:STDERR: fail_extend_impl_forall.carbon:[[@LINE+3]]:3: error: cannot `extend` a parameterized `impl` // CHECK:STDERR: extend impl forall [T:! type] as GenericInterface(T) { // CHECK:STDERR: ^~~~~~ extend impl forall [T:! type] as GenericInterface(T) { diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index dafb2aeeea166..f0ef855d93471 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -10,7 +10,7 @@ interface I {} -// CHECK:STDERR: fail_extend_impl_scope.carbon:[[@LINE+3]]:1: ERROR: `extend impl` can only be used in a class. +// CHECK:STDERR: fail_extend_impl_scope.carbon:[[@LINE+3]]:1: error: `extend impl` can only be used in a class // CHECK:STDERR: extend impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ extend impl i32 as I {} diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index 32f64437de5c3..cc40e986ede0d 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -11,7 +11,7 @@ interface I {} class C { - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:3: ERROR: Cannot `extend` an `impl` with an explicit self type. + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:3: error: cannot `extend` an `impl` with an explicit self type // CHECK:STDERR: extend impl i32 as I {} // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -19,10 +19,10 @@ class C { } class D { - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+7]]:3: ERROR: Cannot `extend` an `impl` with an explicit self type. + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+7]]:3: error: cannot `extend` an `impl` with an explicit self type // CHECK:STDERR: extend impl D as I; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:15: Remove the explicit `Self` type here. + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:15: remove the explicit `Self` type here // CHECK:STDERR: extend impl D as I; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -30,10 +30,10 @@ class D { } class E { - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+6]]:3: ERROR: Cannot `extend` an `impl` with an explicit self type. + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+6]]:3: error: cannot `extend` an `impl` with an explicit self type // CHECK:STDERR: extend impl Self as I {} // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+3]]:15: Remove the explicit `Self` type here. + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+3]]:15: remove the explicit `Self` type here // CHECK:STDERR: extend impl Self as I {} // CHECK:STDERR: ^~~~ extend impl Self as I {} diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index cd633b481096d..4cd118390ecd5 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_extend_non_interface.carbon class C { - // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `extending non-interface constraint`. + // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+3]]:3: error: semantics TODO: `extending non-interface constraint` // CHECK:STDERR: extend impl as i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ extend impl as i32; diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index d39ca356061cf..872a40ac2b73d 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -10,10 +10,10 @@ interface I { class C { - // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+6]]:5: ERROR: `extend impl` requires a definition for interface `I`. + // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+6]]:5: error: `extend impl` requires a definition for interface `I` // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: Interface is currently being defined. + // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: interface is currently being defined // CHECK:STDERR: interface I { // CHECK:STDERR: ^~~~~~~~~~~~~ extend impl as I; diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index f28a57f0e91ea..adfddcff3971f 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -11,10 +11,10 @@ interface I; class C { - // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+6]]:3: ERROR: `extend impl` requires a definition for interface `I`. + // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+6]]:3: error: `extend impl` requires a definition for interface `I` // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-6]]:1: Interface was forward declared here. + // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-6]]:1: interface was forward declared here // CHECK:STDERR: interface I; // CHECK:STDERR: ^~~~~~~~~~~~ extend impl as I; diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 1d078b01be62e..81d1ae79c9071 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -12,7 +12,7 @@ interface Simple { fn F(); } -// CHECK:STDERR: fail_impl_as_scope.carbon:[[@LINE+3]]:6: ERROR: `impl as` can only be used in a class. +// CHECK:STDERR: fail_impl_as_scope.carbon:[[@LINE+3]]:6: error: `impl as` can only be used in a class // CHECK:STDERR: impl as Simple { // CHECK:STDERR: ^~ impl as Simple { diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon index 08e65962f60e1..07189f7305570 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon @@ -10,7 +10,7 @@ interface I { let T:! type; } -// CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+3]]:1: ERROR: Semantics TODO: `impl of interface with associated constant`. +// CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+3]]:1: error: semantics TODO: `impl of interface with associated constant` // CHECK:STDERR: impl bool as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~ impl bool as I {} diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index a47b0dce6f199..38ab1bc35c9a6 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -11,10 +11,10 @@ interface I { fn F(); } class NoF { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: ERROR: Missing implementation of F in impl of interface I. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: error: missing implementation of F in impl of interface I // CHECK:STDERR: impl as I {} // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: Associated function F declared here. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -23,10 +23,10 @@ class NoF { class FNotFunction { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Associated function F implemented by non-function. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: associated function F implemented by non-function // CHECK:STDERR: class F; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: Associated function F declared here. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -39,10 +39,10 @@ fn PossiblyF(); // TODO: Should this be permitted? class FAlias { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: ERROR: Associated function F implemented by non-function. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: error: associated function F implemented by non-function // CHECK:STDERR: alias F = PossiblyF; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: Associated function F declared here. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -52,10 +52,10 @@ class FAlias { class FExtraParam { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Redeclaration differs because of parameter count of 1. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn F(b: bool); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: Previously declared with parameter count of 0. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: previously declared with parameter count of 0 // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -65,10 +65,10 @@ class FExtraParam { class FExtraImplicitParam { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Redeclaration differs because of implicit parameter list. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of implicit parameter list // CHECK:STDERR: fn F[self: Self](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: Previously declared without implicit parameter list. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: previously declared without implicit parameter list // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -79,10 +79,10 @@ class FExtraImplicitParam { // TODO: Should this be permitted? class FExtraReturnType { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because return type is `bool`. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `bool` // CHECK:STDERR: fn F() -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: Previously declared with no return type. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: previously declared with no return type // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -94,10 +94,10 @@ interface J { fn F[self: bool](b: bool) -> bool; } class FMissingParam { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Redeclaration differs because of parameter count of 0. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn F[self: bool]() -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: Previously declared with parameter count of 1. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: previously declared with parameter count of 1 // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -107,10 +107,10 @@ class FMissingParam { class FMissingImplicitParam { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Redeclaration differs because of missing implicit parameter list. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of missing implicit parameter list // CHECK:STDERR: fn F(b: bool) -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: Previously declared with implicit parameter list. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: previously declared with implicit parameter list // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -120,10 +120,10 @@ class FMissingImplicitParam { class FMissingReturnType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because no return type is provided. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because no return type is provided // CHECK:STDERR: fn F[self: bool](b: bool); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: Previously declared with return type `bool`. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: previously declared with return type `bool` // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -133,10 +133,10 @@ class FMissingReturnType { class FDifferentParamType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: ERROR: Redeclaration differs at parameter 1. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F[self: bool](b: Self) -> bool; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: Previous declaration's corresponding parameter here. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: previous declaration's corresponding parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -146,10 +146,10 @@ class FDifferentParamType { class FDifferentImplicitParamType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: ERROR: Redeclaration differs at implicit parameter 1. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at implicit parameter 1 // CHECK:STDERR: fn F[self: Self](b: bool) -> bool; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: Previous declaration's corresponding implicit parameter here. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: previous declaration's corresponding implicit parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -159,10 +159,10 @@ class FDifferentImplicitParamType { class FDifferentReturnType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: ERROR: Function redeclaration differs because return type is `FDifferentReturnType`. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `FDifferentReturnType` // CHECK:STDERR: fn F[self: bool](b: bool) -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: Previously declared with return type `bool`. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: previously declared with return type `bool` // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -173,10 +173,10 @@ class FDifferentReturnType { // TODO: This should probably be permitted. class FDifferentParamName { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: ERROR: Redeclaration differs at parameter 1. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F[self: bool](not_b: bool) -> bool; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: Previous declaration's corresponding parameter here. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: previous declaration's corresponding parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -190,10 +190,10 @@ interface SelfNested { class SelfNestedBadParam { impl as SelfNested { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: ERROR: Redeclaration differs at parameter 1. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at parameter 1 // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4]; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: Previous declaration's corresponding parameter here. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: previous declaration's corresponding parameter here // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4]; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -203,10 +203,10 @@ class SelfNestedBadParam { class SelfNestedBadReturnType { impl as SelfNested { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: ERROR: Function redeclaration differs because return type is `[SelfNestedBadParam; 4]`. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: error: function redeclaration differs because return type is `[SelfNestedBadParam; 4]` // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: Previously declared with return type `[SelfNestedBadReturnType; 4]`. + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: previously declared with return type `[SelfNestedBadReturnType; 4]` // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4]; diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index 54602adfc8871..2f63ad428f222 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -8,14 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_impl_bad_interface.carbon -// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+10]]:1: ERROR: Semantics TODO: `impl as non-interface`. +// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+10]]:1: error: semantics TODO: `impl as non-interface` // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+6]]:13: ERROR: Cannot implicitly convert from `bool` to `type`. +// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+6]]:13: error: cannot implicitly convert from `bool` to `type` // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+3]]:13: Type `bool` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+3]]:13: type `bool` does not implement interface `ImplicitAs` // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~ impl i32 as false {} diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index ad9f7479cc2ab..0f2964464db76 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -12,10 +12,10 @@ interface I {} impl i32 as I {} -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `impl i32 as I`. +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `impl i32 as I` // CHECK:STDERR: impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: Previous definition was here. +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: previous definition was here // CHECK:STDERR: impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ impl i32 as I {} diff --git a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon index 0f424e53edb36..9f99d151f22cc 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -10,7 +10,7 @@ interface I { let T:! type; } -// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+3]]:14: ERROR: Semantics TODO: `HandleWhereOperand`. +// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+3]]:14: error: semantics TODO: `HandleWhereOperand` // CHECK:STDERR: impl bool as I where .T = bool {} // CHECK:STDERR: ^~~~~~~ impl bool as I where .T = bool {} diff --git a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon index 30754ddd64b99..748bc8cea4f85 100644 --- a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon @@ -17,12 +17,12 @@ class C { } fn F(c: C) { - // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+4]]:3: ERROR: Cannot access member of interface `I` in type `C` that does not implement that interface. + // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+4]]:3: error: cannot access member of interface `I` in type `C` that does not implement that interface // CHECK:STDERR: C.F(); // CHECK:STDERR: ^~~ // CHECK:STDERR: C.F(); - // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+3]]:3: ERROR: Cannot access member of interface `I` in type `C` that does not implement that interface. + // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+3]]:3: error: cannot access member of interface `I` in type `C` that does not implement that interface // CHECK:STDERR: c.F(); // CHECK:STDERR: ^~~ c.F(); diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 24150ca5965aa..ca5ec67a874fc 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -18,7 +18,7 @@ class C { fn F() -> i32 { // TODO: This should produce a more useful error message. - // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface `I` in type `C` that does not implement that interface. + // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `I` in type `C` that does not implement that interface // CHECK:STDERR: return C.F(); // CHECK:STDERR: ^~~ return C.F(); diff --git a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon index 3f34039b9f8c1..64c5a62ea631d 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon @@ -10,7 +10,7 @@ interface I {} -// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+3]]:6: ERROR: Package `Core` implicitly referenced here, but not found. +// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+3]]:6: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: impl true as I {} // CHECK:STDERR: ^~~~ impl true as I {} diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index 91d56bce6c9b8..d65de71d0ce10 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -36,7 +36,7 @@ fn G(a: A) { a.(Action(B).Op)(); } impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: ERROR: Cannot access member of interface `Action` in type `A` that does not implement that interface. +// CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: error: cannot access member of interface `Action` in type `A` that does not implement that interface // CHECK:STDERR: fn G(a: A) { a.(Action(C).Op)(); } // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -72,7 +72,7 @@ impl library "[[@TEST_NAME]]"; class C {} fn MakeC(a: A) -> C { - // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface `Factory` in type `A` that does not implement that interface. + // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Factory` in type `A` that does not implement that interface // CHECK:STDERR: return a.(Factory(C).Make)(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ return a.(Factory(C).Make)(); diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon index c0462d46c21bb..9796a16d2c52a 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon @@ -58,7 +58,7 @@ impl () as C; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: ERROR: No definition found for declaration in impl file +// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file // CHECK:STDERR: impl () as C; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -74,7 +74,7 @@ impl library "[[@TEST_NAME]]"; interface D {}; -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: ERROR: No definition found for declaration in impl file +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file // CHECK:STDERR: impl () as D; // CHECK:STDERR: ^~~~~~~~~~~~~ impl () as D; diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 572aeb7edb2b9..2736b9650c787 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -10,13 +10,13 @@ var a: [i32; 1] = (12,); -// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+4]]:16: ERROR: Array index `1` is past the end of type `[i32; 1]`. +// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+4]]:16: error: array index `1` is past the end of type `[i32; 1]` // CHECK:STDERR: var b: i32 = a[1]; // CHECK:STDERR: ^ // CHECK:STDERR: var b: i32 = a[1]; -// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+3]]:16: ERROR: Array index `2147483647` is past the end of type `[i32; 1]`. +// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+3]]:16: error: array index `2147483647` is past the end of type `[i32; 1]` // CHECK:STDERR: var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDERR: ^~~~~~~~~~~ var c: i32 = a[0x7FFF_FFFF]; 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 4761b296e58b1..e8e045c7c83e4 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_array_non_int_indexing.carbon var a: [i32; 1] = (12,); -// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+6]]:16: ERROR: Cannot implicitly convert from `f64` to `i32`. +// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+6]]:16: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: Type `f64` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ var b: i32 = a[2.6]; 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 79e5b57d255e2..b0fb962925114 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 @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon var a: [i32; 1] = (12,); -// CHECK:STDERR: fail_array_out_of_bound_access.carbon:[[@LINE+3]]:16: ERROR: Array index `1` is past the end of type `[i32; 1]`. +// CHECK:STDERR: fail_array_out_of_bound_access.carbon:[[@LINE+3]]:16: error: array index `1` is past the end of type `[i32; 1]` // CHECK:STDERR: var b: i32 = a[1]; // CHECK:STDERR: ^ var b: i32 = a[1]; diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 64152ed266f2d..cf331cd682107 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -12,12 +12,12 @@ fn F() -> [i32; 3]; fn G(b: [i32; 3]) { // Indexing an array value gives a value. - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error: cannot take the address of non-reference expression // CHECK:STDERR: var pb: i32* = &b[0]; // CHECK:STDERR: ^ // CHECK:STDERR: var pb: i32* = &b[0]; - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: error: expression is not assignable // CHECK:STDERR: b[0] = 4; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -25,12 +25,12 @@ fn G(b: [i32; 3]) { // Indexing an ephemeral reference (materialized from an initializing // expression) gives a value. - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error: cannot take the address of non-reference expression // CHECK:STDERR: var pf: i32* = &F()[0]; // CHECK:STDERR: ^ // CHECK:STDERR: var pf: i32* = &F()[0]; - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+3]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+3]]:3: error: expression is not assignable // CHECK:STDERR: F()[0] = 4; // CHECK:STDERR: ^~~~~~ F()[0] = 4; diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 5b99bff629f56..abd686ca28357 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -9,26 +9,26 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_invalid_base.carbon namespace N; -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: ERROR: Expression cannot be used as a value. +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error: expression cannot be used as a value // CHECK:STDERR: var a: i32 = N[0]; // CHECK:STDERR: ^ // CHECK:STDERR: var a: i32 = N[0]; fn F(); -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: ERROR: Expression cannot be used as a value. +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error: expression cannot be used as a value // CHECK:STDERR: var b: i32 = F[1]; // CHECK:STDERR: ^ // CHECK:STDERR: var b: i32 = F[1]; -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: ERROR: Type `{.a: i32, .b: i32}` does not support indexing. +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error: type `{.a: i32, .b: i32}` does not support indexing // CHECK:STDERR: var c: i32 = {.a = 1, .b = 2}[0]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var c: i32 = {.a = 1, .b = 2}[0]; -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:14: ERROR: Type `type` does not support indexing. +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:14: error: type `type` does not support indexing // CHECK:STDERR: var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ var d: i32 = {.a: i32, .b: i32}[0]; diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index d51f29a85b6ba..521fa2043bdf0 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_name_not_found.carbon fn Main() { - // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+3]]:16: ERROR: Name `a` not found. + // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+3]]:16: error: name `a` not found // CHECK:STDERR: var b: i32 = a[0]; // CHECK:STDERR: ^ var b: i32 = a[0]; diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 9fff5c3f159da..4f5f77d6ba24d 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_negative_indexing.carbon var c: [i32; 2] = (42, 42); -// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: ERROR: Cannot access member of interface `Negate` in type `i32` that does not implement that interface. +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: error: cannot access member of interface `Negate` in type `i32` that does not implement that interface // CHECK:STDERR: var d: i32 = c[-10]; // CHECK:STDERR: ^~~ var d: i32 = c[-10]; diff --git a/toolchain/check/testdata/index/fail_non_tuple_access.carbon b/toolchain/check/testdata/index/fail_non_tuple_access.carbon index 2b6d33bb9a55d..2c4c3a4fa284a 100644 --- a/toolchain/check/testdata/index/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_non_tuple_access.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_non_tuple_access.carbon fn Main() { - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:3: ERROR: Type `i32` does not support indexing. + // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:3: error: type `i32` does not support indexing // CHECK:STDERR: 0[1]; // CHECK:STDERR: ^~~~ 0[1]; diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index 2808b4f7fd2c7..fc31dec40b68b 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon interface I { - // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `i32` to `type`. + // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: Type `i32` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ let T:! type = 42; 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 f7be47c4e9ae0..04a71bd3e7138 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon interface I { - // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+4]]:3: ERROR: Semantics TODO: `interface modifier`. + // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` // CHECK:STDERR: default let T:! type = (i32, i32); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default let T:! type = (i32, i32); - // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `interface modifier`. + // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` // CHECK:STDERR: default let N:! i32 = 42; // CHECK:STDERR: ^~~~~~~ default let N:! i32 = 42; diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index ebd8e1d917c5f..b6179bb88e933 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon interface Interface { - // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+4]]:3: ERROR: Semantics TODO: `interface modifier`. + // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` // CHECK:STDERR: default fn F() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn F() {} - // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `interface modifier`. + // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~ default fn G(a: i32, b: i32) -> i32 = "int.sadd"; diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 09e4944e4d0b5..65e1d70be0788 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -11,32 +11,32 @@ // --- fail_todo_define_default_fn_out_of_line.carbon interface Interface { - // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+4]]:3: ERROR: Semantics TODO: `interface modifier`. + // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` // CHECK:STDERR: default fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn F(); - // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+4]]:3: ERROR: Semantics TODO: `interface modifier`. + // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32; } -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+7]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn Interface.F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-12]]:3: Name is previously declared here. +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-12]]:3: name is previously declared here // CHECK:STDERR: default fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fn Interface.F() {} -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+6]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-15]]:3: Name is previously declared here. +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-15]]:3: name is previously declared here // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon b/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon index 5727fa06d2315..c2fbf5b60c76f 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon @@ -10,7 +10,7 @@ interface Interface { } -// CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:14: ERROR: Out-of-line declaration requires a declaration in scoped entity. +// CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:14: error: out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn Interface.F() {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -19,13 +19,13 @@ fn Interface.F() {} // Nesting interfaces like this is not valid, but make sure we don't crash. interface Outer { interface Inner { - // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:8: ERROR: Name `Outer` not found. + // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:8: error: name `Outer` not found // CHECK:STDERR: fn Outer.F(); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fn Outer.F(); } - // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+3]]:12: ERROR: Out-of-line declaration requires a declaration in scoped entity. + // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+3]]:12: error: out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn Inner.F(); // CHECK:STDERR: ^ fn Inner.F(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon index 386e094720c7b..3492670e26b72 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon interface I { - // CHECK:STDERR: fail_assoc_const_not_binding.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `tuple pattern in let/var`. + // CHECK:STDERR: fail_assoc_const_not_binding.carbon:[[@LINE+3]]:3: error: semantics TODO: `tuple pattern in let/var` // CHECK:STDERR: let (T:! type, U:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ let (T:! type, U:! type); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon index 761e8059c6fdf..e00029fc47f9a 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon @@ -9,11 +9,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon interface I { - // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+7]]:7: ERROR: Pattern in associated constant declaration must be a single `:!` binding. + // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+7]]:7: error: pattern in associated constant declaration must be a single `:!` binding // CHECK:STDERR: let a: i32; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+3]]:10: ERROR: Package `Core` implicitly referenced here, but not found. + // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+3]]:10: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: let a: i32; // CHECK:STDERR: ^~~ let a: i32; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon index 497f29f65d535..2a588fdac67c4 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon interface I { - // CHECK:STDERR: fail_assoc_const_template.carbon:[[@LINE+3]]:7: ERROR: Semantics TODO: `HandleTemplate`. + // CHECK:STDERR: fail_assoc_const_template.carbon:[[@LINE+3]]:7: error: semantics TODO: `HandleTemplate` // CHECK:STDERR: let template T:! type; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ let template T:! type; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon index bb460f9bb5ab9..7d7e9ee1e470a 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon @@ -19,13 +19,13 @@ interface I; library "[[@TEST_NAME]]"; import library "a"; -// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface I {} // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "a"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: a.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: a.carbon:4:1: name is previously declared here // CHECK:STDERR: interface I; // CHECK:STDERR: ^~~~~~~~~~~~ interface I {} diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon index 88183e0a0f4da..0956acf41a6b0 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon @@ -14,10 +14,10 @@ library "[[@TEST_NAME]]"; interface Interface { } -// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE+7]]:1: ERROR: Redefinition of `interface Interface`. +// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE+7]]:1: error: redefinition of `interface Interface` // CHECK:STDERR: interface Interface { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE-5]]:1: Previously defined here. +// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE-5]]:1: previously defined here // CHECK:STDERR: interface Interface { } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,10 +31,10 @@ library "[[@TEST_NAME]]"; interface Interface {} -// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE+7]]:1: ERROR: Redefinition of `interface Interface`. +// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE+7]]:1: error: redefinition of `interface Interface` // CHECK:STDERR: interface Interface { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE-5]]:1: Previously defined here. +// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE-5]]:1: previously defined here // CHECK:STDERR: interface Interface {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -48,10 +48,10 @@ library "[[@TEST_NAME]]"; fn Function(); -// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE+7]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Function; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE-5]]:1: Name is previously declared here. +// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE-5]]:1: name is previously declared here // CHECK:STDERR: fn Function(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -61,10 +61,10 @@ interface Function; class Class; -// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE+6]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Class { } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE-5]]:1: Name is previously declared here. +// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE-5]]:1: name is previously declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ interface Class { } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon index dd5d11057882c..ef813502237d1 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon @@ -9,30 +9,30 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon interface NotGeneric; -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of parameter list. +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter list // CHECK:STDERR: interface NotGeneric(T:! type) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: Previously declared without parameter list. +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: previously declared without parameter list // CHECK:STDERR: interface NotGeneric; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: interface NotGeneric(T:! type) {} interface Generic(T:! type); -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: ERROR: Redeclaration differs because of missing parameter list. +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error: redeclaration differs because of missing parameter list // CHECK:STDERR: interface Generic {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: Previously declared with parameter list. +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: previously declared with parameter list // CHECK:STDERR: interface Generic(T:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: interface Generic {} interface DifferentParams(T:! type); -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+6]]:27: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+6]]:27: error: redeclaration differs at parameter 1 // CHECK:STDERR: interface DifferentParams(T:! ()) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:27: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:27: previous declaration's corresponding parameter here // CHECK:STDERR: interface DifferentParams(T:! type); // CHECK:STDERR: ^ interface DifferentParams(T:! ()) {} diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon index 57556582dc032..403dfcd1e5a6e 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon @@ -10,20 +10,20 @@ interface Undefined; -// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:4: ERROR: Cannot declare a member of undefined interface `Undefined`. +// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:4: error: cannot declare a member of undefined interface `Undefined` // CHECK:STDERR: fn Undefined.F(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-5]]:1: Interface was forward declared here. +// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-5]]:1: interface was forward declared here // CHECK:STDERR: interface Undefined; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn Undefined.F(); fn Test() { - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:3: ERROR: Member access into undefined interface `Undefined`. + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:3: error: member access into undefined interface `Undefined` // CHECK:STDERR: Undefined.G(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-15]]:1: Interface was forward declared here. + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-15]]:1: interface was forward declared here // CHECK:STDERR: interface Undefined; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,19 +31,19 @@ fn Test() { } interface BeingDefined { - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+11]]:13: ERROR: Member access into undefined interface `BeingDefined`. + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+11]]:13: error: member access into undefined interface `BeingDefined` // CHECK:STDERR: fn H() -> BeingDefined.T; // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-4]]:1: Interface is currently being defined. + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-4]]:1: interface is currently being defined // CHECK:STDERR: interface BeingDefined { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+4]]:13: ERROR: Name `T` not found. + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+4]]:13: error: name `T` not found // CHECK:STDERR: fn H() -> BeingDefined.T; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fn H() -> BeingDefined.T; - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+3]]:6: ERROR: Name `BeingDefined` not found. + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+3]]:6: error: name `BeingDefined` not found // CHECK:STDERR: fn BeingDefined.I(); // CHECK:STDERR: ^~~~~~~~~~~~ fn BeingDefined.I(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon index 1d22bbf0ade09..c634153de07db 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon @@ -15,13 +15,13 @@ interface Interface { } fn F() { - // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:3: ERROR: Value of type ` in Interface>` is not callable. + // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:3: error: value of type ` in Interface>` is not callable // CHECK:STDERR: Interface.F(); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: Interface.F(); - // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+3]]:10: ERROR: Package `Core` implicitly referenced here, but not found. + // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+3]]:10: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: var v: Interface.T; // CHECK:STDERR: ^~~~~~~~~~~ var v: Interface.T; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon index 146d99cf44dd4..5d7566b4dcde9 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon @@ -8,27 +8,27 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `abstract` not allowed on `interface` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `abstract` not allowed on `interface` declaration // CHECK:STDERR: abstract interface Abstract { // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract interface Abstract { } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `default` not allowed on `interface` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed on `interface` declaration // CHECK:STDERR: default interface Default; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default interface Default; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `virtual` not allowed on `interface` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `virtual` not allowed on `interface` declaration // CHECK:STDERR: virtual interface Virtual { // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: virtual interface Virtual { } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: ERROR: `protected` not allowed on `interface` declaration at file scope, `protected` is only allowed on class members. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `protected` not allowed on `interface` declaration at file scope, `protected` is only allowed on class members // CHECK:STDERR: protected interface Protected; // CHECK:STDERR: ^~~~~~~~~ protected interface Protected; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon index 98304d08d751f..f89ed760424b6 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon @@ -10,10 +10,10 @@ interface Interface { fn F(); - // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE+6]]:3: ERROR: Duplicate name being declared in the same scope. + // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE+6]]:3: error: duplicate name being declared in the same scope // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE-4]]:3: Name is previously declared here. + // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE-4]]:3: name is previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ fn F(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon index 51c70ba0d2e43..164b05acac0ea 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon @@ -11,7 +11,7 @@ interface Interface { fn F(); } fn CallStatic(T:! Interface) { - // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: ERROR: Value of type ` in Interface>` is not callable. + // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: error: value of type ` in Interface>` is not callable // CHECK:STDERR: T.F(); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -19,7 +19,7 @@ fn CallStatic(T:! Interface) { } fn CallFacet(T:! Interface, x: T) { - // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+3]]:3: ERROR: Type `T` does not support qualified expressions. + // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+3]]:3: error: type `T` does not support qualified expressions // CHECK:STDERR: x.F(); // CHECK:STDERR: ^~~ x.F(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index 8a20f77bc15a7..a5081732ef239 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -13,10 +13,10 @@ interface I(T:! type) { fn F[self: Self]() -> Self; } -// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE+6]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE-6]]:3: Name is previously declared here. +// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE-6]]:3: name is previously declared here // CHECK:STDERR: fn F[self: Self]() -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ fn I(T:! type).F[self: Self]() -> Self { return self; } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon index a63f39dee3fac..c3e9a73196972 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon interface Modifiers { - // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+4]]:3: ERROR: Semantics TODO: `interface modifier`. + // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` // CHECK:STDERR: final fn Final() { } // CHECK:STDERR: ^~~~~ // CHECK:STDERR: final fn Final() { } - // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `interface modifier`. + // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` // CHECK:STDERR: default fn Default() { } // CHECK:STDERR: ^~~~~~~ default fn Default() { } diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index f588fa9cfb03d..a953106a79c94 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -49,10 +49,10 @@ class B {} fn F(T:! Generic(A)); fn G(T:! Generic(B)) { // TODO: Include generic arguments in the type name. - // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+6]]:3: ERROR: Package `Core` implicitly referenced here, but not found. + // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+6]]:3: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-6]]:6: Initializing generic parameter `T` declared here. + // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-6]]:6: initializing generic parameter `T` declared here // CHECK:STDERR: fn F(T:! Generic(A)); // CHECK:STDERR: ^ F(T); diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index 25ab474bbf586..5eb685772fde9 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -32,7 +32,7 @@ impl X as C(X).GenericAndParams(X) {} library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:13: ERROR: Parameters of generic types must be constant. +// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:13: error: parameters of generic types must be constant // CHECK:STDERR: interface A[T: type]() {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -42,7 +42,7 @@ interface A[T: type]() {} library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:13: ERROR: Parameters of generic types must be constant. +// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:13: error: parameters of generic types must be constant // CHECK:STDERR: interface A(T: type) {} // CHECK:STDERR: ^ interface A(T: type) {} diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index 4f72b9769948a..25b7e375497c7 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -49,7 +49,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:9: ERROR: Name `Def` not found. +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:9: error: name `Def` not found // CHECK:STDERR: fn F(i: Def) {} // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -61,7 +61,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:9: ERROR: Name `Def` not found. +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:9: error: name `Def` not found // CHECK:STDERR: fn F(i: Test.Def) {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -79,7 +79,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; -// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:9: ERROR: Name `ForwardWithDef` not found. +// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:9: error: name `ForwardWithDef` not found // CHECK:STDERR: fn F(i: ForwardWithDef) {} // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -91,7 +91,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:9: ERROR: Name `ForwardWithDef` not found. +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:9: error: name `ForwardWithDef` not found // CHECK:STDERR: fn F(i: Test.ForwardWithDef) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -101,7 +101,7 @@ fn F(i: Test.ForwardWithDef) {} impl package Test library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+4]]:9: ERROR: Name `Forward` not found. +// CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+4]]:9: error: name `Forward` not found // CHECK:STDERR: fn F(i: Forward*) {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -115,7 +115,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward"; -// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: ERROR: Name `Forward` not found. +// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found // CHECK:STDERR: fn F(i: Forward*) {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -127,7 +127,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: ERROR: Name `Forward` not found. +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error: name `Forward` not found // CHECK:STDERR: fn F(i: Forward*) {} // CHECK:STDERR: ^~~~~~~ fn F(i: Forward*) {} diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index 5069fe824523f..83a8fe2b5e1f8 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -37,10 +37,10 @@ library "[[@TEST_NAME]]"; class C {} interface Foo(a:! C); -// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:19: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:19: Comparing with previous declaration here. +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:19: comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -69,24 +69,24 @@ interface Bar(a:! D); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+10]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Foo(a:! C) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "two_file"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: two_file.carbon:7:1: Name is previously declared here. +// CHECK:STDERR: two_file.carbon:7:1: name is previously declared here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: interface Foo(a:! C) {} -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+10]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Bar(a:! D) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-16]]:6: In import. +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-16]]:6: in import // CHECK:STDERR: impl library "two_file"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: two_file.carbon:8:1: Name is previously declared here. +// CHECK:STDERR: two_file.carbon:8:1: name is previously declared here // CHECK:STDERR: interface Bar(a:! D); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -100,10 +100,10 @@ class C {} alias D = C; interface Foo(a:! C); -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:15: ERROR: Redeclaration differs at parameter 1. +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration differs at parameter 1 // CHECK:STDERR: interface Foo(b:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:15: Previous declaration's corresponding parameter here. +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:15: previous declaration's corresponding parameter here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -117,10 +117,10 @@ class C {} alias D = C; interface Foo(a:! C); -// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:19: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:19: Comparing with previous declaration here. +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:19: comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -134,10 +134,10 @@ class C {} alias D = C; interface Foo[a:! C](); -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:19: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here // CHECK:STDERR: interface Foo[a:! D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:19: Comparing with previous declaration here. +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:19: comparing with previous declaration here // CHECK:STDERR: interface Foo[a:! C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -160,13 +160,13 @@ alias D = C; // TODO: This fails because importing interfaces doesn't work well. It should // fail due to `C` versus `D`, but may succeed if importing interfaces is fixed // before syntax matching on imports is supported. -// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE+10]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: interface Foo(a:! D) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE-10]]:6: In import. +// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE-10]]:6: in import // CHECK:STDERR: impl library "alias_two_file"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: alias_two_file.carbon:6:1: Name is previously declared here. +// CHECK:STDERR: alias_two_file.carbon:6:1: name is previously declared here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -179,14 +179,14 @@ library "[[@TEST_NAME]]"; class C {} interface Foo(a:! const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:19: WARNING: `const` applied repeatedly to the same type has no additional effect. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:19: warning: `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: interface Foo(a:! const (const C)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:25: ERROR: Redeclaration syntax differs here. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:25: error: redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:25: Comparing with previous declaration here. +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:25: comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! const C); // CHECK:STDERR: ^ interface Foo(a:! const (const C)) {} diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 41a1491598d06..1d40b74dbbb67 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -10,10 +10,10 @@ fn F() { let a: i32 = 1; - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: ERROR: Duplicate name being declared in the same scope. + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope // CHECK:STDERR: let a: i32 = 2; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: Name is previously declared here. + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: name is previously declared here // CHECK:STDERR: let a: i32 = 1; // CHECK:STDERR: ^ let a: i32 = 2; diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index b0e2213a2b67d..f644f40e9144a 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -11,18 +11,18 @@ // TODO: Should this be valid? fn F(a: i32) -> i32 { let T:! type = i32; - // CHECK:STDERR: fail_generic.carbon:[[@LINE+7]]:3: ERROR: Cannot implicitly convert from `i32` to `T`. + // CHECK:STDERR: fail_generic.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `T` // CHECK:STDERR: let x: T = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: Type `i32` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let x: T = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: let x: T = 5; - // CHECK:STDERR: fail_generic.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `T` to `i32`. + // CHECK:STDERR: fail_generic.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `T` to `i32` // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: Type `` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: type `` does not implement interface `ImplicitAs` // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ return x; diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 87671e84d4277..757d9194f7373 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -19,10 +19,10 @@ let T:! type = i32; impl package Implicit; // TODO: Should this be valid? -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+6]]:1: ERROR: Cannot implicitly convert from `i32` to `T`. +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `i32` to `T` // CHECK:STDERR: let a: T = 0; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:1: Type `i32` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:1: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let a: T = 0; // CHECK:STDERR: ^~~~~~~~~~~~~ let a: T = 0; diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index b7837c0008d1d..c98fe70f9d888 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -8,14 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_missing_value.carbon -// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+4]]:11: ERROR: Expected `=`; `let` declaration must have an initializer. +// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+4]]:11: error: expected `=`; `let` declaration must have an initializer // CHECK:STDERR: let n: i32; // CHECK:STDERR: ^ // CHECK:STDERR: let n: i32; fn F() { - // CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:13: ERROR: Expected `=`; `let` declaration must have an initializer. + // CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:13: error: expected `=`; `let` declaration must have an initializer // CHECK:STDERR: let n: i32; // CHECK:STDERR: ^ let n: i32; diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 17ba612fcb74e..59df1ef75aa8f 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -8,77 +8,77 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `protected` not allowed on `let` declaration at file scope, `protected` is only allowed on class members. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed on `let` declaration at file scope, `protected` is only allowed on class members // CHECK:STDERR: protected let b: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: protected let b: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `default` not allowed on `let` declaration outside of an interface. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed on `let` declaration outside of an interface // CHECK:STDERR: default let c: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default let c: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `final` not allowed on `let` declaration outside of an interface. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `final` not allowed on `let` declaration outside of an interface // CHECK:STDERR: final let d: i32 = 1; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: final let d: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `virtual` not allowed on `let` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `virtual` not allowed on `let` declaration // CHECK:STDERR: virtual let e: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: virtual let e: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `default` not allowed on `let` declaration outside of an interface. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `default` not allowed on `let` declaration outside of an interface // CHECK:STDERR: default final let f: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `final` not allowed on declaration with `default`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `final` not allowed on declaration with `default` // CHECK:STDERR: default final let f: i32 = 1; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here // CHECK:STDERR: default final let f: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default final let f: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `default` not allowed on `let` declaration outside of an interface. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `default` not allowed on `let` declaration outside of an interface // CHECK:STDERR: default default let g: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `default` repeated on declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `default` repeated on declaration // CHECK:STDERR: default default let g: i32 = 1; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `default` previously appeared here // CHECK:STDERR: default default let g: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default default let g: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `protected` not allowed on `let` declaration at file scope, `protected` is only allowed on class members. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `protected` not allowed on `let` declaration at file scope, `protected` is only allowed on class members // CHECK:STDERR: protected private let h: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: ERROR: `private` not allowed on declaration with `protected`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: error: `private` not allowed on declaration with `protected` // CHECK:STDERR: protected private let h: i32 = 1; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `protected` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `protected` previously appeared here // CHECK:STDERR: protected private let h: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: protected private let h: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+10]]:1: ERROR: `protected` not allowed on `let` declaration at file scope, `protected` is only allowed on class members. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+10]]:1: error: `protected` not allowed on `let` declaration at file scope, `protected` is only allowed on class members // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:11: ERROR: `protected` repeated on declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:11: error: `protected` repeated on declaration // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `protected` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: `protected` previously appeared here // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ protected protected let i: i32 = 1; diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index dda4189519f34..83d6fdb30dcad 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_use_in_init.carbon fn F() { - // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+3]]:16: ERROR: Name `a` not found. + // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+3]]:16: error: name `a` not found // CHECK:STDERR: let a: i32 = a; // CHECK:STDERR: ^ let a: i32 = a; diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index 17f4123e6c608..c2b451cf46f27 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -34,7 +34,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:14: ERROR: Name `v` not found. +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:14: error: name `v` not found // CHECK:STDERR: let v2: () = v; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -46,7 +46,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: ERROR: Name `v` not found. +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: name `v` not found // CHECK:STDERR: let v2: () = Test.v; // CHECK:STDERR: ^~~~~~ let v2: () = Test.v; diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index a7c2d07ef2e08..c671aa1897da5 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -24,13 +24,13 @@ import library "namespace"; // imported declaration. namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+10]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-9]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-9]]:1: in import // CHECK:STDERR: import library "namespace"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: namespace.carbon:4:1: name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -40,13 +40,13 @@ fn NS(); // we don't move it. namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-25]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-25]]:1: in import // CHECK:STDERR: import library "namespace"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: namespace.carbon:4:1: name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ fn NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index 3dbd62b6d9c21..774c095947555 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -20,13 +20,13 @@ package Example; import library "namespace"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "namespace"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: namespace.carbon:4:1: name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ fn NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon index 0687e227580c2..e4c20dbd745a0 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon @@ -16,21 +16,21 @@ namespace Nested; // --- fail_conflict.carbon import Other; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-4]]:1: Name is previously declared here. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-4]]:1: name is previously declared here // CHECK:STDERR: import Other; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: namespace Other; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:10: ERROR: Imported packages cannot be used for declarations. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:10: error: imported packages cannot be used for declarations // CHECK:STDERR: fn Other.Nested.F(); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-12]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-12]]:1: in import // CHECK:STDERR: import Other; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:3:1: Package imported here. +// CHECK:STDERR: fn.carbon:3:1: package imported here // CHECK:STDERR: namespace Nested; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ fn Other.Nested.F(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index 7720ced879de0..91496bf841cc0 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -20,25 +20,25 @@ package Example; import library "fn"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+10]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: fn.carbon:4:1: name is previously declared here // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:4: ERROR: Name qualifiers are only allowed for entities that provide a scope. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+9]]:4: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn NS.Foo(); // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-17]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-17]]:1: in import // CHECK:STDERR: import library "fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: Referenced non-scope entity declared here. +// CHECK:STDERR: fn.carbon:4:1: referenced non-scope entity declared here // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ fn NS.Foo(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index f2f2a4f930387..571146f4afc05 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -25,16 +25,16 @@ fn NS() {} package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import library "namespace"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fn.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn NS() {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import library "namespace"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: namespace.carbon:4:1: name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ import library "namespace"; diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index 5a4bdcf6c2a81..eeb3a57fd8d10 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -25,16 +25,16 @@ fn NS.Foo() {} package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import library "fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: namespace.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: namespace.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import library "fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: fn.carbon:4:1: name is previously declared here // CHECK:STDERR: fn NS() {} // CHECK:STDERR: ^~~~~~~~~ import library "fn"; diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 13357c314acaa..51c9989142e1e 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -13,10 +13,10 @@ namespace NS; alias ns = NS; // Aliases can't be used when declaring names. -// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE+6]]:4: ERROR: Name qualifiers are only allowed for entities that provide a scope. +// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE+6]]:4: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn ns.A() -> i32 { return 0; } // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE-6]]:7: Referenced non-scope entity declared here. +// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE-6]]:7: referenced non-scope entity declared here // CHECK:STDERR: alias ns = NS; // CHECK:STDERR: ^~ fn ns.A() -> i32 { return 0; } diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index 6c543f51928ef..f43401601a496 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -13,10 +13,10 @@ namespace Foo; fn Foo.Baz() { } -// CHECK:STDERR: fail_duplicate.carbon:[[@LINE+6]]:1: ERROR: Redefinition of `fn Baz`. +// CHECK:STDERR: fail_duplicate.carbon:[[@LINE+6]]:1: error: redefinition of `fn Baz` // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_duplicate.carbon:[[@LINE-6]]:1: Previously defined here. +// CHECK:STDERR: fail_duplicate.carbon:[[@LINE-6]]:1: previously defined here // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~~~~~~~~~~~~ fn Foo.Baz() { diff --git a/toolchain/check/testdata/namespace/fail_modifiers.carbon b/toolchain/check/testdata/namespace/fail_modifiers.carbon index 51542f2153872..06299919e8545 100644 --- a/toolchain/check/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/check/testdata/namespace/fail_modifiers.carbon @@ -8,48 +8,48 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/namespace/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+33]]:1: ERROR: `private` not allowed on `namespace` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+33]]:1: error: `private` not allowed on `namespace` declaration // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+29]]:9: ERROR: `extern` not allowed on `namespace` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+29]]:9: error: `extern` not allowed on `namespace` declaration // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:16: ERROR: `abstract` not allowed on `namespace` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:16: error: `abstract` not allowed on `namespace` declaration // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:25: ERROR: `base` not allowed on declaration with `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:25: error: `base` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:16: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:16: `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:30: ERROR: `default` not allowed on declaration with `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:30: error: `default` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:16: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:16: `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:38: ERROR: `final` not allowed on declaration with `abstract`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:38: error: `final` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:16: `abstract` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:16: `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: private extern abstract base default final namespace A; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `impl` not allowed on `namespace` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `impl` not allowed on `namespace` declaration // CHECK:STDERR: impl namespace B; // CHECK:STDERR: ^~~~ // CHECK:STDERR: impl namespace B; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: ERROR: `extern` not allowed on `namespace` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `extern` not allowed on `namespace` declaration // CHECK:STDERR: extern namespace C; // CHECK:STDERR: ^~~~~~ extern namespace C; diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index 049d755023186..f47078e3a16e9 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/namespace/fail_params.carbon -// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: ERROR: `namespace` declaration cannot have parameters. +// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error: `namespace` declaration cannot have parameters // CHECK:STDERR: namespace A(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -17,23 +17,23 @@ namespace A(); // Parameters are ignored for error recovery. fn A.F() {} -// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: ERROR: `namespace` declaration cannot have parameters. +// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error: `namespace` declaration cannot have parameters // CHECK:STDERR: namespace B(n: i32); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: namespace B(n: i32); -// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: ERROR: `namespace` declaration cannot have parameters. +// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error: `namespace` declaration cannot have parameters // CHECK:STDERR: namespace C[T:! type](x: T); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: namespace C[T:! type](x: T); namespace D; -// CHECK:STDERR: fail_params.carbon:[[@LINE+6]]:4: ERROR: Redeclaration differs because of parameter list. +// CHECK:STDERR: fail_params.carbon:[[@LINE+6]]:4: error: redeclaration differs because of parameter list // CHECK:STDERR: fn D(T:! type).F() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_params.carbon:[[@LINE-4]]:1: Previously declared without parameter list. +// CHECK:STDERR: fail_params.carbon:[[@LINE-4]]:1: previously declared without parameter list // CHECK:STDERR: namespace D; // CHECK:STDERR: ^~~~~~~~~~~~ fn D(T:! type).F() {} diff --git a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon index 1eb2872e323e1..d8750b0986298 100644 --- a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon +++ b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/namespace/fail_unresolved_scope.carbon -// CHECK:STDERR: fail_unresolved_scope.carbon:[[@LINE+3]]:4: ERROR: Name `Foo` not found. +// CHECK:STDERR: fail_unresolved_scope.carbon:[[@LINE+3]]:4: error: name `Foo` not found // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~ fn Foo.Baz() { diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index ec5ef6eb284d9..46db4938c9222 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -14,29 +14,29 @@ fn F(b: bool) -> type { } // TODO: Short-circuit operators should be permitted outside functions. -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+12]]:11: ERROR: Cannot evaluate type expression. +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+12]]:11: error: cannot evaluate type expression // CHECK:STDERR: var and_: F(true and true); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:13: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var and_: F(true and true); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+4]]:13: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+4]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var and_: F(true and true); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: var and_: F(true and true); -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+11]]:10: ERROR: Cannot evaluate type expression. +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+11]]:10: error: cannot evaluate type expression // CHECK:STDERR: var or_: F(true or true); // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+7]]:12: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+7]]:12: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var or_: F(true or true); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+3]]:12: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+3]]:12: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var or_: F(true or true); // CHECK:STDERR: ^~~~~~~~~~~~ var or_: F(true or true); diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon index cb75d0735bfe5..5b2eec34b7211 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon @@ -13,12 +13,12 @@ package FailNonConstantResult; fn PartialConstant(x: bool) { - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: ERROR: Cannot evaluate type expression. + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression // CHECK:STDERR: var a: if true and x then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var a: if true and x then bool else (); - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: ERROR: Cannot evaluate type expression. + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression // CHECK:STDERR: var b: if false or x then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -32,12 +32,12 @@ package FailDespiteKnownResult; fn KnownValueButNonConstantCondition(x: bool) { // We choose not to give these cases constant values, even though we could, // because they notionally involve evaluating a non-constant condition. - // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:10: ERROR: Cannot evaluate type expression. + // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression // CHECK:STDERR: var c: if x and false then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var c: if x and false then bool else (); - // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+3]]:10: ERROR: Cannot evaluate type expression. + // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression // CHECK:STDERR: var d: if x or true then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var d: if x or true then bool else (); diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon index 7f38ec7e3c8e1..50c3bd144ce91 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon fn Main() { - // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+4]]:3: ERROR: Name `undeclared` not found. + // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+4]]:3: error: name `undeclared` not found // CHECK:STDERR: undeclared = 42; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: undeclared = 42; - // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+3]]:4: ERROR: Name `also_undeclared` not found. + // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+3]]:4: error: name `also_undeclared` not found // CHECK:STDERR: *also_undeclared = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~ *also_undeclared = 42; 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 33f4af64824ae..ca2c8a420682b 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 @@ -11,38 +11,38 @@ fn F() -> i32; fn Main() { - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable // CHECK:STDERR: 1 = 2; // CHECK:STDERR: ^ // CHECK:STDERR: 1 = 2; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable // CHECK:STDERR: F() = 1; // CHECK:STDERR: ^~~ // CHECK:STDERR: F() = 1; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable // CHECK:STDERR: (1, 2) = (3, 4); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: (1, 2) = (3, 4); var n: i32 = 0; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable // CHECK:STDERR: (n, n) = (1, 2); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: (n, n) = (1, 2); - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable // CHECK:STDERR: i32 = i32*; // CHECK:STDERR: ^~~ // CHECK:STDERR: i32 = i32*; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable // CHECK:STDERR: {.x = 1, .y = 2} = {.x = 3, .y = 4}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: {.x = 1, .y = 2} = {.x = 3, .y = 4}; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable // CHECK:STDERR: (if true then 1 else 2) = 3; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -50,7 +50,7 @@ fn Main() { // Under #911, if expressions are never reference expressions. var a: i32; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+3]]:3: ERROR: Expression is not assignable. + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+3]]:3: error: expression is not assignable // CHECK:STDERR: (if true then a else a) = 10; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ (if true then a else a) = 10; 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 9df9dd73f5b22..2806fb69998e9 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -12,12 +12,12 @@ fn F() -> i32 { return 0; } fn Main() { var a: i32 = 3; - // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+4]]:7: ERROR: Member name of type `i32` in compound member access is not an instance member or an interface member. + // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+4]]:7: error: member name of type `i32` in compound member access is not an instance member or an interface member // CHECK:STDERR: a = a.(a); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: a = a.(a); - // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+3]]:7: ERROR: Member name of type `` in compound member access is not an instance member or an interface member. + // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+3]]:7: error: member name of type `` in compound member access is not an instance member or an interface member // CHECK:STDERR: a = a.(F)(); // CHECK:STDERR: ^~~~~ a = a.(F)(); diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 599bb8b88e620..9764e11174bbe 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon fn Main() { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:17: ERROR: Cannot implicitly convert from `i32` to `bool`. + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `i32` to `bool` // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: Type `i32` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ var x: bool = not 12; 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 19f9b29036913..e78631b1e6d36 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -10,10 +10,10 @@ fn Main() { var a: i32 = 3; - // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`. + // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: Type `f64` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ a = 5.6; diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index 0af5fcb5882e4..3718293350835 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -11,11 +11,11 @@ fn Main() -> i32 { // The following line has two mismatches, but after the first, it shouldn't // keep erroring. - // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+7]]:10: ERROR: Cannot access member of interface `Add` in type `i32` that does not implement that interface. + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+7]]:10: error: cannot access member of interface `Add` in type `i32` that does not implement that interface // CHECK:STDERR: return 12 + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface `Add` in type `` that does not implement that interface. + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Add` in type `` that does not implement that interface // CHECK:STDERR: return 12 + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~~~~~~ return 12 + 3.4 + 12; diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index 50c84f3574028..450463495ec46 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface `Add` in type `i32` that does not implement that interface. + // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Add` in type `i32` that does not implement that interface // CHECK:STDERR: return 12 + 34; // CHECK:STDERR: ^~~~~~~ return 12 + 34; diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 174a55b9917c6..68213563f1d2a 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -34,7 +34,7 @@ package FailNoImpl; class D {}; fn TestEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface `Eq` in type `D` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface // CHECK:STDERR: return a == b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ fn TestEqual(a: D, b: D) -> bool { } fn TestNotEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface `Eq` in type `D` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface // CHECK:STDERR: return a != b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -62,13 +62,13 @@ impl C as Core.Eq { } fn TestRhsBad(a: C, b: D) -> bool { - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+10]]:10: ERROR: Cannot implicitly convert from `D` to `C`. + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+10]]:10: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: return a == b; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:10: Type `D` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:10: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: return a == b; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-11]]:3: Initializing parameter 1 of function declared here. + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-11]]:3: initializing parameter 1 of function declared here // CHECK:STDERR: fn Equal[self: C](other: C) -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -76,7 +76,7 @@ fn TestRhsBad(a: C, b: D) -> bool { } fn TestLhsBad(a: D, b: C) -> bool { - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface `Eq` in type `D` that does not implement that interface. + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface // CHECK:STDERR: return a != b; // CHECK:STDERR: ^~~~~~ return a != b; diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index 71bd4c588e193..a7c65de7b7b13 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -20,10 +20,10 @@ impl C as Core.AddAssign { } fn TestIncNonRef(a: C) { - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+7]]:3: ERROR: `addr self` method cannot be invoked on a value. + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+7]]:3: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: ++a; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:14: Initializing `addr self` parameter of method declared here. + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:14: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn Op[addr self: C*](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -31,10 +31,10 @@ fn TestIncNonRef(a: C) { } fn TestAddAssignNonRef(a: C, b: C) { - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+6]]:5: ERROR: `addr self` method cannot be invoked on a value. + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+6]]:5: error: `addr self` method cannot be invoked on a value // CHECK:STDERR: a += b; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:14: Initializing `addr self` parameter of method declared here. + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:14: initializing `addr self` parameter of method declared here // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~ a += b; diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index 53b76dc45aae9..7f750ce4420a3 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -13,7 +13,7 @@ package User; class C {}; fn TestUnary(a: C) -> C { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface `Negate` in type `C` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Negate` in type `C` that does not implement that interface // CHECK:STDERR: return -a; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -21,7 +21,7 @@ fn TestUnary(a: C) -> C { } fn TestBinary(a: C, b: C) -> C { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface `Add` in type `C` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Add` in type `C` that does not implement that interface // CHECK:STDERR: return a + b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -30,12 +30,12 @@ fn TestBinary(a: C, b: C) -> C { fn TestRef(b: C) { var a: C = {}; - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:3: ERROR: Cannot access member of interface `AddAssign` in type `C` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:3: error: cannot access member of interface `AddAssign` in type `C` that does not implement that interface // CHECK:STDERR: a += b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: a += b; - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:3: ERROR: Cannot access member of interface `Inc` in type `C` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:3: error: cannot access member of interface `Inc` in type `C` that does not implement that interface // CHECK:STDERR: ++a; // CHECK:STDERR: ^~~ ++a; diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 7ed217656b5a5..2cedd2b2506e3 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -21,13 +21,13 @@ impl C as Core.AddAssign { } fn Test(a: C, b: D) -> C { - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:10: ERROR: Cannot implicitly convert from `D` to `C`. + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:10: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: return a + b; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:10: Type `D` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:10: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: return a + b; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-13]]:3: Initializing parameter 1 of function declared here. + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-13]]:3: initializing parameter 1 of function declared here // CHECK:STDERR: fn Op[self: C](other: C) -> C; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -36,13 +36,13 @@ fn Test(a: C, b: D) -> C { fn TestAssign(b: D) { var a: C = {}; - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:3: ERROR: Cannot implicitly convert from `D` to `C`. + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `D` to `C` // CHECK:STDERR: a += b; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:3: Type `D` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:3: type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: a += b; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:3: Initializing parameter 1 of function declared here. + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:3: initializing parameter 1 of function declared here // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a += b; diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index bc3cc616ef6ca..01a8b513d72bc 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -44,7 +44,7 @@ package FailNoImpl; class D {}; fn TestLess(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface `Ordered` in type `D` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface // CHECK:STDERR: return a < b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ fn TestLess(a: D, b: D) -> bool { } fn TestLessEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface `Ordered` in type `D` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface // CHECK:STDERR: return a <= b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -60,7 +60,7 @@ fn TestLessEqual(a: D, b: D) -> bool { } fn TestGreater(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface `Ordered` in type `D` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface // CHECK:STDERR: return a > b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ fn TestGreater(a: D, b: D) -> bool { } fn TestGreaterEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface `Ordered` in type `D` that does not implement that interface. + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface // CHECK:STDERR: return a >= b; // CHECK:STDERR: ^~~~~~ return a >= b; diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 27ba0e420428f..9af6c13f5d3a7 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/package_expr/fail_not_found.carbon fn Main() { - // CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:16: ERROR: Name `x` not found. + // CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:16: error: name `x` not found // CHECK:STDERR: var y: i32 = package.x; // CHECK:STDERR: ^~~~~~~~~ var y: i32 = package.x; diff --git a/toolchain/check/testdata/packages/fail_api_not_found.carbon b/toolchain/check/testdata/packages/fail_api_not_found.carbon index b719211ccabf8..17846b621ca02 100644 --- a/toolchain/check/testdata/packages/fail_api_not_found.carbon +++ b/toolchain/check/testdata/packages/fail_api_not_found.carbon @@ -10,7 +10,7 @@ // --- fail_no_api.impl.carbon -// CHECK:STDERR: fail_no_api.impl.carbon:[[@LINE+4]]:6: ERROR: Corresponding API for 'Foo' not found. +// CHECK:STDERR: fail_no_api.impl.carbon:[[@LINE+4]]:6: error: corresponding API for 'Foo' not found // CHECK:STDERR: impl package Foo; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ impl package Foo; // --- fail_no_api_lib.impl.carbon -// CHECK:STDERR: fail_no_api_lib.impl.carbon:[[@LINE+4]]:6: ERROR: Corresponding API for 'Foo//no_api_lib' not found. +// CHECK:STDERR: fail_no_api_lib.impl.carbon:[[@LINE+4]]:6: error: corresponding API for 'Foo//no_api_lib' not found // CHECK:STDERR: impl package Foo library "no_api_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -26,7 +26,7 @@ impl package Foo library "[[@TEST_NAME]]"; // --- fail_no_api_main_lib.impl.carbon -// CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+3]]:6: ERROR: Corresponding API for 'Main//no_api_main_lib' not found. +// CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+3]]:6: error: corresponding API for 'Main//no_api_main_lib' not found // CHECK:STDERR: impl library "no_api_main_lib"; // CHECK:STDERR: ^~~~~~~ impl library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index ec337f779ccc4..868628b1036d4 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -24,16 +24,16 @@ var Foo: i32; package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import library "fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: var.carbon:4:5: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: var.carbon:4:5: error: duplicate name being declared in the same scope // CHECK:STDERR: var Foo: i32; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import library "fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fn.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: fn.carbon:4:1: name is previously declared here // CHECK:STDERR: fn Foo(); // CHECK:STDERR: ^~~~~~~~~ import library "fn"; diff --git a/toolchain/check/testdata/packages/fail_cycle.carbon b/toolchain/check/testdata/packages/fail_cycle.carbon index 4a83070fc46f1..c67865a5ce01d 100644 --- a/toolchain/check/testdata/packages/fail_cycle.carbon +++ b/toolchain/check/testdata/packages/fail_cycle.carbon @@ -12,7 +12,7 @@ package A; -// CHECK:STDERR: fail_a.carbon:[[@LINE+4]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import. +// CHECK:STDERR: fail_a.carbon:[[@LINE+4]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ import B; package B; -// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import. +// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: import C; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -32,7 +32,7 @@ import C; package C; -// CHECK:STDERR: fail_c.carbon:[[@LINE+4]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import. +// CHECK:STDERR: fail_c.carbon:[[@LINE+4]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: import A; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -40,7 +40,7 @@ import A; // --- fail_c.impl.carbon -// CHECK:STDERR: fail_c.impl.carbon:[[@LINE+4]]:6: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import. +// CHECK:STDERR: fail_c.impl.carbon:[[@LINE+4]]:6: error: import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: impl package C; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -50,7 +50,7 @@ impl package C; package CycleChild; -// CHECK:STDERR: fail_cycle_child.carbon:[[@LINE+3]]:1: ERROR: Import cannot be used due to a cycle. Cycle must be fixed to import. +// CHECK:STDERR: fail_cycle_child.carbon:[[@LINE+3]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ import B; diff --git a/toolchain/check/testdata/packages/fail_duplicate_api.carbon b/toolchain/check/testdata/packages/fail_duplicate_api.carbon index d2c3090b40734..5f9029a3847a5 100644 --- a/toolchain/check/testdata/packages/fail_duplicate_api.carbon +++ b/toolchain/check/testdata/packages/fail_duplicate_api.carbon @@ -7,7 +7,7 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_duplicate_api.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_duplicate_api.carbon -// CHECK:STDERR: fail_main2.carbon: ERROR: Main//default previously provided by `main1.carbon`. +// CHECK:STDERR: fail_main2.carbon: error: `Main//default` previously provided by `main1.carbon` // CHECK:STDERR: // --- main1.carbon @@ -20,7 +20,7 @@ library "lib"; // --- fail_main_lib2.carbon -// CHECK:STDERR: fail_main_lib2.carbon:[[@LINE+4]]:1: ERROR: Library's API previously provided by `main_lib1.carbon`. +// CHECK:STDERR: fail_main_lib2.carbon:[[@LINE+4]]:1: error: library's API previously provided by `main_lib1.carbon` // CHECK:STDERR: library "lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -32,7 +32,7 @@ package Package; // --- fail_package2.carbon -// CHECK:STDERR: fail_package2.carbon:[[@LINE+4]]:1: ERROR: Library's API previously provided by `package1.carbon`. +// CHECK:STDERR: fail_package2.carbon:[[@LINE+4]]:1: error: library's API previously provided by `package1.carbon` // CHECK:STDERR: package Package; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -44,7 +44,7 @@ package Package library "lib"; // --- fail_package_lib2.carbon -// CHECK:STDERR: fail_package_lib2.carbon:[[@LINE+3]]:1: ERROR: Library's API previously provided by `package_lib1.carbon`. +// CHECK:STDERR: fail_package_lib2.carbon:[[@LINE+3]]:1: error: library's API previously provided by `package_lib1.carbon` // CHECK:STDERR: package Package library "lib"; // CHECK:STDERR: ^~~~~~~ package Package library "lib"; diff --git a/toolchain/check/testdata/packages/fail_extension.carbon b/toolchain/check/testdata/packages/fail_extension.carbon index 352640cf5af5f..da7f2ee721115 100644 --- a/toolchain/check/testdata/packages/fail_extension.carbon +++ b/toolchain/check/testdata/packages/fail_extension.carbon @@ -7,12 +7,12 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_extension.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_extension.carbon -// CHECK:STDERR: fail_main.incorrect: ERROR: File extension of `.carbon` required for `api`. +// CHECK:STDERR: fail_main.incorrect: error: file extension of `.carbon` required for `api` // CHECK:STDERR: -// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: ERROR: Main//default previously provided by `fail_main.incorrect`. +// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error: `Main//default` previously provided by `fail_main.incorrect` // CHECK:STDERR: -// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: ERROR: File extension of `.carbon` required for `api`. -// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: File extension of `.impl.carbon` only allowed for `impl`. +// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error: file extension of `.carbon` required for `api` +// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: file extension of `.impl.carbon` only allowed for `impl` // CHECK:STDERR: // --- fail_main.incorrect @@ -21,7 +21,7 @@ // --- fail_main_lib.incorrect -// CHECK:STDERR: fail_main_lib.incorrect:[[@LINE+4]]:1: ERROR: File extension of `.carbon` required for `api`. +// CHECK:STDERR: fail_main_lib.incorrect:[[@LINE+4]]:1: error: file extension of `.carbon` required for `api` // CHECK:STDERR: library "main_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -29,7 +29,7 @@ library "[[@TEST_NAME]]"; // --- fail_main_lib.impl.incorrect -// CHECK:STDERR: fail_main_lib.impl.incorrect:[[@LINE+4]]:6: ERROR: File extension of `.impl.carbon` required for `impl`. +// CHECK:STDERR: fail_main_lib.impl.incorrect:[[@LINE+4]]:6: error: file extension of `.impl.carbon` required for `impl` // CHECK:STDERR: impl library "main_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -37,7 +37,7 @@ impl library "[[@TEST_NAME]]"; // --- fail_package.incorrect -// CHECK:STDERR: fail_package.incorrect:[[@LINE+4]]:1: ERROR: File extension of `.carbon` required for `api`. +// CHECK:STDERR: fail_package.incorrect:[[@LINE+4]]:1: error: file extension of `.carbon` required for `api` // CHECK:STDERR: package Package; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -45,7 +45,7 @@ package Package; // --- fail_package_impl.incorrect -// CHECK:STDERR: fail_package_impl.incorrect:[[@LINE+4]]:6: ERROR: File extension of `.impl.carbon` required for `impl`. +// CHECK:STDERR: fail_package_impl.incorrect:[[@LINE+4]]:6: error: file extension of `.impl.carbon` required for `impl` // CHECK:STDERR: impl package Package; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -53,7 +53,7 @@ impl package Package; // --- fail_package_lib.incorrect -// CHECK:STDERR: fail_package_lib.incorrect:[[@LINE+4]]:1: ERROR: File extension of `.carbon` required for `api`. +// CHECK:STDERR: fail_package_lib.incorrect:[[@LINE+4]]:1: error: file extension of `.carbon` required for `api` // CHECK:STDERR: package Package library "package_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -61,7 +61,7 @@ package Package library "[[@TEST_NAME]]"; // --- fail_package_lib.impl.incorrect -// CHECK:STDERR: fail_package_lib.impl.incorrect:[[@LINE+4]]:6: ERROR: File extension of `.impl.carbon` required for `impl`. +// CHECK:STDERR: fail_package_lib.impl.incorrect:[[@LINE+4]]:6: error: file extension of `.impl.carbon` required for `impl` // CHECK:STDERR: impl package Package library "package_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -69,16 +69,16 @@ impl package Package library "[[@TEST_NAME]]"; // --- fail_swapped_ext.impl.carbon -// CHECK:STDERR: fail_swapped_ext.impl.carbon:[[@LINE+5]]:1: ERROR: File extension of `.carbon` required for `api`. +// CHECK:STDERR: fail_swapped_ext.impl.carbon:[[@LINE+5]]:1: error: file extension of `.carbon` required for `api` // CHECK:STDERR: package SwappedExt; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_swapped_ext.impl.carbon: File extension of `.impl.carbon` only allowed for `impl`. +// CHECK:STDERR: fail_swapped_ext.impl.carbon: file extension of `.impl.carbon` only allowed for `impl` // CHECK:STDERR: package SwappedExt; // --- fail_swapped_ext.carbon -// CHECK:STDERR: fail_swapped_ext.carbon:[[@LINE+3]]:6: ERROR: File extension of `.impl.carbon` required for `impl`. +// CHECK:STDERR: fail_swapped_ext.carbon:[[@LINE+3]]:6: error: file extension of `.impl.carbon` required for `impl` // CHECK:STDERR: impl package SwappedExt; // CHECK:STDERR: ^~~~~~~ impl package SwappedExt; diff --git a/toolchain/check/testdata/packages/fail_import_default.carbon b/toolchain/check/testdata/packages/fail_import_default.carbon index 1fcbc82fb023d..45a226c631f94 100644 --- a/toolchain/check/testdata/packages/fail_import_default.carbon +++ b/toolchain/check/testdata/packages/fail_import_default.carbon @@ -12,7 +12,7 @@ package A; -// CHECK:STDERR: fail_default_api.carbon:[[@LINE+4]]:1: ERROR: File cannot import itself. +// CHECK:STDERR: fail_default_api.carbon:[[@LINE+4]]:1: error: file cannot import itself // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ import library default; impl package A; -// CHECK:STDERR: fail_default.impl.carbon:[[@LINE+4]]:1: ERROR: Explicit import of `api` from `impl` file is redundant with implicit import. +// CHECK:STDERR: fail_default.impl.carbon:[[@LINE+4]]:1: error: explicit import of `api` from `impl` file is redundant with implicit import // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -30,7 +30,7 @@ import library default; // --- fail_main_import_default.carbon -// CHECK:STDERR: fail_main_import_default.carbon:[[@LINE+4]]:1: ERROR: Explicit import of `api` from `impl` file is redundant with implicit import. +// CHECK:STDERR: fail_main_import_default.carbon:[[@LINE+4]]:1: error: explicit import of `api` from `impl` file is redundant with implicit import // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -40,7 +40,7 @@ import library default; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_main_lib_import_default.carbon:[[@LINE+3]]:1: ERROR: Cannot import `Main//default`. +// CHECK:STDERR: fail_main_lib_import_default.carbon:[[@LINE+3]]:1: error: cannot import `Main//default` // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ import library default; diff --git a/toolchain/check/testdata/packages/fail_import_invalid.carbon b/toolchain/check/testdata/packages/fail_import_invalid.carbon index 181ad0ef756b8..820205fd10d7a 100644 --- a/toolchain/check/testdata/packages/fail_import_invalid.carbon +++ b/toolchain/check/testdata/packages/fail_import_invalid.carbon @@ -10,13 +10,13 @@ // --- fail_main.carbon -// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: ERROR: Imports from the current package must omit the package name. +// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error: imports from the current package must omit the package name // CHECK:STDERR: import Main; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: import Main; -// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: ERROR: Imports from the current package must omit the package name. +// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error: imports from the current package must omit the package name // CHECK:STDERR: import Main library "lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -26,13 +26,13 @@ import Main library "lib"; package NotMain; -// CHECK:STDERR: fail_not_main.carbon:[[@LINE+4]]:1: ERROR: Cannot import `Main` from other packages. +// CHECK:STDERR: fail_not_main.carbon:[[@LINE+4]]:1: error: cannot import `Main` from other packages // CHECK:STDERR: import Main; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: import Main; -// CHECK:STDERR: fail_not_main.carbon:[[@LINE+4]]:1: ERROR: Cannot import `Main` from other packages. +// CHECK:STDERR: fail_not_main.carbon:[[@LINE+4]]:1: error: cannot import `Main` from other packages // CHECK:STDERR: import Main library "lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ import Main library "lib"; package This; -// CHECK:STDERR: fail_this.carbon:[[@LINE+4]]:1: ERROR: File cannot import itself. +// CHECK:STDERR: fail_this.carbon:[[@LINE+4]]:1: error: file cannot import itself // CHECK:STDERR: import This; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ import This; package This library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_this_lib.carbon:[[@LINE+4]]:1: ERROR: File cannot import itself. +// CHECK:STDERR: fail_this_lib.carbon:[[@LINE+4]]:1: error: file cannot import itself // CHECK:STDERR: import library "this_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -66,7 +66,7 @@ package Implicit; impl package Implicit; -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:1: ERROR: Explicit import of `api` from `impl` file is redundant with implicit import. +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:1: error: explicit import of `api` from `impl` file is redundant with implicit import // CHECK:STDERR: import Implicit; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -80,7 +80,7 @@ package Implicit library "[[@TEST_NAME]]"; impl package Implicit library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_implicit_lib.impl.carbon:[[@LINE+4]]:1: ERROR: Explicit import of `api` from `impl` file is redundant with implicit import. +// CHECK:STDERR: fail_implicit_lib.impl.carbon:[[@LINE+4]]:1: error: explicit import of `api` from `impl` file is redundant with implicit import // CHECK:STDERR: import Implicit library "implicit_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -89,7 +89,7 @@ import Implicit library "implicit_lib"; // --- fail_not_found.carbon package NotFound; -// CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:1: ERROR: Imported API 'ImportNotFound' not found. +// CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:1: error: imported API 'ImportNotFound' not found // CHECK:STDERR: import ImportNotFound; // CHECK:STDERR: ^~~~~~ import ImportNotFound; diff --git a/toolchain/check/testdata/packages/fail_import_repeat.carbon b/toolchain/check/testdata/packages/fail_import_repeat.carbon index eaa540a46d490..4bf397dbade9f 100644 --- a/toolchain/check/testdata/packages/fail_import_repeat.carbon +++ b/toolchain/check/testdata/packages/fail_import_repeat.carbon @@ -23,30 +23,30 @@ library "[[@TEST_NAME]]"; // --- fail_import.carbon import Api; -// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: ERROR: Library imported more than once. +// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once // CHECK:STDERR: import Api; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: First import here. +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: first import here // CHECK:STDERR: import Api; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: import Api; import Api library "api_lib"; -// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: ERROR: Library imported more than once. +// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once // CHECK:STDERR: import Api library "api_lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: First import here. +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: first import here // CHECK:STDERR: import Api library "api_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: import Api library "api_lib"; import library "main_lib"; -// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: ERROR: Library imported more than once. +// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once // CHECK:STDERR: import library "main_lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: First import here. +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: first import here // CHECK:STDERR: import library "main_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -57,10 +57,10 @@ import library "main_lib"; package Api library "[[@TEST_NAME]]"; import library default; -// CHECK:STDERR: fail_default_import.carbon:[[@LINE+6]]:1: ERROR: Library imported more than once. +// CHECK:STDERR: fail_default_import.carbon:[[@LINE+6]]:1: error: library imported more than once // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_default_import.carbon:[[@LINE-4]]:1: First import here. +// CHECK:STDERR: fail_default_import.carbon:[[@LINE-4]]:1: first import here // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ import library default; diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index ad098c15a069b..1c26b0d02faac 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -12,22 +12,22 @@ package Implicit; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:12: ERROR: Name `x` not found. +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:12: error: name `x` not found // CHECK:STDERR: var a_ref: x; // CHECK:STDERR: ^ // CHECK:STDERR: var a_ref: x; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:18: ERROR: Name `x` not found. +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:18: error: name `x` not found // CHECK:STDERR: var b_ref: {.a = x}; // CHECK:STDERR: ^ // CHECK:STDERR: var b_ref: {.a = x}; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:13: ERROR: Name `x` not found. +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:13: error: name `x` not found // CHECK:STDERR: var c_ref: (x,); // CHECK:STDERR: ^ // CHECK:STDERR: var c_ref: (x,); -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+3]]:12: ERROR: Name `x` not found. +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+3]]:12: error: name `x` not found // CHECK:STDERR: var d_ref: x*; // CHECK:STDERR: ^ var d_ref: x*; diff --git a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon index ff81fcbef4f4e..788a39a8b1469 100644 --- a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon +++ b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon @@ -10,7 +10,7 @@ // --- fail_implicit.impl.carbon -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:6: ERROR: Corresponding API for 'Implicit' not found. +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:6: error: corresponding API for 'Implicit' not found // CHECK:STDERR: impl package Implicit; // CHECK:STDERR: ^~~~~~~ impl package Implicit; diff --git a/toolchain/check/testdata/packages/fail_package_main.carbon b/toolchain/check/testdata/packages/fail_package_main.carbon index 21bc1a37b1492..e6522df8f56f3 100644 --- a/toolchain/check/testdata/packages/fail_package_main.carbon +++ b/toolchain/check/testdata/packages/fail_package_main.carbon @@ -10,7 +10,7 @@ // --- fail_main.carbon -// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: ERROR: `Main//default` must omit `package` declaration. +// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error: `Main//default` must omit `package` declaration // CHECK:STDERR: package Main; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ package Main; // --- fail_main_impl.carbon -// CHECK:STDERR: fail_main_impl.carbon:[[@LINE+4]]:6: ERROR: `Main//default` must omit `package` declaration. +// CHECK:STDERR: fail_main_impl.carbon:[[@LINE+4]]:6: error: `Main//default` must omit `package` declaration // CHECK:STDERR: impl package Main; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -27,7 +27,7 @@ impl package Main; // --- fail_raw_main.carbon // `Main` isn't a keyword, so this fails the same way. -// CHECK:STDERR: fail_raw_main.carbon:[[@LINE+4]]:1: ERROR: `Main//default` must omit `package` declaration. +// CHECK:STDERR: fail_raw_main.carbon:[[@LINE+4]]:1: error: `Main//default` must omit `package` declaration // CHECK:STDERR: package r#Main; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -35,7 +35,7 @@ package r#Main; // --- fail_main_lib.carbon -// CHECK:STDERR: fail_main_lib.carbon:[[@LINE+3]]:1: ERROR: Use `library` declaration in `Main` package libraries. +// CHECK:STDERR: fail_main_lib.carbon:[[@LINE+3]]:1: error: use `library` declaration in `Main` package libraries // CHECK:STDERR: package Main library "main_lib"; // CHECK:STDERR: ^~~~~~~ package Main library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index 98d8de79216b8..99a9a22671eb5 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -153,22 +153,22 @@ import Other library "conflict"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import Other library "export_import"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: base.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: base.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import Other library "export_import"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: conflict.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: conflict.carbon:4:1: name is previously declared here // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ import Other library "export_import"; import Other library "conflict"; -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:11: In name lookup for `C`. +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:11: in name lookup for `C` // CHECK:STDERR: alias C = Other.C; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -178,25 +178,25 @@ alias C = Other.C; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+15]]:1: In import. +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+15]]:1: in import // CHECK:STDERR: import Other library "export_name"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: conflict.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: conflict.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+9]]:1: In import. +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: import Other library "export_name"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: export_name.carbon:4:1: In import. +// CHECK:STDERR: export_name.carbon:4:1: in import // CHECK:STDERR: import library "base"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: base.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: base.carbon:4:1: name is previously declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ import Other library "export_name"; import Other library "conflict"; -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+3]]:11: In name lookup for `C`. +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+3]]:11: in name lookup for `C` // CHECK:STDERR: alias C = Other.C; // CHECK:STDERR: ^~~~~~~ alias C = Other.C; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index fe950e7dbbdc8..754168d567dd4 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -70,23 +70,23 @@ fn Run() { library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_fn_extern.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: other_fn_extern.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_fn.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: other_fn.carbon:4:1: name is previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ import Other library "other_fn"; import Other library "other_fn_extern"; fn Run() { - // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:3: In name lookup for `F`. + // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:3: in name lookup for `F` // CHECK:STDERR: Other.F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -104,23 +104,23 @@ import Other library "other_fn_conflict"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+12]]:1: In import. +// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+12]]:1: in import // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_fn_conflict.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: other_fn_conflict.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: fn F(x: ()) {} // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+6]]:1: In import. +// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+6]]:1: in import // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_fn.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: other_fn.carbon:4:1: name is previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ import Other library "other_fn"; import Other library "other_fn_conflict"; fn Run() { - // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:3: In name lookup for `F`. + // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:3: in name lookup for `F` // CHECK:STDERR: Other.F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -132,25 +132,25 @@ fn Run() { library "[[@TEST_NAME]]"; import library "main_other_ns"; -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+10]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+10]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-4]]:1: In import. +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-4]]:1: in import // CHECK:STDERR: import library "main_other_ns"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: main_other_ns.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: main_other_ns.carbon:4:1: name is previously declared here // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: import Other library "other_fn"; -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+10]]:1: ERROR: Redeclaration of `fn F` is redundant. +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+10]]:1: error: redeclaration of `fn F` is redundant // CHECK:STDERR: fn Other.F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: other_fn.carbon:4:1: Previously declared here. +// CHECK:STDERR: other_fn.carbon:4:1: previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -162,10 +162,10 @@ library "[[@TEST_NAME]]"; import Other library "other_fn"; -// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE+7]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE-5]]:1: Name is previously declared here. +// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE-5]]:1: name is previously declared here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -180,10 +180,10 @@ library "[[@TEST_NAME]]"; import Other library "other_fn"; -// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE+7]]:11: ERROR: Imported packages cannot be used for declarations. +// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE+7]]:11: error: imported packages cannot be used for declarations // CHECK:STDERR: namespace Other.Nested; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE-5]]:1: Package imported here. +// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE-5]]:1: package imported here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -198,10 +198,10 @@ library "[[@TEST_NAME]]"; import Other library "other_fn"; -// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE+7]]:4: ERROR: Imported packages cannot be used for declarations. +// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE+7]]:4: error: imported packages cannot be used for declarations // CHECK:STDERR: fn Other.G() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE-5]]:1: Package imported here. +// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE-5]]:1: package imported here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -213,7 +213,7 @@ library "[[@TEST_NAME]]"; import Other library "other_fn_use"; -// CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+3]]:13: ERROR: Name `F` not found. +// CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+3]]:13: error: name `F` not found // CHECK:STDERR: fn UseF() { Other.F(); } // CHECK:STDERR: ^~~~~~~ fn UseF() { Other.F(); } diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index 0fcd046fa8471..3196ab2a37986 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -72,7 +72,7 @@ var c: C = {.x = ()}; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_export_in_impl.impl.carbon:[[@LINE+4]]:1: ERROR: `export` is only allowed in API files. +// CHECK:STDERR: fail_export_in_impl.impl.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files // CHECK:STDERR: export import library "base"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -144,7 +144,7 @@ library "[[@TEST_NAME]]"; import library "non_export"; -// CHECK:STDERR: fail_use_non_export.carbon:[[@LINE+3]]:15: ERROR: Name `C` not found. +// CHECK:STDERR: fail_use_non_export.carbon:[[@LINE+3]]:15: error: name `C` not found // CHECK:STDERR: alias Local = C; // CHECK:STDERR: ^ alias Local = C; diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index e07332ad0a46e..a505ad129049d 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -88,7 +88,7 @@ library "[[@TEST_NAME]]"; import library "export_import_then_name"; import library "export_name_then_import"; -// CHECK:STDERR: fail_nonexport_use_both.carbon:[[@LINE+3]]:8: ERROR: Name `D` not found. +// CHECK:STDERR: fail_nonexport_use_both.carbon:[[@LINE+3]]:8: error: name `D` not found // CHECK:STDERR: var d: D = {.y = ()}; // CHECK:STDERR: ^ var d: D = {.y = ()}; diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index c61a1594da3d0..d9c7a7062866c 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -87,13 +87,13 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_export_ns.carbon:[[@LINE+10]]:1: ERROR: Only imported entities are valid for `export`. +// CHECK:STDERR: fail_export_ns.carbon:[[@LINE+10]]:1: error: only imported entities are valid for `export` // CHECK:STDERR: export NS; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_export_ns.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_export_ns.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "base"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: base.carbon:8:1: Name is declared here. +// CHECK:STDERR: base.carbon:8:1: name is declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -105,10 +105,10 @@ library "[[@TEST_NAME]]"; class Local {} -// CHECK:STDERR: fail_export_decl.carbon:[[@LINE+7]]:1: ERROR: Only imported entities are valid for `export`. +// CHECK:STDERR: fail_export_decl.carbon:[[@LINE+7]]:1: error: only imported entities are valid for `export` // CHECK:STDERR: export Local; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_export_decl.carbon:[[@LINE-5]]:1: Name is declared here. +// CHECK:STDERR: fail_export_decl.carbon:[[@LINE-5]]:1: name is declared here // CHECK:STDERR: class Local {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -120,13 +120,13 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_export_member.carbon:[[@LINE+10]]:8: ERROR: Name qualifiers are only allowed for entities that provide a scope. +// CHECK:STDERR: fail_export_member.carbon:[[@LINE+10]]:8: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: export C.x; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_export_member.carbon:[[@LINE-5]]:1: In import. +// CHECK:STDERR: fail_export_member.carbon:[[@LINE-5]]:1: in import // CHECK:STDERR: import library "base"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: base.carbon:4:1: Referenced non-scope entity declared here. +// CHECK:STDERR: base.carbon:4:1: referenced non-scope entity declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -158,12 +158,12 @@ library "[[@TEST_NAME]]"; import library "not_reexporting"; -// CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:15: ERROR: Name `C` not found. +// CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:15: error: name `C` not found // CHECK:STDERR: alias Local = C; // CHECK:STDERR: ^ // CHECK:STDERR: alias Local = C; -// CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:17: ERROR: Name `NS` not found. +// CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:17: error: name `NS` not found // CHECK:STDERR: alias NSLocal = NS.NSC; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -176,10 +176,10 @@ library "[[@TEST_NAME]]"; import library "base"; export C; -// CHECK:STDERR: repeat_export.carbon:[[@LINE+7]]:1: WARNING: `export` matches previous `export`. +// CHECK:STDERR: repeat_export.carbon:[[@LINE+7]]:1: warning: `export` matches previous `export` // CHECK:STDERR: export C; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: repeat_export.carbon:[[@LINE-4]]:1: Previous `export` here. +// CHECK:STDERR: repeat_export.carbon:[[@LINE-4]]:1: previous `export` here // CHECK:STDERR: export C; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -199,7 +199,7 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: ERROR: `private` not allowed on `export` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `private` not allowed on `export` declaration // CHECK:STDERR: private export C; // CHECK:STDERR: ^~~~~~~ private export C; diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index 2bf8e60d9c297..b39963b38e3e0 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -24,13 +24,13 @@ import library "a"; // TODO: This diagnostic doesn't clearly explain the problem. We should instead // say something like: Only namespace-scope names can be exported. -// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:8: ERROR: Name qualifiers are only allowed for entities that provide a scope. +// CHECK:STDERR: fail_b.carbon:[[@LINE+9]]:8: error: name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: export C.n; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_b.carbon:[[@LINE-7]]:1: In import. +// CHECK:STDERR: fail_b.carbon:[[@LINE-7]]:1: in import // CHECK:STDERR: import library "a"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: a.carbon:4:1: Referenced non-scope entity declared here. +// CHECK:STDERR: a.carbon:4:1: referenced non-scope entity declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ export C.n; diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon index 5aa7aad5106a9..5a8e846834dc2 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon @@ -23,7 +23,7 @@ import library "a"; export C1; -// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:10: ERROR: `export` declaration cannot have parameters. +// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:10: error: `export` declaration cannot have parameters // CHECK:STDERR: export C2(T:! type); // CHECK:STDERR: ^~~~~~~~~~ export C2(T:! type); diff --git a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon index 58731eec34aa2..c31fbad70fac9 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon @@ -10,7 +10,7 @@ // --- fail_export_package.carbon -// CHECK:STDERR: fail_export_package.carbon:[[@LINE+4]]:1: ERROR: `export` not allowed on `package` declaration. +// CHECK:STDERR: fail_export_package.carbon:[[@LINE+4]]:1: error: `export` not allowed on `package` declaration // CHECK:STDERR: export package ExportPackage; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ export package ExportPackage; // --- fail_extend_package.carbon -// CHECK:STDERR: fail_extend_package.carbon:[[@LINE+4]]:1: ERROR: `extend` not allowed on `package` declaration. +// CHECK:STDERR: fail_extend_package.carbon:[[@LINE+4]]:1: error: `extend` not allowed on `package` declaration // CHECK:STDERR: extend package ExtendPackage; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -26,7 +26,7 @@ extend package ExtendPackage; // --- fail_virtual_package.carbon -// CHECK:STDERR: fail_virtual_package.carbon:[[@LINE+4]]:1: ERROR: `virtual` not allowed on `package` declaration. +// CHECK:STDERR: fail_virtual_package.carbon:[[@LINE+4]]:1: error: `virtual` not allowed on `package` declaration // CHECK:STDERR: virtual package VirtualPackage; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -34,7 +34,7 @@ virtual package VirtualPackage; // --- fail_private_package.carbon -// CHECK:STDERR: fail_private_package.carbon:[[@LINE+4]]:1: ERROR: `private` not allowed on `package` declaration. +// CHECK:STDERR: fail_private_package.carbon:[[@LINE+4]]:1: error: `private` not allowed on `package` declaration // CHECK:STDERR: private package PrivatePackage; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ private package PrivatePackage; // --- fail_export_library.carbon -// CHECK:STDERR: fail_export_library.carbon:[[@LINE+4]]:1: ERROR: `export` not allowed on `library` declaration. +// CHECK:STDERR: fail_export_library.carbon:[[@LINE+4]]:1: error: `export` not allowed on `library` declaration // CHECK:STDERR: export library "export_library"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -50,51 +50,51 @@ export library "export_library"; // --- fail_import_modifiers.carbon -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: ERROR: `impl` not allowed on `import` declaration. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error: `impl` not allowed on `import` declaration // CHECK:STDERR: impl import ImplImport; // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:6: ERROR: Imported API 'ImplImport' not found. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:6: error: imported API 'ImplImport' not found // CHECK:STDERR: impl import ImplImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: impl import ImplImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: ERROR: `extend` not allowed on `import` declaration. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error: `extend` not allowed on `import` declaration // CHECK:STDERR: extend import ExtendImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:8: ERROR: Imported API 'ExtendImport' not found. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:8: error: imported API 'ExtendImport' not found // CHECK:STDERR: extend import ExtendImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: extend import ExtendImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: ERROR: `virtual` not allowed on `import` declaration. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error: `virtual` not allowed on `import` declaration // CHECK:STDERR: virtual import VirtualImport; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:9: ERROR: Imported API 'VirtualImport' not found. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:9: error: imported API 'VirtualImport' not found // CHECK:STDERR: virtual import VirtualImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: virtual import VirtualImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: ERROR: `base` not allowed on `import` declaration. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error: `base` not allowed on `import` declaration // CHECK:STDERR: base import BaseImport; // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:6: ERROR: Imported API 'BaseImport' not found. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:6: error: imported API 'BaseImport' not found // CHECK:STDERR: base import BaseImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: base import BaseImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+7]]:1: ERROR: `private` not allowed on `import` declaration. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+7]]:1: error: `private` not allowed on `import` declaration // CHECK:STDERR: private import PrivateImport; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+3]]:9: ERROR: Imported API 'PrivateImport' not found. +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+3]]:9: error: imported API 'PrivateImport' not found // CHECK:STDERR: private import PrivateImport; // CHECK:STDERR: ^~~~~~ private import PrivateImport; diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index b23a1c3a2b94f..c6a4c9eaa9459 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -131,16 +131,16 @@ import Other library "o1"; // --- fail_import_conflict.impl.carbon -// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+13]]:6: In import. +// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+13]]:6: in import // CHECK:STDERR: impl library "import_conflict"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: import_conflict.carbon:4:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: import_conflict.carbon:4:1: error: duplicate name being declared in the same scope // CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+7]]:6: In import. +// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+7]]:6: in import // CHECK:STDERR: impl library "import_conflict"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: local_other.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: local_other.carbon:4:1: name is previously declared here // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -158,16 +158,16 @@ import library "local_other"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+12]]:1: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+12]]:1: error: duplicate name being declared in the same scope // CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl library "import_conflict_reverse"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: import_conflict_reverse.carbon:4:1: In import. +// CHECK:STDERR: import_conflict_reverse.carbon:4:1: in import // CHECK:STDERR: import library "local_other"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: local_other.carbon:4:1: Name is previously declared here. +// CHECK:STDERR: local_other.carbon:4:1: name is previously declared here // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ import Other library "o1"; diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index a93664dc50fcc..9d3368796bf70 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -12,7 +12,7 @@ library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_missing_prelude.carbon:[[@LINE+4]]:8: ERROR: Package `Core` implicitly referenced here, but not found. +// CHECK:STDERR: fail_missing_prelude.carbon:[[@LINE+4]]:8: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -28,7 +28,7 @@ library "[[@TEST_NAME]]"; import Core library "prelude_empty"; -// CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: ERROR: Name `Core.Int32` implicitly referenced here, but not found. +// CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: error: name `Core.Int32` implicitly referenced here, but not found // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -80,7 +80,7 @@ class Core { fn Int32() -> {} { return {}; } } -// CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+3]]:13: ERROR: Package `Core` implicitly referenced here, but not found. +// CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+3]]:13: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: var n: {} = i32; // CHECK:STDERR: ^~~ var n: {} = i32; diff --git a/toolchain/check/testdata/pointer/fail_address_of_error.carbon b/toolchain/check/testdata/pointer/fail_address_of_error.carbon index 4b72c05caadc4..308a8e6ce30fa 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_error.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_error.carbon @@ -9,16 +9,16 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_address_of_error.carbon fn Test() { - // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+4]]:4: ERROR: Name `undeclared` not found. + // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+4]]:4: error: name `undeclared` not found // CHECK:STDERR: &undeclared; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: &undeclared; - // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+7]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+7]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &(&undeclared); // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+3]]:6: ERROR: Name `undeclared` not found. + // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+3]]:6: error: name `undeclared` not found // CHECK:STDERR: &(&undeclared); // CHECK:STDERR: ^~~~~~~~~~ &(&undeclared); diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index cb3e278f95747..3499669e27a3d 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -13,32 +13,32 @@ fn G() -> i32; fn H() -> {.a: i32}; fn AddressOfLiteral() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &0; // CHECK:STDERR: ^ // CHECK:STDERR: &0; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &true; // CHECK:STDERR: ^ // CHECK:STDERR: &true; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &1.0; // CHECK:STDERR: ^ // CHECK:STDERR: &1.0; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &"Hello"; // CHECK:STDERR: ^ // CHECK:STDERR: &"Hello"; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &(1, 2); // CHECK:STDERR: ^ // CHECK:STDERR: &(1, 2); - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &{.a = 5}; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -46,17 +46,17 @@ fn AddressOfLiteral() { } fn AddressOfOperator() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &(true and false); // CHECK:STDERR: ^ // CHECK:STDERR: &(true and false); - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of a temporary object. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of a temporary object // CHECK:STDERR: &H().a; // CHECK:STDERR: ^ // CHECK:STDERR: &H().a; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &(not true); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -64,7 +64,7 @@ fn AddressOfOperator() { } fn AddressOfCall() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &G(); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -72,12 +72,12 @@ fn AddressOfCall() { } fn AddressOfType() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &i32; // CHECK:STDERR: ^ // CHECK:STDERR: &i32; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &(const i32*); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -85,7 +85,7 @@ fn AddressOfType() { } fn AddressOfTupleElementValue() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression // CHECK:STDERR: &((1, 2).0); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -93,7 +93,7 @@ fn AddressOfTupleElementValue() { } fn AddressOfParam(param: i32) { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:26: ERROR: Cannot take the address of non-reference expression. + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:26: error: cannot take the address of non-reference expression // CHECK:STDERR: var param_addr: i32* = ¶m; // CHECK:STDERR: ^ var param_addr: i32* = ¶m; diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index b43e42298ac5d..f06c49669e83d 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -8,12 +8,12 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_error.carbon -// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+4]]:15: ERROR: Name `undeclared` not found. +// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+4]]:15: error: name `undeclared` not found // CHECK:STDERR: let n: i32 = *undeclared; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: let n: i32 = *undeclared; -// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+3]]:15: ERROR: Name `undeclared` not found. +// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+3]]:15: error: name `undeclared` not found // CHECK:STDERR: let n2: i32 = undeclared->foo; // CHECK:STDERR: ^~~~~~~~~~ let n2: i32 = undeclared->foo; diff --git a/toolchain/check/testdata/pointer/fail_deref_function.carbon b/toolchain/check/testdata/pointer/fail_deref_function.carbon index 389e1662c7997..c283e8a78a773 100644 --- a/toolchain/check/testdata/pointer/fail_deref_function.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_function.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_function.carbon fn A() { - // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+4]]:4: ERROR: Expression cannot be used as a value. + // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+4]]:4: error: expression cannot be used as a value // CHECK:STDERR: *A; // CHECK:STDERR: ^ // CHECK:STDERR: *A; - // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+3]]:3: ERROR: Expression cannot be used as a value. + // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value // CHECK:STDERR: A->foo; // CHECK:STDERR: ^ A->foo; diff --git a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon index 7e4efc72f942c..bb3a98dea0882 100644 --- a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon @@ -11,12 +11,12 @@ namespace A; fn F() { - // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+4]]:4: ERROR: Expression cannot be used as a value. + // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+4]]:4: error: expression cannot be used as a value // CHECK:STDERR: *A; // CHECK:STDERR: ^ // CHECK:STDERR: *A; - // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+3]]:3: ERROR: Expression cannot be used as a value. + // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value // CHECK:STDERR: A->foo; // CHECK:STDERR: ^ A->foo; diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index cc7f660a63914..29fa90136f2ec 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -9,32 +9,32 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon fn Deref(n: i32) { - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: ERROR: Cannot dereference operand of non-pointer type `i32`. + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error: cannot dereference operand of non-pointer type `i32` // CHECK:STDERR: *n; // CHECK:STDERR: ^ // CHECK:STDERR: *n; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:4: ERROR: Cannot apply `->` operator to non-pointer type `i32`. + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:4: error: cannot apply `->` operator to non-pointer type `i32` // CHECK:STDERR: n->foo; // CHECK:STDERR: ^~ // CHECK:STDERR: n->foo; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: ERROR: Cannot dereference operand of non-pointer type `()`. + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error: cannot dereference operand of non-pointer type `()` // CHECK:STDERR: *(); // CHECK:STDERR: ^ // CHECK:STDERR: *(); - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:5: ERROR: Cannot apply `->` operator to non-pointer type `()`. + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:5: error: cannot apply `->` operator to non-pointer type `()` // CHECK:STDERR: ()->foo; // CHECK:STDERR: ^~ // CHECK:STDERR: ()->foo; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: ERROR: Cannot dereference operand of non-pointer type `{}`. + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error: cannot dereference operand of non-pointer type `{}` // CHECK:STDERR: *{}; // CHECK:STDERR: ^ // CHECK:STDERR: *{}; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+3]]:5: ERROR: Cannot apply `->` operator to non-pointer type `{}`. + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+3]]:5: error: cannot apply `->` operator to non-pointer type `{}` // CHECK:STDERR: {}->foo; // CHECK:STDERR: ^~ {}->foo; diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 1722a050d6942..855b5208911c8 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -8,15 +8,15 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_type.carbon -// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+7]]:8: ERROR: Cannot dereference operand of non-pointer type `type`. +// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+7]]:8: error: cannot dereference operand of non-pointer type `type` // CHECK:STDERR: var p: *i32; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+4]]:8: To form a pointer type, write the `*` after the pointee type. +// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+4]]:8: to form a pointer type, write the `*` after the pointee type // CHECK:STDERR: var p: *i32; // CHECK:STDERR: ^ // CHECK:STDERR: var p: *i32; -// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+3]]:12: ERROR: Cannot apply `->` operator to non-pointer type `type`. +// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+3]]:12: error: cannot apply `->` operator to non-pointer type `type` // CHECK:STDERR: var p2: i32->foo; // CHECK:STDERR: ^~ var p2: i32->foo; diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index 0bd1b16abb54b..b407dd1ba4244 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_type_mismatch.carbon fn ConstMismatch(p: const {}*) -> const ({}*) { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `const {}*` to `const ({}*)`. + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const {}*` to `const ({}*)` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: Type `const {}*` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: type `const {}*` does not implement interface `ImplicitAs` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ return p; diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index 8ae46614a0172..2704612d8542c 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -11,7 +11,7 @@ // TODO: Some variant of this should work, once compile-time function calls are // supported. fn ReturnType() -> type { return i32; } -// CHECK:STDERR: fail_call_in_type.carbon:[[@LINE+3]]:13: ERROR: Cannot evaluate type expression. +// CHECK:STDERR: fail_call_in_type.carbon:[[@LINE+3]]:13: error: cannot evaluate type expression // CHECK:STDERR: fn Six() -> ReturnType() { return 6; } // CHECK:STDERR: ^~~~~~~~~~~~ fn Six() -> ReturnType() { return 6; } diff --git a/toolchain/check/testdata/return/fail_error_in_type.carbon b/toolchain/check/testdata/return/fail_error_in_type.carbon index 0c15bfbc81c13..adcd5d96d5d56 100644 --- a/toolchain/check/testdata/return/fail_error_in_type.carbon +++ b/toolchain/check/testdata/return/fail_error_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_error_in_type.carbon -// CHECK:STDERR: fail_error_in_type.carbon:[[@LINE+3]]:13: ERROR: Name `x` not found. +// CHECK:STDERR: fail_error_in_type.carbon:[[@LINE+3]]:13: error: name `x` not found // CHECK:STDERR: fn Six() -> x; // CHECK:STDERR: ^ fn Six() -> x; diff --git a/toolchain/check/testdata/return/fail_let_in_type.carbon b/toolchain/check/testdata/return/fail_let_in_type.carbon index bfd2f2da86fa0..b8d5d59efc656 100644 --- a/toolchain/check/testdata/return/fail_let_in_type.carbon +++ b/toolchain/check/testdata/return/fail_let_in_type.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_let_in_type.carbon let x: type = i32; -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:13: ERROR: Cannot evaluate type expression. +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:13: error: cannot evaluate type expression // CHECK:STDERR: fn Six() -> x { return 6; } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -17,17 +17,17 @@ fn Six() -> x { return 6; } // TODO: This should probably work. let y:! type = i32; -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+7]]:23: ERROR: Cannot implicitly convert from `i32` to `y`. +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+7]]:23: error: cannot implicitly convert from `i32` to `y` // CHECK:STDERR: fn HalfDozen() -> y { return 6; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:23: Type `i32` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:23: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: fn HalfDozen() -> y { return 6; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fn HalfDozen() -> y { return 6; } // TODO: This should work. -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+3]]:5: ERROR: Semantics TODO: `HandleTemplate`. +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+3]]:5: error: semantics TODO: `HandleTemplate` // CHECK:STDERR: let template z:! type = i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ let template z:! type = i32; diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index 6d89af63a1071..dc2b88a31d74e 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_missing_return.carbon fn Main() -> i32 { -// CHECK:STDERR: fail_missing_return.carbon:[[@LINE+3]]:1: ERROR: Missing `return` at end of function with declared return type. +// CHECK:STDERR: fail_missing_return.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon index 1358fb210e321..5a59f13740426 100644 --- a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon +++ b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon fn F() -> () { -// CHECK:STDERR: fail_missing_return_empty_tuple.carbon:[[@LINE+3]]:1: ERROR: Missing `return` at end of function with declared return type. +// CHECK:STDERR: fail_missing_return_empty_tuple.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon index 029b7becb8712..3569faa2fceaa 100644 --- a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon fn Procedure() -> i32 { - // CHECK:STDERR: fail_return_var_no_returned_var.carbon:[[@LINE+3]]:3: ERROR: `return var;` with no `returned var` in scope. + // CHECK:STDERR: fail_return_var_no_returned_var.carbon:[[@LINE+3]]:3: error: `return var;` with no `returned var` in scope // CHECK:STDERR: return var; // CHECK:STDERR: ^~~~~~~~~~~ return var; 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 fba773c885bc1..38c6e57ab747c 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -10,10 +10,10 @@ fn F() -> i32 { returned var v: i32 = 0; - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+7]]:3: ERROR: Can only `return var;` in the scope of a `returned var`. + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+7]]:3: error: can only `return var;` in the scope of a `returned var` // CHECK:STDERR: return 1; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: `returned var` was declared here. + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -23,10 +23,10 @@ fn F() -> i32 { class C { var a: i32; var b: i32; } fn G() -> C { returned var c: C = {.a = 1, .b = 2}; - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+6]]:3: ERROR: Can only `return var;` in the scope of a `returned var`. + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+6]]:3: error: can only `return var;` in the scope of a `returned var` // CHECK:STDERR: return c; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: `returned var` was declared here. + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: `returned var` was declared here // CHECK:STDERR: returned var c: C = {.a = 1, .b = 2}; // CHECK:STDERR: ^ return c; diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index 9d2907acb11ef..66d4f0eb86f81 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon fn Procedure() { - // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE+6]]:3: ERROR: Cannot declare a `returned var` in this function. + // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE+6]]:3: error: cannot declare a `returned var` in this function // CHECK:STDERR: returned var v: () = (); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE-4]]:1: There was no return type provided. + // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE-4]]:1: there was no return type provided // CHECK:STDERR: fn Procedure() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ returned var v: () = (); diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 2e69a6712f1a7..cbc6e62529a87 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -11,10 +11,10 @@ fn SameScope() -> i32 { if (true) { returned var v: i32 = 0; - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:18: ERROR: Cannot declare a `returned var` in the scope of another `returned var`. + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:18: error: cannot declare a `returned var` in the scope of another `returned var` // CHECK:STDERR: returned var w: i32 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-4]]:18: `returned var` was declared here. + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-4]]:18: `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -27,10 +27,10 @@ fn DifferentScopes() -> i32 { if (true) { returned var v: i32 = 0; if (true) { - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+6]]:20: ERROR: Cannot declare a `returned var` in the scope of another `returned var`. + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+6]]:20: error: cannot declare a `returned var` in the scope of another `returned var` // CHECK:STDERR: returned var w: i32 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-5]]:18: `returned var` was declared here. + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-5]]:18: `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ returned var w: i32 = 1; diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index 5a2a064b98143..42b3fdbd52cab 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_returned_var_type.carbon fn Mismatch() -> i32 { - // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE+6]]:19: ERROR: Type `f64` of `returned var` does not match return type of enclosing function. + // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE+6]]:19: error: type `f64` of `returned var` does not match return type of enclosing function // CHECK:STDERR: returned var v: f64 = 0.0; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE-4]]:15: Return type of function is `i32`. + // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE-4]]:15: return type of function is `i32` // CHECK:STDERR: fn Mismatch() -> i32 { // CHECK:STDERR: ^~~~~~ returned var v: f64 = 0.0; diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 025261fb2bb15..daa62a9335785 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_type_mismatch.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`. + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: Type `f64` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ return 1.0; diff --git a/toolchain/check/testdata/return/fail_value_disallowed.carbon b/toolchain/check/testdata/return/fail_value_disallowed.carbon index 0a025b84e7ecb..b126930a30f86 100644 --- a/toolchain/check/testdata/return/fail_value_disallowed.carbon +++ b/toolchain/check/testdata/return/fail_value_disallowed.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_value_disallowed.carbon fn Main() { - // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+6]]:3: ERROR: No return expression should be provided in this context. + // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+6]]:3: error: no return expression should be provided in this context // CHECK:STDERR: return 0; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE-4]]:1: There was no return type provided. + // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE-4]]:1: there was no return type provided // CHECK:STDERR: fn Main() { // CHECK:STDERR: ^~~~~~~~~~~ return 0; diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 54b4037d9903c..8844490218c3f 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_value_missing.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+6]]:3: ERROR: Missing return value. + // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+6]]:3: error: missing return value // CHECK:STDERR: return; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_value_missing.carbon:[[@LINE-4]]:11: Return type of function is `i32`. + // CHECK:STDERR: fail_value_missing.carbon:[[@LINE-4]]:11: return type of function is `i32` // CHECK:STDERR: fn Main() -> i32 { // CHECK:STDERR: ^~~~~~ return; diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index a33e06624fa15..f59dfc1249be3 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_var_in_type.carbon var x: type = i32; -// CHECK:STDERR: fail_var_in_type.carbon:[[@LINE+3]]:13: ERROR: Cannot evaluate type expression. +// CHECK:STDERR: fail_var_in_type.carbon:[[@LINE+3]]:13: error: cannot evaluate type expression // CHECK:STDERR: fn Six() -> x { return 6; } // CHECK:STDERR: ^ fn Six() -> x { return 6; } diff --git a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon index 51ad996742b28..f556ba8045955 100644 --- a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon +++ b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_access_into_invalid.carbon -// CHECK:STDERR: fail_access_into_invalid.carbon:[[@LINE+3]]:10: ERROR: Name `a` not found. +// CHECK:STDERR: fail_access_into_invalid.carbon:[[@LINE+3]]:10: error: name `a` not found // CHECK:STDERR: fn F() { a.b; } // CHECK:STDERR: ^ fn F() { a.b; } diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index 4267ad901a5f3..31430d5c151aa 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_assign_empty.carbon -// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:20: ERROR: Cannot initialize struct with 1 field(s) from struct with 0 field(s). +// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:20: error: cannot initialize struct with 1 field(s) from struct with 0 field(s). // CHECK:STDERR: var x: {.a: i32} = {}; // CHECK:STDERR: ^~ var x: {.a: i32} = {}; diff --git a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon index 6e1f5bcec6537..64f2042591797 100644 --- a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_assign_to_empty.carbon -// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: ERROR: Cannot initialize struct with 0 field(s) from struct with 1 field(s). +// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: error: cannot initialize struct with 0 field(s) from struct with 1 field(s). // CHECK:STDERR: var x: {} = {.a = 1}; // CHECK:STDERR: ^~~~~~~~ var x: {} = {.a = 1}; diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index a64a60896eb87..9fbb3d3a19470 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -8,46 +8,46 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_duplicate_name.carbon -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:42: ERROR: Duplicated field name `abc` in struct type literal. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:42: error: duplicated field name `abc` in struct type literal // CHECK:STDERR: fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: Field with the same name here. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: field with the same name here // CHECK:STDERR: fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; // CHECK:STDERR: ^~~ // CHECK:STDERR: fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:19: ERROR: Duplicated field name `a` in struct type literal. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:19: error: duplicated field name `a` in struct type literal // CHECK:STDERR: let v: {.a: i32, .a: i32} = {.a = 1}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:10: Field with the same name here. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:10: field with the same name here // CHECK:STDERR: let v: {.a: i32, .a: i32} = {.a = 1}; // CHECK:STDERR: ^ // CHECK:STDERR: let v: {.a: i32, .a: i32} = {.a = 1}; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:26: ERROR: Duplicated field name `def` in struct literal. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:26: error: duplicated field name `def` in struct literal // CHECK:STDERR: let w: i32 = {.def = 1, .def = 2}.def; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:16: Field with the same name here. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:16: field with the same name here // CHECK:STDERR: let w: i32 = {.def = 1, .def = 2}.def; // CHECK:STDERR: ^~~ // CHECK:STDERR: let w: i32 = {.def = 1, .def = 2}.def; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:30: ERROR: Duplicated field name `a` in struct literal. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:30: error: duplicated field name `a` in struct literal // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: Field with the same name here. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: field with the same name here // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; // CHECK:STDERR: ^ // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+6]]:39: ERROR: Duplicated field name `b` in struct literal. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+6]]:39: error: duplicated field name `b` in struct literal // CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+3]]:31: Field with the same name here. +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+3]]:31: field with the same name here // CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDERR: ^ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index b9402346a39d8..ecdeba2175480 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -8,13 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_field_name_mismatch.carbon -// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+4]]:20: ERROR: Missing value for field `a` in struct initialization. +// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+4]]:20: error: missing value for field `a` in struct initialization // CHECK:STDERR: var x: {.a: i32} = {.b = 1}; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var x: {.a: i32} = {.b = 1}; -// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+3]]:20: ERROR: Cannot convert from struct type `{.a: i32}` to `{.b: i32}`: missing field `b` in source type. +// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+3]]:20: error: cannot convert from struct type `{.a: i32}` to `{.b: i32}`: missing field `b` in source type // CHECK:STDERR: var y: {.b: i32} = x; // CHECK:STDERR: ^ var y: {.b: i32} = x; diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index 4a8e5f73ea512..d2b9a53cbe4f8 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_field_type_mismatch.carbon -// CHECK:STDERR: fail_field_type_mismatch.carbon:[[@LINE+3]]:20: ERROR: Missing value for field `a` in struct initialization. +// CHECK:STDERR: fail_field_type_mismatch.carbon:[[@LINE+3]]:20: error: missing value for field `a` in struct initialization // CHECK:STDERR: var x: {.a: i32} = {.b = 1.0}; // CHECK:STDERR: ^~~~~~~~~~ var x: {.a: i32} = {.b = 1.0}; diff --git a/toolchain/check/testdata/struct/fail_keyword_name.carbon b/toolchain/check/testdata/struct/fail_keyword_name.carbon index 169b3e9b209b1..c092a98030658 100644 --- a/toolchain/check/testdata/struct/fail_keyword_name.carbon +++ b/toolchain/check/testdata/struct/fail_keyword_name.carbon @@ -8,17 +8,17 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_keyword_name.carbon -// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+8]]:13: ERROR: Expected identifier after `.`. +// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+8]]:13: error: expected identifier after `.` // CHECK:STDERR: fn F() -> {.class: i32}; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+4]]:13: ERROR: Semantics TODO: `Error recovery from keyword name.`. +// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+4]]:13: error: semantics TODO: `Error recovery from keyword name.` // CHECK:STDERR: fn F() -> {.class: i32}; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fn F() -> {.class: i32}; -// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+3]]:19: ERROR: Expected identifier after `.`. +// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+3]]:19: error: expected identifier after `.` // CHECK:STDERR: fn G() { return {.return = 5}; }; // CHECK:STDERR: ^~~~~~ fn G() { return {.return = 5}; }; diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index cdf7056a0e2f8..93166472066a8 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_member_access_type.carbon var x: {.a: f64} = {.a = 4.0}; -// CHECK:STDERR: fail_member_access_type.carbon:[[@LINE+3]]:14: ERROR: Type `{.a: f64}` does not have a member `b`. +// CHECK:STDERR: fail_member_access_type.carbon:[[@LINE+3]]:14: error: type `{.a: f64}` does not have a member `b` // CHECK:STDERR: var y: i32 = x.b; // CHECK:STDERR: ^~~ var y: i32 = x.b; diff --git a/toolchain/check/testdata/struct/fail_member_of_function.carbon b/toolchain/check/testdata/struct/fail_member_of_function.carbon index bb03bb4476bc6..5509bc5772e88 100644 --- a/toolchain/check/testdata/struct/fail_member_of_function.carbon +++ b/toolchain/check/testdata/struct/fail_member_of_function.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_member_of_function.carbon fn A() { - // CHECK:STDERR: fail_member_of_function.carbon:[[@LINE+3]]:3: ERROR: Expression cannot be used as a value. + // CHECK:STDERR: fail_member_of_function.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value // CHECK:STDERR: A.y; // CHECK:STDERR: ^ A.y; diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index c0ae3069c7b2e..362135546ee2a 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_non_member_access.carbon var x: {.a: i32} = {.a = 4}; -// CHECK:STDERR: fail_non_member_access.carbon:[[@LINE+3]]:14: ERROR: Type `{.a: i32}` does not have a member `b`. +// CHECK:STDERR: fail_non_member_access.carbon:[[@LINE+3]]:14: error: type `{.a: i32}` does not have a member `b` // CHECK:STDERR: var y: i32 = x.b; // CHECK:STDERR: ^~~ var y: i32 = x.b; diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index fb5df11f50683..dfe15031d364b 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_too_few_values.carbon -// CHECK:STDERR: fail_too_few_values.carbon:[[@LINE+3]]:29: ERROR: Cannot initialize struct with 2 field(s) from struct with 1 field(s). +// CHECK:STDERR: fail_too_few_values.carbon:[[@LINE+3]]:29: error: cannot initialize struct with 2 field(s) from struct with 1 field(s). // CHECK:STDERR: var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDERR: ^~~~~~~~ var x: {.a: i32, .b: i32} = {.a = 1}; diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 712bfd57020ba..350bcaa15a544 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_type_assign.carbon -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:1: ERROR: Cannot implicitly convert from `type` to `{.a: i32}`. +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `type` to `{.a: i32}` // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: Type `type` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x: {.a: i32} = {.a: i32}; diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index 7cbd184386250..c1e885943caf3 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_value_as_type.carbon -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: ERROR: Cannot implicitly convert from `{.a: i32}` to `type`. +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `{.a: i32}` to `type` // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: Type `{.a: i32}` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: type `{.a: i32}` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ var x: {.a = 1}; diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 0c25f8869457e..7534e2a68e0ae 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -30,13 +30,13 @@ var c: C({.a = 1, .b = 2}) = F(); // --- fail_bad_type.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+10]]:14: ERROR: Missing value for field `a` in struct initialization. +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+10]]:14: error: missing value for field `a` in struct initialization // CHECK:STDERR: var c_bad: C({.c = 1, .d = 2}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-4]]:6: In import. +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-4]]:6: in import // CHECK:STDERR: impl package Implicit; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: implicit.carbon:8:9: Initializing generic parameter `S` declared here. +// CHECK:STDERR: implicit.carbon:8:9: initializing generic parameter `S` declared here // CHECK:STDERR: class C(S:! {.a: i32, .b: i32}) {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -45,10 +45,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: ERROR: Cannot implicitly convert from `C` to `C`. +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C` to `C` // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: Type `C` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); diff --git a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon b/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon index 3e4fa00fcea0b..c37037734f971 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon -// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:19: ERROR: Missing value for field `a` in struct initialization. +// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:19: error: missing value for field `a` in struct initialization // CHECK:STDERR: var x: {.a: {}} = {.b = {}}; // CHECK:STDERR: ^~~~~~~~~ var x: {.a: {}} = {.b = {}}; diff --git a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon index 9c84bef025230..fd178e5a9a9ac 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon @@ -10,10 +10,10 @@ class Incomplete; -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: ERROR: Variable has incomplete type `{.a: Incomplete}`. +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error: Variable has incomplete type `{.a: Incomplete}` // CHECK:STDERR: var s: {.a: Incomplete}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: Class was forward declared here. +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var s: {.a: Incomplete}; diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index 935446598f313..87e794ee9fd5a 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_access_error.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_access_error.carbon:[[@LINE+3]]:17: ERROR: Name `oops` not found. +// CHECK:STDERR: fail_access_error.carbon:[[@LINE+3]]:17: error: name `oops` not found // CHECK:STDERR: var b: i32 = a.(oops); // CHECK:STDERR: ^~~~ var b: i32 = a.(oops); diff --git a/toolchain/check/testdata/tuple/access/fail_empty_access.carbon b/toolchain/check/testdata/tuple/access/fail_empty_access.carbon index 5da79d8e92c8d..d0ab6c334c021 100644 --- a/toolchain/check/testdata/tuple/access/fail_empty_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_empty_access.carbon @@ -11,7 +11,7 @@ fn F() {} fn Run() { - // CHECK:STDERR: fail_empty_access.carbon:[[@LINE+3]]:3: ERROR: Tuple element index `0` is past the end of type `()`. + // CHECK:STDERR: fail_empty_access.carbon:[[@LINE+3]]:3: error: tuple element index `0` is past the end of type `()` // CHECK:STDERR: F().0; // CHECK:STDERR: ^~~~~ F().0; diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index a643784545544..177687fa9f9b6 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -10,12 +10,12 @@ var a: (i32,) = (12,); var b: (i32,) = a; -// CHECK:STDERR: fail_large_index.carbon:[[@LINE+4]]:14: ERROR: Tuple element index `1` is past the end of type `(i32,)`. +// CHECK:STDERR: fail_large_index.carbon:[[@LINE+4]]:14: error: tuple element index `1` is past the end of type `(i32,)` // CHECK:STDERR: var c: i32 = b.1; // CHECK:STDERR: ^~~ // CHECK:STDERR: var c: i32 = b.1; -// CHECK:STDERR: fail_large_index.carbon:[[@LINE+3]]:14: ERROR: Tuple element index `2147483647` is past the end of type `(i32,)`. +// CHECK:STDERR: fail_large_index.carbon:[[@LINE+3]]:14: error: tuple element index `2147483647` is past the end of type `(i32,)` // CHECK:STDERR: var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDERR: ^~~~~~~~~~~~~~~ var d: i32 = b.(0x7FFF_FFFF); diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index e3619c53250ac..851737197e701 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:17: ERROR: Cannot access member of interface `Negate` in type `i32` that does not implement that interface. +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:17: error: cannot access member of interface `Negate` in type `i32` that does not implement that interface // CHECK:STDERR: var b: i32 = a.(-10); // CHECK:STDERR: ^~~ var b: i32 = a.(-10); diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index 7fcdf76b28f6b..13d5261e32522 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -10,7 +10,7 @@ var a: (i32, i32) = (2, 3); var b: i32 = 0; -// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+3]]:14: ERROR: Tuple index must be a constant. +// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+3]]:14: error: tuple index must be a constant // CHECK:STDERR: var c: i32 = a.(b); // CHECK:STDERR: ^~~~~ var c: i32 = a.(b); diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index f568ae819e57b..bb84b8861b1d6 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+6]]:17: ERROR: Cannot implicitly convert from `f64` to `i32`. +// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: Type `f64` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ var b: i32 = a.(2.6); diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index 07d01a21b8ca6..ab46330d5c6fe 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -9,14 +9,14 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon fn Main() { - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:3: ERROR: Type `i32` does not support indexing. + // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:3: error: type `i32` does not support indexing // CHECK:STDERR: 0[1]; // CHECK:STDERR: ^~~~ // CHECK:STDERR: 0[1]; var non_tuple: [i32; 2] = (5, 5); - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:20: ERROR: Type `[i32; 2]` does not support tuple indexing. Only tuples can be indexed that way. + // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:20: error: type `[i32; 2]` does not support tuple indexing; only tuples can be indexed that way // CHECK:STDERR: var first: i32 = non_tuple.0; // CHECK:STDERR: ^~~~~~~~~~~ var first: i32 = non_tuple.0; diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index 9b7c07e92a4dc..f1c603882b8f2 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_out_of_bound_access.carbon:[[@LINE+3]]:14: ERROR: Tuple element index `2` is past the end of type `(i32, i32)`. +// CHECK:STDERR: fail_out_of_bound_access.carbon:[[@LINE+3]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` // CHECK:STDERR: var b: i32 = a.2; // CHECK:STDERR: ^~~ var b: i32 = a.2; diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index ebf127091d6ec..4a99b26e66996 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon var a: (i32, i32) = (12, 34); -// CHECK:STDERR: fail_out_of_bound_not_literal.carbon:[[@LINE+3]]:14: ERROR: Tuple element index `2` is past the end of type `(i32, i32)`. +// CHECK:STDERR: fail_out_of_bound_not_literal.carbon:[[@LINE+3]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` // CHECK:STDERR: var b: i32 = a.({.index = 2}.index); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ var b: i32 = a.({.index = 2}.index); diff --git a/toolchain/check/testdata/tuple/fail_assign_nested.carbon b/toolchain/check/testdata/tuple/fail_assign_nested.carbon index 3a72cadbddc74..04b259a424add 100644 --- a/toolchain/check/testdata/tuple/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuple/fail_assign_nested.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_assign_nested.carbon -// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:36: ERROR: Cannot initialize tuple of 2 element(s) from tuple with 3 element(s). +// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:36: error: cannot initialize tuple of 2 element(s) from tuple with 3 element(s). // CHECK:STDERR: var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDERR: ^~~~~~~~~ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index 41df1f0e51923..31babc84b66bf 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+6]]:21: ERROR: Cannot implicitly convert from `f64` to `i32`. +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+6]]:21: error: cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: Type `f64` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ var x: (i32, i32) = (2, 65.89); diff --git a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon index b76b062121ccf..0d435f341ab81 100644 --- a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon @@ -10,10 +10,10 @@ class Incomplete; -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: ERROR: Variable has incomplete type `(i32, Incomplete)`. +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error: Variable has incomplete type `(i32, Incomplete)` // CHECK:STDERR: var t: (i32, Incomplete); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: Class was forward declared here. +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var t: (i32, Incomplete); diff --git a/toolchain/check/testdata/tuple/fail_too_few_element.carbon b/toolchain/check/testdata/tuple/fail_too_few_element.carbon index 18ce6f28e3ccd..9c5abe72a8d9b 100644 --- a/toolchain/check/testdata/tuple/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuple/fail_too_few_element.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_too_few_element.carbon -// CHECK:STDERR: fail_too_few_element.carbon:[[@LINE+3]]:21: ERROR: Cannot initialize tuple of 2 element(s) from tuple with 1 element(s). +// CHECK:STDERR: fail_too_few_element.carbon:[[@LINE+3]]:21: error: cannot initialize tuple of 2 element(s) from tuple with 1 element(s). // CHECK:STDERR: var x: (i32, i32) = (2, ); // CHECK:STDERR: ^~~~~ var x: (i32, i32) = (2, ); diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index 12b555ead6269..01512b890557c 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_type_assign.carbon -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:18: ERROR: Cannot implicitly convert from `type` to `i32`. +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:18: error: cannot implicitly convert from `type` to `i32` // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: Type `type` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ var x: (i32, ) = (i32, ); diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index a75d753dfe391..e74f6b2c80641 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_value_as_type.carbon -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: ERROR: Cannot implicitly convert from `i32` to `type`. +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: Type `i32` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ var x: (1, ); diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 07dc6e6c7d274..f66f29844bdee 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -31,13 +31,13 @@ var c: C((1, 2)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+10]]:14: ERROR: Cannot initialize tuple of 2 element(s) from tuple with 3 element(s). +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+10]]:14: error: cannot initialize tuple of 2 element(s) from tuple with 3 element(s). // CHECK:STDERR: var c_bad: C((1, 2, 3)) = F(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:6: In import. +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:6: in import // CHECK:STDERR: impl package Implicit; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: implicit.carbon:7:9: Initializing generic parameter `X` declared here. +// CHECK:STDERR: implicit.carbon:7:9: initializing generic parameter `X` declared here // CHECK:STDERR: class C(X:! (i32, i32)) {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -47,10 +47,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: ERROR: Cannot implicitly convert from `C` to `C`. +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C` to `C` // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: Type `C` does not implement interface `ImplicitAs`. +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); diff --git a/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon b/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon index ff6c894e1d359..575a17c71d6fb 100644 --- a/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon -// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:16: ERROR: Cannot initialize tuple of 1 element(s) from tuple with 0 element(s). +// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:16: error: cannot initialize tuple of 1 element(s) from tuple with 0 element(s). // CHECK:STDERR: var x: ((),) = (); // CHECK:STDERR: ^~ var x: ((),) = (); diff --git a/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon b/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon index 3d2199958fe87..228c3308e0d4b 100644 --- a/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon -// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: ERROR: Cannot initialize tuple of 0 element(s) from tuple with 1 element(s). +// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: error: cannot initialize tuple of 0 element(s) from tuple with 1 element(s). // CHECK:STDERR: var x: () = ((),); // CHECK:STDERR: ^~~~~ var x: () = ((),); diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 63cfa4b317470..0a8370865d80d 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -14,14 +14,14 @@ class X { fn F(x: X) { // TODO: Strings should eventually be copyable, once we decide how to // represent them. - // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:19: ERROR: Cannot copy value of type `String`. + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:19: error: cannot copy value of type `String` // CHECK:STDERR: var s: String = "hello"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var s: String = "hello"; // TODO: Decide on rules for when classes are copyable. - // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+3]]:14: ERROR: Cannot copy value of type `X`. + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+3]]:14: error: cannot copy value of type `X` // CHECK:STDERR: var y: X = x; // CHECK:STDERR: ^ var y: X = x; diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index d7b7ac31a523a..c1383c25b4fd8 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_storage_is_literal.carbon fn Main() { - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+6]]:10: ERROR: Cannot implicitly convert from `i32` to `type`. + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: Type `i32` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ var x: 1 = 1; diff --git a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon index 0e6393cb548dd..7149039333a7d 100644 --- a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon +++ b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon @@ -8,49 +8,49 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_todo_control_flow_init.carbon -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:13: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:13: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:21: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:21: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var x: () = if true then () else (); -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:14: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:14: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:23: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:23: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var x2: () = if false then () else (); -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:15: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:15: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var y: bool = true or false; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:15: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:15: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var y: bool = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: var y: bool = true or false; -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+7]]:16: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+7]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+3]]:16: ERROR: Semantics TODO: `Control flow expressions are currently only supported inside functions.`. +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+3]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~~~~~~ var y2: bool = false or true; diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/no_prelude/export_name.carbon index 587499b9381b9..0c44b135e8eac 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/no_prelude/export_name.carbon @@ -34,13 +34,13 @@ export v; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+9]]:1: In import. +// CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+9]]:1: in import // CHECK:STDERR: import library "export"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: export.carbon:4:1: In import. +// CHECK:STDERR: export.carbon:4:1: in import // CHECK:STDERR: import library "base"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: base.carbon:4:5: ERROR: Semantics TODO: `Non-constant ImportRefLoaded (comes up with var)`. +// CHECK:STDERR: base.carbon:4:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` // CHECK:STDERR: var v: (); // CHECK:STDERR: ^ import library "export"; diff --git a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon index 16b7104463142..85873746ebc6f 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon @@ -11,10 +11,10 @@ fn Main() { var x: () = (); - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: ERROR: Duplicate name being declared in the same scope. + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope // CHECK:STDERR: var x: () = (); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: Name is previously declared here. + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: name is previously declared here // CHECK:STDERR: var x: () = (); // CHECK:STDERR: ^ var x: () = (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon index 74cf89cb8dcac..df490538c51c5 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_generic.carbon fn Main() { - // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:11: ERROR: `var` declaration cannot declare a compile-time binding. + // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:11: error: `var` declaration cannot declare a compile-time binding // CHECK:STDERR: var x:! () = (); // CHECK:STDERR: ^~ var x:! () = (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon index ade64a54f35e5..5d707fea02129 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon fn Main() { - // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:3: ERROR: Package `Core` implicitly referenced here, but not found. + // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:3: error: package `Core` implicitly referenced here, but not found // CHECK:STDERR: var x: {} = (); // CHECK:STDERR: ^~~~~~~~~~~~~~~ var x: {} = (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon index 4bbade0171dad..cc3815ddec313 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon fn Main() { - // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:15: ERROR: Name `x` not found. + // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:15: error: name `x` not found // CHECK:STDERR: var x: () = x; // CHECK:STDERR: ^ var x: () = x; diff --git a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon index d9908208907b4..fc0b8de67f68a 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon @@ -12,7 +12,7 @@ fn Main() { var x: (); } -// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:13: ERROR: Name `x` not found. +// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:13: error: name `x` not found // CHECK:STDERR: var y: () = x; // CHECK:STDERR: ^ var y: () = x; diff --git a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon index 4ad8ae1bbe13d..abc6de74947cd 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon @@ -8,35 +8,35 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `protected` not allowed on `var` declaration at file scope, `protected` is only allowed on class members. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed on `var` declaration at file scope, `protected` is only allowed on class members // CHECK:STDERR: protected var b: (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: protected var b: (); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: ERROR: `protected` not allowed on declaration with `private`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` not allowed on declaration with `private` // CHECK:STDERR: private protected var c: (); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `private` previously appeared here // CHECK:STDERR: private protected var c: (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private protected var c: (); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: ERROR: `protected` not allowed on `var` declaration at file scope, `protected` is only allowed on class members. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `protected` not allowed on `var` declaration at file scope, `protected` is only allowed on class members // CHECK:STDERR: protected protected var d: (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: ERROR: `protected` repeated on declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: error: `protected` repeated on declaration // CHECK:STDERR: protected protected var d: (); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `protected` previously appeared here. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: `protected` previously appeared here // CHECK:STDERR: protected protected var d: (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: protected protected var d: (); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: ERROR: `abstract` not allowed on `var` declaration. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `abstract` not allowed on `var` declaration // CHECK:STDERR: abstract var e: (); // CHECK:STDERR: ^~~~~~~~ abstract var e: (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon index 774075da37473..26c46b63a0110 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon @@ -10,19 +10,19 @@ namespace A; -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+7]]:5: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+7]]:5: error: duplicate name being declared in the same scope // CHECK:STDERR: var A: (); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-5]]:1: Name is previously declared here. +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-5]]:1: name is previously declared here // CHECK:STDERR: namespace A; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: var A: (); -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+6]]:5: ERROR: Duplicate name being declared in the same scope. +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+6]]:5: error: duplicate name being declared in the same scope // CHECK:STDERR: var A: () = (); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-14]]:1: Name is previously declared here. +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-14]]:1: name is previously declared here // CHECK:STDERR: namespace A; // CHECK:STDERR: ^~~~~~~~~~~~ var A: () = (); diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index 15fd086e20daf..d071696e155f1 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -34,7 +34,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:14: ERROR: Name `v` not found. +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:14: error: name `v` not found // CHECK:STDERR: var v2: () = v; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -46,7 +46,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: ERROR: Name `v` not found. +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: name `v` not found // CHECK:STDERR: var v2: () = Test.v; // CHECK:STDERR: ^~~~~~ var v2: () = Test.v; diff --git a/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon b/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon index 74312758b836b..e084fd6ab9c30 100644 --- a/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon +++ b/toolchain/check/testdata/where_expr/no_prelude/fail_designator.carbon @@ -14,7 +14,7 @@ library "[[@TEST_NAME]]"; fn Foo() -> () { var x: (); - // CHECK:STDERR: fail_designator_matches_var.carbon:[[@LINE+4]]:10: ERROR: Semantics TODO: `HandleDesignatorExpr`. + // CHECK:STDERR: fail_designator_matches_var.carbon:[[@LINE+4]]:10: error: semantics TODO: `HandleDesignatorExpr` // CHECK:STDERR: return .x; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -26,7 +26,7 @@ fn Foo() -> () { library "[[@TEST_NAME]]"; fn Bar() -> () { - // CHECK:STDERR: fail_unknown_designator.carbon:[[@LINE+4]]:10: ERROR: Semantics TODO: `HandleDesignatorExpr`. + // CHECK:STDERR: fail_unknown_designator.carbon:[[@LINE+4]]:10: error: semantics TODO: `HandleDesignatorExpr` // CHECK:STDERR: return .undef; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -38,7 +38,7 @@ fn Bar() -> () { library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_dot_self_method_return_value.carbon:[[@LINE+4]]:28: ERROR: Semantics TODO: `HandleSelfTypeName`. + // CHECK:STDERR: fail_dot_self_method_return_value.carbon:[[@LINE+4]]:28: error: semantics TODO: `HandleSelfTypeName` // CHECK:STDERR: fn F() -> Self { return .Self; } // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -50,7 +50,7 @@ class C { library "[[@TEST_NAME]]"; class D { - // CHECK:STDERR: fail_dot_self_method_return_type.carbon:[[@LINE+3]]:14: ERROR: Semantics TODO: `HandleSelfTypeName`. + // CHECK:STDERR: fail_dot_self_method_return_type.carbon:[[@LINE+3]]:14: error: semantics TODO: `HandleSelfTypeName` // CHECK:STDERR: fn G() -> .Self { return Self; } // CHECK:STDERR: ^~~~ fn G() -> .Self { return Self; } diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index dcf73f19ccf04..ba997323172e7 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/while/fail_bad_condition.carbon fn While() { - // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: ERROR: Cannot implicitly convert from `String` to `bool`. + // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `String` to `bool` // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: Type `String` does not implement interface `ImplicitAs`. + // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ while ("Hello") {} diff --git a/toolchain/check/testdata/while/fail_break_continue.carbon b/toolchain/check/testdata/while/fail_break_continue.carbon index 3447012de0063..ca784a4c28385 100644 --- a/toolchain/check/testdata/while/fail_break_continue.carbon +++ b/toolchain/check/testdata/while/fail_break_continue.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/while/fail_break_continue.carbon fn While() { - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: ERROR: `continue` can only be used in a loop. + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `continue` can only be used in a loop // CHECK:STDERR: continue; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: continue; - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: ERROR: `break` can only be used in a loop. + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `break` can only be used in a loop // CHECK:STDERR: break; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -23,12 +23,12 @@ fn While() { continue; break; } - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: ERROR: `continue` can only be used in a loop. + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `continue` can only be used in a loop // CHECK:STDERR: continue; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: continue; - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+3]]:3: ERROR: `break` can only be used in a loop. + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+3]]:3: error: `break` can only be used in a loop // CHECK:STDERR: break; // CHECK:STDERR: ^~~~~ break; diff --git a/toolchain/codegen/codegen.cpp b/toolchain/codegen/codegen.cpp index 9d63b30d38a7b..ad0de8fb07330 100644 --- a/toolchain/codegen/codegen.cpp +++ b/toolchain/codegen/codegen.cpp @@ -20,7 +20,7 @@ auto CodeGen::Make(llvm::Module& module, llvm::StringRef target_triple, llvm::TargetRegistry::lookupTarget(target_triple, error); if (!target) { - errors << "ERROR: Invalid target: " << error << "\n"; + errors << "error: invalid target: " << error << "\n"; return {}; } module.setTargetTriple(target_triple); @@ -53,7 +53,7 @@ auto CodeGen::EmitCode(llvm::raw_pwrite_stream& out, llvm::legacy::PassManager pass; // Note that this returns true on an error. if (target_machine_->addPassesToEmitFile(pass, out, nullptr, file_type)) { - errors_ << "ERROR: Unable to emit to this file.\n"; + errors_ << "error: unable to emit to this file\n"; return false; } diff --git a/toolchain/codegen/testdata/fail_target_triple.carbon b/toolchain/codegen/testdata/fail_target_triple.carbon index 3c9f35cc733ae..dcceae7684a4a 100644 --- a/toolchain/codegen/testdata/fail_target_triple.carbon +++ b/toolchain/codegen/testdata/fail_target_triple.carbon @@ -9,6 +9,6 @@ // To dump output, run: // bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/codegen/testdata/fail_target_triple.carbon // NOAUTOUPDATE -// CHECK:STDERR: ERROR: Invalid target: {{.*}}x86_687{{.*}} +// CHECK:STDERR: error: invalid target: {{.*}}x86_687{{.*}} fn Main() {} diff --git a/toolchain/diagnostics/diagnostic.h b/toolchain/diagnostics/diagnostic.h index 44c62174e68d4..98b2426f28e81 100644 --- a/toolchain/diagnostics/diagnostic.h +++ b/toolchain/diagnostics/diagnostic.h @@ -28,8 +28,8 @@ enum class DiagnosticLevel : int8_t { }; // Provides a definition of a diagnostic. For example: -// CARBON_DIAGNOSTIC(MyDiagnostic, Error, "Invalid code!"); -// CARBON_DIAGNOSTIC(MyDiagnostic, Warning, "Found {0}, expected {1}.", +// CARBON_DIAGNOSTIC(MyDiagnostic, Error, "invalid code!"); +// CARBON_DIAGNOSTIC(MyDiagnostic, Warning, "found {0}, expected {1}", // std::string, std::string); // // Arguments are passed to llvm::formatv; see: diff --git a/toolchain/diagnostics/diagnostic_consumer.cpp b/toolchain/diagnostics/diagnostic_consumer.cpp index 8e5e3e40f6a71..b4bf3a353c9a5 100644 --- a/toolchain/diagnostics/diagnostic_consumer.cpp +++ b/toolchain/diagnostics/diagnostic_consumer.cpp @@ -21,10 +21,10 @@ auto StreamDiagnosticConsumer::HandleDiagnostic(Diagnostic diagnostic) -> void { *stream_ << ": "; switch (message.level) { case DiagnosticLevel::Error: - *stream_ << "ERROR: "; + *stream_ << "error: "; break; case DiagnosticLevel::Warning: - *stream_ << "WARNING: "; + *stream_ << "warning: "; break; case DiagnosticLevel::Note: break; diff --git a/toolchain/diagnostics/testdata/fail_multiline_token.carbon b/toolchain/diagnostics/testdata/fail_multiline_token.carbon index 83f428e51b8c6..75ae95b0983f8 100644 --- a/toolchain/diagnostics/testdata/fail_multiline_token.carbon +++ b/toolchain/diagnostics/testdata/fail_multiline_token.carbon @@ -10,7 +10,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/diagnostics/testdata/fail_multiline_token.carbon -// CHECK:STDERR: fail_multiline_token.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer. +// CHECK:STDERR: fail_multiline_token.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer // CHECK:STDERR: ''' // CHECK:STDERR: ^~~ ''' diff --git a/toolchain/docs/diagnostics.md b/toolchain/docs/diagnostics.md index fef7428850dd6..2f6399307fd06 100644 --- a/toolchain/docs/diagnostics.md +++ b/toolchain/docs/diagnostics.md @@ -71,7 +71,7 @@ Diagnostics are used to surface issues from compilation. A simple diagnostic looks like: ```cpp -CARBON_DIAGNOSTIC(InvalidCode, Error, "Code is invalid"); +CARBON_DIAGNOSTIC(InvalidCode, Error, "code is invalid"); emitter.Emit(location, InvalidCode); ``` @@ -85,7 +85,7 @@ the `DiagnosticEmitter`. A diagnostic with an argument looks like: ```cpp -CARBON_DIAGNOSTIC(InvalidCharacter, Error, "Invalid character {0}.", char); +CARBON_DIAGNOSTIC(InvalidCharacter, Error, "invalid character {0}", char); emitter.Emit(location, InvalidCharacter, invalid_char); ``` @@ -127,7 +127,7 @@ CARBON_DIAGNOSTIC(CallArgCountMismatch, Error, "{1} argument(s).", int, int); CARBON_DIAGNOSTIC(InCallToFunction, Note, - "Calling function declared here."); + "calling function declared here"); context.emitter() .Build(call_parse_node, CallArgCountMismatch, arg_refs.size(), param_refs.size()) @@ -147,7 +147,7 @@ DiagnosticAnnotationScope annotate_diagnostics( &context.emitter(), [&](auto& builder) { CARBON_DIAGNOSTIC( InCallToFunctionParam, Note, - "Initializing parameter {0} of function declared here.", int); + "initializing parameter {0} of function declared here", int); builder.Note(param_parse_node, InCallToFunctionParam, diag_param_index + 1); }); diff --git a/toolchain/docs/parse.md b/toolchain/docs/parse.md index 397fc208739b3..50465bdf994ad 100644 --- a/toolchain/docs/parse.md +++ b/toolchain/docs/parse.md @@ -718,7 +718,7 @@ if (auto as = context.ConsumeIf(Lex::TokenKind::As)) { } else { if (!state.has_error) { CARBON_DIAGNOSTIC(ImplExpectedAs, Error, - "Expected `as` in `impl` declaration."); + "expected `as` in `impl` declaration"); context.emitter().Emit(*context.position(), ImplExpectedAs); } context.ReturnErrorOnState(); diff --git a/toolchain/driver/compile_subcommand.cpp b/toolchain/driver/compile_subcommand.cpp index 98891e1e34c25..d944795cfa2ba 100644 --- a/toolchain/driver/compile_subcommand.cpp +++ b/toolchain/driver/compile_subcommand.cpp @@ -270,27 +270,27 @@ auto CompileSubcommand::ValidateOptions(DriverEnv& driver_env) const -> bool { case Phase::Lex: if (options_.dump_parse_tree) { driver_env.error_stream - << "ERROR: Requested dumping the parse tree but compile " + << "error: requested dumping the parse tree but compile " "phase is limited to '" - << options_.phase << "'.\n"; + << options_.phase << "'\n"; return false; } [[fallthrough]]; case Phase::Parse: if (options_.dump_sem_ir) { driver_env.error_stream - << "ERROR: Requested dumping the SemIR but compile phase " + << "error: requested dumping the SemIR but compile phase " "is limited to '" - << options_.phase << "'.\n"; + << options_.phase << "'\n"; return false; } [[fallthrough]]; case Phase::Check: if (options_.dump_llvm_ir) { driver_env.error_stream - << "ERROR: Requested dumping the LLVM IR but compile " + << "error: requested dumping the LLVM IR but compile " "phase is limited to '" - << options_.phase << "'.\n"; + << options_.phase << "'\n"; return false; } [[fallthrough]]; @@ -521,8 +521,8 @@ class CompilationUnit { if (!source_->is_regular_file()) { // Don't invent file names like `-.o` or `/dev/stdin.o`. driver_env_->error_stream - << "ERROR: Output file name must be specified for input '" - << input_filename_ << "' that is not a regular file.\n"; + << "error: output file name must be specified for input '" + << input_filename_ << "' that is not a regular file\n"; return false; } output_filename = input_filename_; @@ -541,7 +541,7 @@ class CompilationUnit { llvm::raw_fd_ostream output_file(output_filename, ec, llvm::sys::fs::OF_None); if (ec) { - driver_env_->error_stream << "ERROR: Could not open output file '" + driver_env_->error_stream << "error: could not open output file '" << output_filename << "': " << ec.message() << "\n"; return false; @@ -628,7 +628,7 @@ auto CompileSubcommand::Run(DriverEnv& driver_env) -> DriverResult { if (auto find = driver_env.installation->ReadPreludeManifest(); find.ok()) { prelude = std::move(*find); } else { - driver_env.error_stream << "ERROR: " << find.error() << "\n"; + driver_env.error_stream << "error: " << find.error() << "\n"; return {.success = false}; } } diff --git a/toolchain/driver/driver_fuzzer.cpp b/toolchain/driver/driver_fuzzer.cpp index 4cb9b7b6a2522..a5e145aea9a8e 100644 --- a/toolchain/driver/driver_fuzzer.cpp +++ b/toolchain/driver/driver_fuzzer.cpp @@ -83,7 +83,10 @@ extern "C" auto LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) llvm::raw_null_ostream dest; Driver d(fs, install_paths, dest, error_stream); if (!d.RunCommand(args).success) { - if (error_stream.TakeStr().find("ERROR:") == std::string::npos) { + auto str = error_stream.TakeStr(); + // TODO: Fix command_line to use `error`, switch back to `find`. + if (llvm::StringRef(str).find_insensitive("error:") == + llvm::StringRef::npos) { llvm::errs() << "No error message on a failure!\n"; return 1; } diff --git a/toolchain/driver/driver_test.cpp b/toolchain/driver/driver_test.cpp index 2fbe05cdf046c..a051d9ab6c1da 100644 --- a/toolchain/driver/driver_test.cpp +++ b/toolchain/driver/driver_test.cpp @@ -129,7 +129,7 @@ TEST_F(DriverTest, CompileCommandErrors) { "--output=/dev/empty", empty_file}) .success); EXPECT_THAT(test_error_stream_.TakeStr(), - ContainsRegex("ERROR: .*/dev/empty.*")); + ContainsRegex("error: .*/dev/empty.*")); } TEST_F(DriverTest, DumpTokens) { diff --git a/toolchain/driver/testdata/fail_errors_in_two_files.carbon b/toolchain/driver/testdata/fail_errors_in_two_files.carbon index 56d0b1423d338..7b4f0ad14f4a6 100644 --- a/toolchain/driver/testdata/fail_errors_in_two_files.carbon +++ b/toolchain/driver/testdata/fail_errors_in_two_files.carbon @@ -12,7 +12,7 @@ // --- fail_file1.carbon -// CHECK:STDERR: fail_file1.carbon:[[@LINE+4]]:24: ERROR: Opening symbol without a corresponding closing symbol. +// CHECK:STDERR: fail_file1.carbon:[[@LINE+4]]:24: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: fn run(String program) { // CHECK:STDERR: ^ // CHECK:STDERR: @@ -21,7 +21,7 @@ fn run(String program) { // --- fail_file2.carbon -// CHECK:STDERR: fail_file2.carbon:[[@LINE+3]]:10: ERROR: Invalid digit 'a' in decimal numeric literal. +// CHECK:STDERR: fail_file2.carbon:[[@LINE+3]]:10: error: invalid digit 'a' in decimal numeric literal // CHECK:STDERR: var x = 3a; // CHECK:STDERR: ^ var x = 3a; diff --git a/toolchain/driver/testdata/fail_errors_sorted.carbon b/toolchain/driver/testdata/fail_errors_sorted.carbon index 256d7168a7f00..4b5da0d0efde4 100644 --- a/toolchain/driver/testdata/fail_errors_sorted.carbon +++ b/toolchain/driver/testdata/fail_errors_sorted.carbon @@ -10,14 +10,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_errors_sorted.carbon -// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+4]]:24: ERROR: Opening symbol without a corresponding closing symbol. +// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+4]]:24: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: fn run(String program) { // CHECK:STDERR: ^ // CHECK:STDERR: fn run(String program) { return True; -// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+3]]:10: ERROR: Invalid digit 'a' in decimal numeric literal. +// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+3]]:10: error: invalid digit 'a' in decimal numeric literal // CHECK:STDERR: var x = 3a; // CHECK:STDERR: ^ var x = 3a; diff --git a/toolchain/driver/testdata/fail_errors_streamed.carbon b/toolchain/driver/testdata/fail_errors_streamed.carbon index a052c0e7a3997..0a842c256d434 100644 --- a/toolchain/driver/testdata/fail_errors_streamed.carbon +++ b/toolchain/driver/testdata/fail_errors_streamed.carbon @@ -13,11 +13,11 @@ fn run(String program) { return True; -// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE+7]]:10: ERROR: Invalid digit 'a' in decimal numeric literal. +// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE+7]]:10: error: invalid digit 'a' in decimal numeric literal // CHECK:STDERR: var x = 3a; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE-7]]:24: ERROR: Opening symbol without a corresponding closing symbol. +// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE-7]]:24: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: fn run(String program) { // CHECK:STDERR: ^ var x = 3a; diff --git a/toolchain/driver/testdata/fail_flush_errors.carbon b/toolchain/driver/testdata/fail_flush_errors.carbon index 8245ac5749b78..df34d16feb9ef 100644 --- a/toolchain/driver/testdata/fail_flush_errors.carbon +++ b/toolchain/driver/testdata/fail_flush_errors.carbon @@ -13,7 +13,7 @@ fn F() { // Create diagnostics containing string references, and trigger reallocation // of the string table. - // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+4]]:3: ERROR: Name `undeclared1` not found. + // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+4]]:3: error: name `undeclared1` not found // CHECK:STDERR: undeclared1; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -23,7 +23,7 @@ fn F() { // literal storage. Use a hex escape to ensure that the tokenized buffer // allocates separate storage for the result. "undec\x6Cared2"; - // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+4]]:3: ERROR: Name `undeclared2` not found. + // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+4]]:3: error: name `undeclared2` not found // CHECK:STDERR: undeclared2; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -31,7 +31,7 @@ fn F() { // Add the name into the string table via a declaration rather than an expression. if (true) { var undeclared3: () = (); } - // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: ERROR: Name `undeclared3` not found. + // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: error: name `undeclared3` not found // CHECK:STDERR: undeclared3; // CHECK:STDERR: ^~~~~~~~~~~ undeclared3; diff --git a/toolchain/driver/testdata/fail_input_is_directory.carbon b/toolchain/driver/testdata/fail_input_is_directory.carbon index 1425b976c64c1..725e27bd5f4a9 100644 --- a/toolchain/driver/testdata/fail_input_is_directory.carbon +++ b/toolchain/driver/testdata/fail_input_is_directory.carbon @@ -9,4 +9,4 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/fail_input_is_directory.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_input_is_directory.carbon -// CHECK:STDERR: .: ERROR: Error opening file for read: Invalid argument +// CHECK:STDERR: .: error: error opening file for read: Invalid argument diff --git a/toolchain/driver/testdata/fail_missing_file.carbon b/toolchain/driver/testdata/fail_missing_file.carbon index 9aabadeaa9041..8c1ddaf795d25 100644 --- a/toolchain/driver/testdata/fail_missing_file.carbon +++ b/toolchain/driver/testdata/fail_missing_file.carbon @@ -9,4 +9,4 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/fail_missing_file.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_missing_file.carbon -// CHECK:STDERR: not_file.carbon: ERROR: Error opening file for read: No such file or directory +// CHECK:STDERR: not_file.carbon: error: error opening file for read: No such file or directory diff --git a/toolchain/driver/testdata/fail_missing_stdin_output.carbon b/toolchain/driver/testdata/fail_missing_stdin_output.carbon index 6dd31bdbead92..bda372a084d9c 100644 --- a/toolchain/driver/testdata/fail_missing_stdin_output.carbon +++ b/toolchain/driver/testdata/fail_missing_stdin_output.carbon @@ -9,4 +9,4 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/fail_missing_stdin_output.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_missing_stdin_output.carbon -// CHECK:STDERR: ERROR: Output file name must be specified for input '-' that is not a regular file. +// CHECK:STDERR: error: output file name must be specified for input '-' that is not a regular file diff --git a/toolchain/lex/helpers.cpp b/toolchain/lex/helpers.cpp index b147302d1b47f..df6499fee0058 100644 --- a/toolchain/lex/helpers.cpp +++ b/toolchain/lex/helpers.cpp @@ -20,8 +20,8 @@ auto CanLexInt(DiagnosticEmitter& emitter, llvm::StringRef text) if (text.size() > DigitLimit) { CARBON_DIAGNOSTIC( TooManyDigits, Error, - "Found a sequence of {0} digits, which is greater than the " - "limit of {1}.", + "found a sequence of {0} digits, which is greater than the " + "limit of {1}", size_t, size_t); emitter.Emit(text.begin(), TooManyDigits, text.size(), DigitLimit); return false; diff --git a/toolchain/lex/lex.cpp b/toolchain/lex/lex.cpp index c7461d8817c31..b3fe55c1eec36 100644 --- a/toolchain/lex/lex.cpp +++ b/toolchain/lex/lex.cpp @@ -820,11 +820,11 @@ auto Lexer::LexCR(llvm::StringRef source_text, ssize_t& position) -> void { } CARBON_DIAGNOSTIC(UnsupportedLFCRLineEnding, Error, - "The LF+CR line ending is not supported, only LF and CR+LF " - "are supported."); + "the LF+CR line ending is not supported, only LF and CR+LF " + "are supported"); CARBON_DIAGNOSTIC(UnsupportedCRLineEnding, Error, - "A raw CR line ending is not supported, only LF and CR+LF " - "are supported."); + "a raw CR line ending is not supported, only LF and CR+LF " + "are supported"); bool is_lfcr = position > 0 && source_text[position - 1] == '\n'; // TODO: This diagnostic has an unfortunate snippet -- we should tweak the // snippet rendering to gracefully handle CRs. @@ -865,7 +865,7 @@ auto Lexer::LexComment(llvm::StringRef source_text, ssize_t& position) -> void { const auto* line_info = current_line_info(); if (LLVM_UNLIKELY(position != line_info->start + line_info->indent)) { CARBON_DIAGNOSTIC(TrailingComment, Error, - "Trailing comments are not permitted."); + "trailing comments are not permitted"); emitter_.Emit(source_text.begin() + position, TrailingComment); @@ -882,7 +882,7 @@ auto Lexer::LexComment(llvm::StringRef source_text, ssize_t& position) -> void { if (position + 2 < static_cast(source_text.size()) && LLVM_UNLIKELY(!IsSpace(source_text[position + 2]))) { CARBON_DIAGNOSTIC(NoWhitespaceAfterCommentIntroducer, Error, - "Whitespace is required after '//'."); + "whitespace is required after '//'"); emitter_.Emit(source_text.begin() + position + 2, NoWhitespaceAfterCommentIntroducer); @@ -1052,7 +1052,7 @@ auto Lexer::LexStringLiteral(llvm::StringRef source_text, ssize_t& position) byte_offset); } else { CARBON_DIAGNOSTIC(UnterminatedString, Error, - "String is missing a terminator."); + "string is missing a terminator"); emitter_.Emit(literal->text().begin(), UnterminatedString); return LexTokenWithPayload(TokenKind::Error, literal_size, byte_offset); } @@ -1295,7 +1295,7 @@ auto Lexer::LexError(llvm::StringRef source_text, ssize_t& position) auto token = LexTokenWithPayload(TokenKind::Error, error_text.size(), position); CARBON_DIAGNOSTIC(UnrecognizedCharacters, Error, - "Encountered unrecognized characters while parsing."); + "encountered unrecognized characters while parsing"); emitter_.Emit(error_text.begin(), UnrecognizedCharacters); position += error_text.size(); @@ -1454,7 +1454,7 @@ class Lexer::ErrorRecoveryBuffer { static auto DiagnoseUnmatchedOpening(TokenDiagnosticEmitter& emitter, TokenIndex opening_token) -> void { CARBON_DIAGNOSTIC(UnmatchedOpening, Error, - "Opening symbol without a corresponding closing symbol."); + "opening symbol without a corresponding closing symbol"); emitter.Emit(opening_token, UnmatchedOpening); } @@ -1501,7 +1501,7 @@ auto Lexer::DiagnoseAndFixMismatchedBrackets() -> void { if (opening_it == open_groups_.rend()) { CARBON_DIAGNOSTIC( UnmatchedClosing, Error, - "Closing symbol without a corresponding opening symbol."); + "closing symbol without a corresponding opening symbol"); token_emitter_.Emit(token, UnmatchedClosing); fixes.ReplaceWithError(token); continue; diff --git a/toolchain/lex/numeric_literal.cpp b/toolchain/lex/numeric_literal.cpp index 8b78e2b01a68a..f528a679eeb33 100644 --- a/toolchain/lex/numeric_literal.cpp +++ b/toolchain/lex/numeric_literal.cpp @@ -301,7 +301,7 @@ auto NumericLiteral::Parser::CheckDigitSequence(llvm::StringRef text, if (!allow_digit_separators || i == 0 || text[i - 1] == '_' || i + 1 == n) { CARBON_DIAGNOSTIC(InvalidDigitSeparator, Error, - "Misplaced digit separator in numeric literal."); + "misplaced digit separator in numeric literal"); emitter_.Emit(text.begin() + 1, InvalidDigitSeparator); } ++num_digit_separators; @@ -309,7 +309,7 @@ auto NumericLiteral::Parser::CheckDigitSequence(llvm::StringRef text, } CARBON_DIAGNOSTIC(InvalidDigit, Error, - "Invalid digit '{0}' in {1} numeric literal.", char, + "invalid digit '{0}' in {1} numeric literal", char, NumericLiteral::Radix); emitter_.Emit(text.begin() + i, InvalidDigit, c, radix); return {.ok = false}; @@ -317,7 +317,7 @@ auto NumericLiteral::Parser::CheckDigitSequence(llvm::StringRef text, if (num_digit_separators == static_cast(text.size())) { CARBON_DIAGNOSTIC(EmptyDigitSequence, Error, - "Empty digit sequence in numeric literal."); + "empty digit sequence in numeric literal"); emitter_.Emit(text.begin(), EmptyDigitSequence); return {.ok = false}; } @@ -334,7 +334,7 @@ auto NumericLiteral::Parser::CheckLeadingZero() -> bool { if (radix_ == Radix::Decimal && int_part_.starts_with("0") && int_part_ != "0") { CARBON_DIAGNOSTIC(UnknownBaseSpecifier, Error, - "Unknown base specifier in numeric literal."); + "unknown base specifier in numeric literal"); emitter_.Emit(int_part_.begin(), UnknownBaseSpecifier); return false; } @@ -357,7 +357,7 @@ auto NumericLiteral::Parser::CheckFractionalPart() -> bool { if (radix_ == Radix::Binary) { CARBON_DIAGNOSTIC(BinaryRealLiteral, Error, - "Binary real number literals are not supported."); + "binary real number literals are not supported"); emitter_.Emit(literal_.text_.begin() + literal_.radix_point_, BinaryRealLiteral); // Carry on and parse the binary real literal anyway. @@ -380,7 +380,7 @@ auto NumericLiteral::Parser::CheckExponentPart() -> bool { char expected_exponent_kind = (radix_ == Radix::Decimal ? 'e' : 'p'); if (literal_.text_[literal_.exponent_] != expected_exponent_kind) { CARBON_DIAGNOSTIC(WrongRealLiteralExponent, Error, - "Expected '{0}' to introduce exponent.", char); + "expected '{0}' to introduce exponent", char); emitter_.Emit(literal_.text_.begin() + literal_.exponent_, WrongRealLiteralExponent, expected_exponent_kind); return false; diff --git a/toolchain/lex/string_literal.cpp b/toolchain/lex/string_literal.cpp index f32ff8b5c31fc..aff5c1d858592 100644 --- a/toolchain/lex/string_literal.cpp +++ b/toolchain/lex/string_literal.cpp @@ -213,8 +213,8 @@ static auto CheckIndent(LexerDiagnosticEmitter& emitter, llvm::StringRef text, if (indent.end() != content.end()) { CARBON_DIAGNOSTIC( ContentBeforeStringTerminator, Error, - "Only whitespace is permitted before the closing `'''` of a " - "multi-line string."); + "only whitespace is permitted before the closing `'''` of a " + "multi-line string"); emitter.Emit(indent.end(), ContentBeforeStringTerminator); } @@ -231,16 +231,16 @@ static auto ExpandUnicodeEscapeSequence(LexerDiagnosticEmitter& emitter, } if (digits.getAsInteger(16, code_point) || code_point > 0x10FFFF) { CARBON_DIAGNOSTIC(UnicodeEscapeTooLarge, Error, - "Code point specified by `\\u{{...}}` escape is greater " - "than 0x10FFFF."); + "code point specified by `\\u{{...}}` escape is greater " + "than 0x10FFFF"); emitter.Emit(digits.begin(), UnicodeEscapeTooLarge); return false; } if (code_point >= 0xD800 && code_point < 0xE000) { CARBON_DIAGNOSTIC(UnicodeEscapeSurrogate, Error, - "Code point specified by `\\u{{...}}` escape is a " - "surrogate character."); + "code point specified by `\\u{{...}}` escape is a " + "surrogate character"); emitter.Emit(digits.begin(), UnicodeEscapeSurrogate); return false; } @@ -310,8 +310,8 @@ static auto ExpandAndConsumeEscapeSequence(LexerDiagnosticEmitter& emitter, if (!content.empty() && IsDecimalDigit(content.front())) { CARBON_DIAGNOSTIC( DecimalEscapeSequence, Error, - "Decimal digit follows `\\0` escape sequence. Use `\\x00` instead " - "of `\\0` if the next character is a digit."); + "decimal digit follows `\\0` escape sequence. Use `\\x00` instead " + "of `\\0` if the next character is a digit"); emitter.Emit(content.begin(), DecimalEscapeSequence); return; } @@ -325,8 +325,8 @@ static auto ExpandAndConsumeEscapeSequence(LexerDiagnosticEmitter& emitter, return; } CARBON_DIAGNOSTIC(HexadecimalEscapeMissingDigits, Error, - "Escape sequence `\\x` must be followed by two " - "uppercase hexadecimal digits, for example `\\x0F`."); + "escape sequence `\\x` must be followed by two " + "uppercase hexadecimal digits, for example `\\x0F`"); emitter.Emit(content.begin(), HexadecimalEscapeMissingDigits); break; case 'u': { @@ -344,14 +344,14 @@ static auto ExpandAndConsumeEscapeSequence(LexerDiagnosticEmitter& emitter, } CARBON_DIAGNOSTIC( UnicodeEscapeMissingBracedDigits, Error, - "Escape sequence `\\u` must be followed by a braced sequence of " - "uppercase hexadecimal digits, for example `\\u{{70AD}}`."); + "escape sequence `\\u` must be followed by a braced sequence of " + "uppercase hexadecimal digits, for example `\\u{{70AD}}`"); emitter.Emit(content.begin(), UnicodeEscapeMissingBracedDigits); break; } default: CARBON_DIAGNOSTIC(UnknownEscapeSequence, Error, - "Unrecognized escape sequence `{0}`.", char); + "unrecognized escape sequence `{0}`", char); emitter.Emit(content.begin() - 1, UnknownEscapeSequence, first); break; } @@ -382,8 +382,8 @@ static auto ExpandEscapeSequencesAndRemoveIndent( if (!contents.starts_with("\n")) { CARBON_DIAGNOSTIC( MismatchedIndentInString, Error, - "Indentation does not match that of the closing `'''` in " - "multi-line string literal."); + "indentation does not match that of the closing `'''` in " + "multi-line string literal"); emitter.Emit(line_start, MismatchedIndentInString); } } @@ -433,8 +433,8 @@ static auto ExpandEscapeSequencesAndRemoveIndent( // `contents.begin() + after_space` in the diagnostic. CARBON_DIAGNOSTIC( InvalidHorizontalWhitespaceInString, Error, - "Whitespace other than plain space must be expressed with an " - "escape sequence in a string literal."); + "whitespace other than plain space must be expressed with an " + "escape sequence in a string literal"); emitter.Emit(contents.begin(), InvalidHorizontalWhitespaceInString); // Include the whitespace in the string contents for error recovery. AppendFrontOfContents(buffer_cursor, contents, after_space); @@ -472,7 +472,7 @@ auto StringLiteral::ComputeValue(llvm::BumpPtrAllocator& allocator, if (multi_line_ == MultiLineWithDoubleQuotes) { CARBON_DIAGNOSTIC( MultiLineStringWithDoubleQuotes, Error, - "Use `'''` delimiters for a multi-line string literal, not `\"\"\"`."); + "use `'''` delimiters for a multi-line string literal, not `\"\"\"`"); emitter.Emit(text_.begin(), MultiLineStringWithDoubleQuotes); } llvm::StringRef indent = diff --git a/toolchain/lex/testdata/fail_bad_comment_introducers.carbon b/toolchain/lex/testdata/fail_bad_comment_introducers.carbon index b9e648fb2c47c..f1ce40843f9a6 100644 --- a/toolchain/lex/testdata/fail_bad_comment_introducers.carbon +++ b/toolchain/lex/testdata/fail_bad_comment_introducers.carbon @@ -13,13 +13,13 @@ // // Comments have to have whitespace after `//` currently. -// CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:3: ERROR: Whitespace is required after '//'. +// CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:3: error: whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDERR: //abc - // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:7: ERROR: Whitespace is required after '//'. + // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:7: error: whitespace is required after '//' // CHECK:STDERR: //indented // CHECK:STDERR: ^ // CHECK:STDERR: @@ -28,7 +28,7 @@ // We only want to diagnose these on the first line of a block of similarly // indented comments. -// CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:3: ERROR: Whitespace is required after '//'. +// CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:3: error: whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDERR: @@ -36,7 +36,7 @@ //123 //dce - // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:11: ERROR: Whitespace is required after '//'. + // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:11: error: whitespace is required after '//' // CHECK:STDERR: //indented block // CHECK:STDERR: ^ // CHECK:STDERR: @@ -48,7 +48,7 @@ // As we have specialized code to scan short indented comment blocks, make sure // the behavior is preserved even for (absurdly) large indents. - // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+3]]:83: ERROR: Whitespace is required after '//'. + // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+3]]:83: error: whitespace is required after '//' // CHECK:STDERR: //very indented block // CHECK:STDERR: ^ //very indented block diff --git a/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon b/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon index 258180b29bd68..7a624b8f2f03a 100644 --- a/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon +++ b/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon @@ -23,15 +23,15 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon -// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-17]]:3: ERROR: Whitespace is required after '//'. +// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-17]]:3: error: whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-18]]:5: ERROR: Whitespace is required after '//'. +// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-18]]:5: error: whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-19]]:3: ERROR: Whitespace is required after '//'. +// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-19]]:3: error: whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_bad_comment_introducers_mid_block_indent_change.carbon diff --git a/toolchain/lex/testdata/fail_bad_raw_identifier.carbon b/toolchain/lex/testdata/fail_bad_raw_identifier.carbon index ce369822d2d3c..09370934763fe 100644 --- a/toolchain/lex/testdata/fail_bad_raw_identifier.carbon +++ b/toolchain/lex/testdata/fail_bad_raw_identifier.carbon @@ -15,7 +15,7 @@ // Missing the character after `#`. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing // CHECK:STDERR: r# // CHECK:STDERR: ^ // CHECK:STDERR: @@ -24,7 +24,7 @@ r# // CHECK:STDOUT: { index: 2, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#' }, // Not a valid identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing // CHECK:STDERR: r#3 // CHECK:STDERR: ^ // CHECK:STDERR: @@ -34,7 +34,7 @@ r#3 // CHECK:STDOUT: { index: 5, kind: 'IntLiteral', line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: '3', value: `3` }, // Non ascii start to identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing // CHECK:STDERR: r#á // CHECK:STDERR: ^ // CHECK:STDERR: @@ -43,7 +43,7 @@ r#á // CHECK:STDOUT: { index: 7, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#á' }, // Raw `r` identifier doesn't start a second raw identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error: encountered unrecognized characters while parsing // CHECK:STDERR: r#r#foo // CHECK:STDERR: ^ // CHECK:STDERR: @@ -53,7 +53,7 @@ r#r#foo // CHECK:STDOUT: { index: 10, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: 'foo', identifier: 1 }, // Other identifier characters don't start a raw identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing // CHECK:STDERR: s#foo // CHECK:STDERR: ^ // CHECK:STDERR: @@ -63,7 +63,7 @@ s#foo // CHECK:STDOUT: { index: 13, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: 'foo', identifier: 1 }, // Identifier ending in `r` doesn't start a raw identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error: encountered unrecognized characters while parsing // CHECK:STDERR: arr#foo // CHECK:STDERR: ^ // CHECK:STDERR: @@ -73,7 +73,7 @@ arr#foo // CHECK:STDOUT: { index: 16, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: 'foo', identifier: 1 }, // Whitespace between `r` and `#` isn't allowed. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:3: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:3: error: encountered unrecognized characters while parsing // CHECK:STDERR: r #foo // CHECK:STDERR: ^ // CHECK:STDERR: @@ -95,7 +95,7 @@ r#"hello"# // CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }, // Ensure that we correctly handle a `#` as the first token in the file. -// CHECK:STDERR: fail_hash_at_start_of_file.carbon:[[@LINE+3]]:1: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_hash_at_start_of_file.carbon:[[@LINE+3]]:1: error: encountered unrecognized characters while parsing // CHECK:STDERR: #foo // CHECK:STDERR: ^ #foo diff --git a/toolchain/lex/testdata/fail_block_string_second_line.carbon b/toolchain/lex/testdata/fail_block_string_second_line.carbon index 01caf32c49eac..7fa8f18eae5a6 100644 --- a/toolchain/lex/testdata/fail_block_string_second_line.carbon +++ b/toolchain/lex/testdata/fail_block_string_second_line.carbon @@ -13,7 +13,7 @@ var s: String = ''' // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_block_string_second_line.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_block_string_second_line.carbon -// CHECK:STDERR: fail_block_string_second_line.carbon:[[@LINE-10]]:3: ERROR: Only whitespace is permitted before the closing `'''` of a multi-line string. +// CHECK:STDERR: fail_block_string_second_line.carbon:[[@LINE-10]]:3: error: only whitespace is permitted before the closing `'''` of a multi-line string // CHECK:STDERR: error here: ''' // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_block_string_second_line.carbon diff --git a/toolchain/lex/testdata/fail_mismatched_brackets.carbon b/toolchain/lex/testdata/fail_mismatched_brackets.carbon index b65746fba8e4f..bb926015abb96 100644 --- a/toolchain/lex/testdata/fail_mismatched_brackets.carbon +++ b/toolchain/lex/testdata/fail_mismatched_brackets.carbon @@ -11,14 +11,14 @@ // CHECK:STDOUT: tokens: [ // CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }, -// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:1: ERROR: Closing symbol without a corresponding opening symbol. +// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:1: error: closing symbol without a corresponding opening symbol // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: } // CHECK:STDOUT: { index: 1, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '}', has_leading_space: true }, -// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:3: ERROR: Closing symbol without a corresponding opening symbol. +// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:3: error: closing symbol without a corresponding opening symbol // CHECK:STDERR: ( } ) // CHECK:STDERR: ^ // CHECK:STDERR: @@ -27,7 +27,7 @@ // CHECK:STDOUT: { index: 3, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: '}', has_leading_space: true }, // CHECK:STDOUT: { index: 4, kind: 'CloseParen', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: ')', opening_token: 2, has_leading_space: true }, -// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+3]]:1: ERROR: Opening symbol without a corresponding closing symbol. +// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+3]]:1: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: [ // CHECK:STDERR: ^ [ diff --git a/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon b/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon index 2af5cdaa99629..a25990c7a6402 100644 --- a/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon +++ b/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon @@ -18,7 +18,7 @@ fn F() { // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_mismatched_brackets_2.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_mismatched_brackets_2.carbon -// CHECK:STDERR: fail_mismatched_brackets_2.carbon:[[@LINE-9]]:1: ERROR: Closing symbol without a corresponding opening symbol. +// CHECK:STDERR: fail_mismatched_brackets_2.carbon:[[@LINE-9]]:1: error: closing symbol without a corresponding opening symbol // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_mismatched_brackets_2.carbon diff --git a/toolchain/lex/testdata/fail_multifile.carbon b/toolchain/lex/testdata/fail_multifile.carbon index 644983a69acef..aa14954282c02 100644 --- a/toolchain/lex/testdata/fail_multifile.carbon +++ b/toolchain/lex/testdata/fail_multifile.carbon @@ -12,7 +12,7 @@ // CHECK:STDOUT: - filename: fail_a.carbon // CHECK:STDOUT: tokens: [ // CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }, -// CHECK:STDERR: fail_a.carbon:[[@LINE+4]]:3: ERROR: Empty digit sequence in numeric literal. +// CHECK:STDERR: fail_a.carbon:[[@LINE+4]]:3: error: empty digit sequence in numeric literal // CHECK:STDERR: 1.a // CHECK:STDERR: ^ // CHECK:STDERR: @@ -25,7 +25,7 @@ // CHECK:STDOUT: - filename: fail_b.carbon // CHECK:STDOUT: tokens: [ // CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }, -// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:3: ERROR: Empty digit sequence in numeric literal. +// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:3: error: empty digit sequence in numeric literal // CHECK:STDERR: 2.b // CHECK:STDERR: ^ 2.b diff --git a/toolchain/lex/testdata/fail_trailing_comments.carbon b/toolchain/lex/testdata/fail_trailing_comments.carbon index 77b27c5bcf04e..e5a862b955073 100644 --- a/toolchain/lex/testdata/fail_trailing_comments.carbon +++ b/toolchain/lex/testdata/fail_trailing_comments.carbon @@ -16,15 +16,15 @@ var c: i32 = 0.4; // still more trailing comment // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_trailing_comments.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_trailing_comments.carbon -// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-11]]:19: ERROR: Trailing comments are not permitted. +// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-11]]:19: error: trailing comments are not permitted // CHECK:STDERR: var a: i32 = 1; // trailing comment // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-14]]:19: ERROR: Trailing comments are not permitted. +// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-14]]:19: error: trailing comments are not permitted // CHECK:STDERR: var b: 32 = 13; // more trailing comment // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-17]]:19: ERROR: Trailing comments are not permitted. +// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-17]]:19: error: trailing comments are not permitted // CHECK:STDERR: var c: i32 = 0.4; // still more trailing comment // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_trailing_comments.carbon diff --git a/toolchain/lower/testdata/basics/fail_before_lowering.carbon b/toolchain/lower/testdata/basics/fail_before_lowering.carbon index 6053a57f0da0f..ec9099c79d5d3 100644 --- a/toolchain/lower/testdata/basics/fail_before_lowering.carbon +++ b/toolchain/lower/testdata/basics/fail_before_lowering.carbon @@ -9,11 +9,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/basics/fail_before_lowering.carbon -// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+7]]:1: ERROR: Unrecognized declaration introducer. +// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+7]]:1: error: unrecognized declaration introducer // CHECK:STDERR: a; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: ERROR: Semantics TODO: `HandleInvalidParseStart`. +// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: error: semantics TODO: `HandleInvalidParseStart` // CHECK:STDERR: a; // CHECK:STDERR: ^ a; diff --git a/toolchain/parse/context.cpp b/toolchain/parse/context.cpp index 31312fd42f484..0daead8f9a26f 100644 --- a/toolchain/parse/context.cpp +++ b/toolchain/parse/context.cpp @@ -85,7 +85,7 @@ auto Context::ConsumeAndAddOpenParen(Lex::TokenIndex default_token, AddLeafNode(start_kind, *open_paren, /*has_error=*/false); return open_paren; } else { - CARBON_DIAGNOSTIC(ExpectedParenAfter, Error, "Expected `(` after `{0}`.", + CARBON_DIAGNOSTIC(ExpectedParenAfter, Error, "expected `(` after `{0}`", Lex::TokenKind); emitter_->Emit(*position_, ExpectedParenAfter, tokens().GetKind(default_token)); @@ -107,7 +107,7 @@ auto Context::ConsumeAndAddCloseSymbol(Lex::TokenIndex expected_open, // TODO: Include the location of the matching opening delimiter in the // diagnostic. CARBON_DIAGNOSTIC(ExpectedCloseSymbol, Error, - "Unexpected tokens before `{0}`.", llvm::StringLiteral); + "unexpected tokens before `{0}`", llvm::StringLiteral); emitter_->Emit(*position_, ExpectedCloseSymbol, open_token_kind.closing_symbol().fixed_spelling()); @@ -309,7 +309,7 @@ auto Context::DiagnoseOperatorFixity(OperatorFixity fixity) -> void { // Infix operators must satisfy the infix operator rules. if (!IsLexicallyValidInfixOperator()) { CARBON_DIAGNOSTIC(BinaryOperatorRequiresWhitespace, Error, - "Whitespace missing {0} binary operator.", RelativeLoc); + "whitespace missing {0} binary operator", RelativeLoc); emitter_->Emit(*position_, BinaryOperatorRequiresWhitespace, tokens().HasLeadingWhitespace(*position_) ? RelativeLoc::After @@ -325,14 +325,14 @@ auto Context::DiagnoseOperatorFixity(OperatorFixity fixity) -> void { if ((prefix ? tokens().HasTrailingWhitespace(*position_) : tokens().HasLeadingWhitespace(*position_))) { CARBON_DIAGNOSTIC(UnaryOperatorHasWhitespace, Error, - "Whitespace is not allowed {0} this unary operator.", + "whitespace is not allowed {0} this unary operator", RelativeLoc); emitter_->Emit(*position_, UnaryOperatorHasWhitespace, prefix ? RelativeLoc::After : RelativeLoc::Before); } else if (IsLexicallyValidInfixOperator()) { // Pre/postfix operators must not satisfy the infix operator rules. CARBON_DIAGNOSTIC(UnaryOperatorRequiresWhitespace, Error, - "Whitespace is required {0} this unary operator.", + "whitespace is required {0} this unary operator", RelativeLoc); emitter_->Emit(*position_, UnaryOperatorRequiresWhitespace, prefix ? RelativeLoc::Before : RelativeLoc::After); @@ -346,7 +346,7 @@ auto Context::ConsumeListToken(NodeKind comma_kind, Lex::TokenKind close_kind, // Don't error a second time on the same element. if (!already_has_error) { CARBON_DIAGNOSTIC(UnexpectedTokenAfterListElement, Error, - "Expected `,` or `{0}`.", Lex::TokenKind); + "expected `,` or `{0}`", Lex::TokenKind); emitter_->Emit(*position_, UnexpectedTokenAfterListElement, close_kind); ReturnErrorOnState(); } @@ -421,9 +421,9 @@ auto Context::ParseLibraryName(bool accept_default) CARBON_DIAGNOSTIC( ExpectedLibraryNameOrDefault, Error, - "Expected `default` or a string literal to specify the library name."); + "expected `default` or a string literal to specify the library name"); CARBON_DIAGNOSTIC(ExpectedLibraryName, Error, - "Expected a string literal to specify the library name."); + "expected a string literal to specify the library name"); emitter().Emit(*position(), accept_default ? ExpectedLibraryNameOrDefault : ExpectedLibraryName); return std::nullopt; @@ -442,7 +442,7 @@ auto Context::ParseLibrarySpecifier(bool accept_default) auto Context::DiagnoseExpectedDeclSemi(Lex::TokenKind expected_kind) -> void { CARBON_DIAGNOSTIC(ExpectedDeclSemi, Error, - "`{0}` declarations must end with a `;`.", Lex::TokenKind); + "`{0}` declarations must end with a `;`", Lex::TokenKind); emitter().Emit(*position(), ExpectedDeclSemi, expected_kind); } @@ -450,7 +450,7 @@ auto Context::DiagnoseExpectedDeclSemiOrDefinition(Lex::TokenKind expected_kind) -> void { CARBON_DIAGNOSTIC(ExpectedDeclSemiOrDefinition, Error, "`{0}` declarations must either end with a `;` or " - "have a `{{ ... }` block for a definition.", + "have a `{{ ... }` block for a definition", Lex::TokenKind); emitter().Emit(*position(), ExpectedDeclSemiOrDefinition, expected_kind); } diff --git a/toolchain/parse/handle_alias.cpp b/toolchain/parse/handle_alias.cpp index e92279431fcae..7c977c448686d 100644 --- a/toolchain/parse/handle_alias.cpp +++ b/toolchain/parse/handle_alias.cpp @@ -33,7 +33,7 @@ auto HandleAliasAfterName(Context& context) -> void { context.PushState(State::Expr); } else { CARBON_DIAGNOSTIC(ExpectedAliasInitializer, Error, - "`alias` requires a `=` for the source."); + "`alias` requires a `=` for the source"); context.emitter().Emit(*context.position(), ExpectedAliasInitializer); context.RecoverFromDeclError(state, NodeKind::Alias, /*skip_past_likely_end=*/true); diff --git a/toolchain/parse/handle_array_expr.cpp b/toolchain/parse/handle_array_expr.cpp index 52197f8341afa..4bcfbc4fb4f51 100644 --- a/toolchain/parse/handle_array_expr.cpp +++ b/toolchain/parse/handle_array_expr.cpp @@ -25,7 +25,7 @@ auto HandleArrayExprSemi(Context& context) -> void { auto semi = context.ConsumeIf(Lex::TokenKind::Semi); if (!semi) { context.AddNode(NodeKind::ArrayExprSemi, *context.position(), true); - CARBON_DIAGNOSTIC(ExpectedArraySemi, Error, "Expected `;` in array type."); + CARBON_DIAGNOSTIC(ExpectedArraySemi, Error, "expected `;` in array type"); context.emitter().Emit(*context.position(), ExpectedArraySemi); state.has_error = true; } else { diff --git a/toolchain/parse/handle_base.cpp b/toolchain/parse/handle_base.cpp index c66198656b657..c96a18cec3541 100644 --- a/toolchain/parse/handle_base.cpp +++ b/toolchain/parse/handle_base.cpp @@ -17,7 +17,7 @@ auto HandleBaseAfterIntroducer(Context& context) -> void { // based on whether we're in a class, whether we have an `extend` // modifier, and the following tokens. CARBON_DIAGNOSTIC(ExpectedAfterBase, Error, - "`class` or `:` expected after `base`."); + "`class` or `:` expected after `base`"); context.emitter().Emit(*context.position(), ExpectedAfterBase); context.RecoverFromDeclError(state, NodeKind::BaseDecl, /*skip_past_likely_end=*/true); diff --git a/toolchain/parse/handle_binding_pattern.cpp b/toolchain/parse/handle_binding_pattern.cpp index 8a50ce7d29f9f..d77063f3bb0b7 100644 --- a/toolchain/parse/handle_binding_pattern.cpp +++ b/toolchain/parse/handle_binding_pattern.cpp @@ -28,8 +28,7 @@ auto HandleBindingPattern(Context& context) -> void { auto on_error = [&](llvm::StringLiteral expected) { if (!state.has_error) { CARBON_DIAGNOSTIC(ExpectedBindingPattern, Error, - "Expected {0} in binding pattern.", - llvm::StringLiteral); + "expected {0} in binding pattern", llvm::StringLiteral); context.emitter().Emit(*context.position(), ExpectedBindingPattern, expected); state.has_error = true; diff --git a/toolchain/parse/handle_brace_expr.cpp b/toolchain/parse/handle_brace_expr.cpp index b0f1ba9b517a1..42a0829a78b5f 100644 --- a/toolchain/parse/handle_brace_expr.cpp +++ b/toolchain/parse/handle_brace_expr.cpp @@ -26,7 +26,7 @@ static auto HandleBraceExprParamError(Context& context, bool is_value = param_finish_state == State::BraceExprParamFinishAsValue; bool is_unknown = param_finish_state == State::BraceExprParamFinishAsUnknown; CARBON_CHECK(is_type || is_value || is_unknown); - CARBON_DIAGNOSTIC(ExpectedStructLiteralField, Error, "Expected {0}{1}{2}.", + CARBON_DIAGNOSTIC(ExpectedStructLiteralField, Error, "expected {0}{1}{2}", llvm::StringLiteral, llvm::StringLiteral, llvm::StringLiteral); context.emitter().Emit( diff --git a/toolchain/parse/handle_choice.cpp b/toolchain/parse/handle_choice.cpp index 7ea27e492c335..af011615fa800 100644 --- a/toolchain/parse/handle_choice.cpp +++ b/toolchain/parse/handle_choice.cpp @@ -19,7 +19,7 @@ auto HandleChoiceDefinitionStart(Context& context) -> void { if (!context.PositionIs(Lex::TokenKind::OpenCurlyBrace)) { if (!state.has_error) { CARBON_DIAGNOSTIC(ExpectedChoiceDefinition, Error, - "Choice definition expected."); + "choice definition expected"); context.emitter().Emit(*context.position(), ExpectedChoiceDefinition); } @@ -54,7 +54,7 @@ auto HandleChoiceAlternative(Context& context) -> void { NodeKind::IdentifierName)) { if (!state.has_error) { CARBON_DIAGNOSTIC(ExpectedChoiceAlternativeName, Error, - "Expected choice alternative name."); + "expected choice alternative name"); context.emitter().Emit(*context.position(), ExpectedChoiceAlternativeName); } diff --git a/toolchain/parse/handle_code_block.cpp b/toolchain/parse/handle_code_block.cpp index ca8974eecdd41..88405c6dbfd13 100644 --- a/toolchain/parse/handle_code_block.cpp +++ b/toolchain/parse/handle_code_block.cpp @@ -19,7 +19,7 @@ auto HandleCodeBlock(Context& context) -> void { /*has_error=*/true); // Recover by parsing a single statement. - CARBON_DIAGNOSTIC(ExpectedCodeBlock, Error, "Expected braced code block."); + CARBON_DIAGNOSTIC(ExpectedCodeBlock, Error, "expected braced code block"); context.emitter().Emit(*context.position(), ExpectedCodeBlock); context.PushState(State::Statement); diff --git a/toolchain/parse/handle_decl_name_and_params.cpp b/toolchain/parse/handle_decl_name_and_params.cpp index b9cc659300c8b..24cba5d5c592a 100644 --- a/toolchain/parse/handle_decl_name_and_params.cpp +++ b/toolchain/parse/handle_decl_name_and_params.cpp @@ -20,11 +20,11 @@ auto HandleDeclNameAndParams(Context& context) -> void { } if (state.token == *context.position()) { CARBON_DIAGNOSTIC(ExpectedDeclNameAfterPeriod, Error, - "`.` should be followed by a name."); + "`.` should be followed by a name"); context.emitter().Emit(token, ExpectedDeclNameAfterPeriod); } else { CARBON_DIAGNOSTIC(ExpectedDeclName, Error, - "`{0}` introducer should be followed by a name.", + "`{0}` introducer should be followed by a name", Lex::TokenKind); context.emitter().Emit(token, ExpectedDeclName, context.tokens().GetKind(state.token)); @@ -68,7 +68,7 @@ auto HandleDeclNameAndParamsAfterImplicit(Context& context) -> void { if (!context.PositionIs(Lex::TokenKind::OpenParen)) { CARBON_DIAGNOSTIC( ParamsRequiredAfterImplicit, Error, - "A `(` for parameters is required after implicit parameters."); + "a `(` for parameters is required after implicit parameters"); context.emitter().Emit(*context.position(), ParamsRequiredAfterImplicit); context.ReturnErrorOnState(); return; diff --git a/toolchain/parse/handle_decl_scope_loop.cpp b/toolchain/parse/handle_decl_scope_loop.cpp index 2f6dc305930dc..81b16ae55b34d 100644 --- a/toolchain/parse/handle_decl_scope_loop.cpp +++ b/toolchain/parse/handle_decl_scope_loop.cpp @@ -25,7 +25,7 @@ static auto FinishAndSkipInvalidDecl(Context& context, int32_t subtree_start) static auto HandleUnrecognizedDecl(Context& context, int32_t subtree_start) -> void { CARBON_DIAGNOSTIC(UnrecognizedDecl, Error, - "Unrecognized declaration introducer."); + "unrecognized declaration introducer"); context.emitter().Emit(*context.position(), UnrecognizedDecl); FinishAndSkipInvalidDecl(context, subtree_start); } diff --git a/toolchain/parse/handle_expr.cpp b/toolchain/parse/handle_expr.cpp index 91b53c658dd08..489ad8ec16034 100644 --- a/toolchain/parse/handle_expr.cpp +++ b/toolchain/parse/handle_expr.cpp @@ -10,7 +10,7 @@ namespace Carbon::Parse { static auto DiagnoseStatementOperatorAsSubExpr(Context& context) -> void { CARBON_DIAGNOSTIC(StatementOperatorAsSubExpr, Error, - "Operator `{0}` can only be used as a complete statement.", + "operator `{0}` can only be used as a complete statement", Lex::TokenKind); context.emitter().Emit(*context.position(), StatementOperatorAsSubExpr, context.PositionKind()); @@ -32,7 +32,7 @@ auto HandleExpr(Context& context) -> void { OperatorPriority::RightFirst) { CARBON_DIAGNOSTIC( UnaryOperatorRequiresParentheses, Error, - "Parentheses are required around this unary `{0}` operator.", + "parentheses are required around this unary `{0}` operator", Lex::TokenKind); context.emitter().Emit(*context.position(), UnaryOperatorRequiresParentheses, @@ -182,7 +182,7 @@ auto HandleExprInPostfix(Context& context) -> void { // OK, `.Self`. } else { CARBON_DIAGNOSTIC(ExpectedIdentifierOrSelfAfterPeriod, Error, - "Expected identifier or `Self` after `.`."); + "expected identifier or `Self` after `.`"); context.emitter().Emit(*context.position(), ExpectedIdentifierOrSelfAfterPeriod); // Only consume if it is a number or word. @@ -211,7 +211,7 @@ auto HandleExprInPostfix(Context& context) -> void { // Add a node to keep the parse tree balanced. context.AddLeafNode(NodeKind::InvalidParse, *context.position(), /*has_error=*/true); - CARBON_DIAGNOSTIC(ExpectedExpr, Error, "Expected expression."); + CARBON_DIAGNOSTIC(ExpectedExpr, Error, "expected expression"); context.emitter().Emit(*context.position(), ExpectedExpr); context.ReturnErrorOnState(); break; @@ -292,7 +292,7 @@ auto HandleExprLoop(Context& context) -> void { OperatorPriority::RightFirst) { CARBON_DIAGNOSTIC( OperatorRequiresParentheses, Error, - "Parentheses are required to disambiguate operator precedence."); + "parentheses are required to disambiguate operator precedence"); context.emitter().Emit(*context.position(), OperatorRequiresParentheses); } else { // This operator wouldn't be allowed even if parenthesized. @@ -424,7 +424,7 @@ auto HandleExprStatementFinish(Context& context) -> void { if (!state.has_error) { CARBON_DIAGNOSTIC(ExpectedExprSemi, Error, - "Expected `;` after expression statement."); + "expected `;` after expression statement"); context.emitter().Emit(*context.position(), ExpectedExprSemi); } diff --git a/toolchain/parse/handle_function.cpp b/toolchain/parse/handle_function.cpp index 6d4e9caaddc8c..adfc061e4218c 100644 --- a/toolchain/parse/handle_function.cpp +++ b/toolchain/parse/handle_function.cpp @@ -57,7 +57,7 @@ auto HandleFunctionSignatureFinish(Context& context) -> void { if (!context.ConsumeAndAddLeafNodeIf(Lex::TokenKind::StringLiteral, NodeKind::BuiltinName)) { CARBON_DIAGNOSTIC(ExpectedBuiltinName, Error, - "Expected builtin function name after `=`."); + "expected builtin function name after `=`"); context.emitter().Emit(*context.position(), ExpectedBuiltinName); state.has_error = true; } diff --git a/toolchain/parse/handle_if_expr.cpp b/toolchain/parse/handle_if_expr.cpp index 830f13b8435be..577c2f54251a2 100644 --- a/toolchain/parse/handle_if_expr.cpp +++ b/toolchain/parse/handle_if_expr.cpp @@ -20,7 +20,7 @@ auto HandleIfExprFinishCondition(Context& context) -> void { } else { // TODO: Include the location of the `if` token. CARBON_DIAGNOSTIC(ExpectedThenAfterIf, Error, - "Expected `then` after `if` condition."); + "expected `then` after `if` condition"); if (!state.has_error) { context.emitter().Emit(*context.position(), ExpectedThenAfterIf); } @@ -45,7 +45,7 @@ auto HandleIfExprFinishThen(Context& context) -> void { } else { // TODO: Include the location of the `if` token. CARBON_DIAGNOSTIC(ExpectedElseAfterIf, Error, - "Expected `else` after `if ... then ...`."); + "expected `else` after `if ... then ...`"); if (!state.has_error) { context.emitter().Emit(*context.position(), ExpectedElseAfterIf); } diff --git a/toolchain/parse/handle_impl.cpp b/toolchain/parse/handle_impl.cpp index bd1a7b49a3be4..922e39b64f884 100644 --- a/toolchain/parse/handle_impl.cpp +++ b/toolchain/parse/handle_impl.cpp @@ -32,7 +32,7 @@ auto HandleImplAfterIntroducer(Context& context) -> void { context.PushState(State::PatternListAsImplicit); } else { CARBON_DIAGNOSTIC(ImplExpectedAfterForall, Error, - "Expected `[` after `forall` in `impl` declaration."); + "expected `[` after `forall` in `impl` declaration"); context.emitter().Emit(*context.position(), ImplExpectedAfterForall); context.ReturnErrorOnState(); // If we aren't producing a node from the PatternListAsImplicit state, @@ -69,7 +69,7 @@ auto HandleImplBeforeAs(Context& context) -> void { } else { if (!state.has_error) { CARBON_DIAGNOSTIC(ImplExpectedAs, Error, - "Expected `as` in `impl` declaration."); + "expected `as` in `impl` declaration"); context.emitter().Emit(*context.position(), ImplExpectedAs); } context.ReturnErrorOnState(); diff --git a/toolchain/parse/handle_import_and_package.cpp b/toolchain/parse/handle_import_and_package.cpp index 7b14fcde0c041..29815b1f9d69b 100644 --- a/toolchain/parse/handle_import_and_package.cpp +++ b/toolchain/parse/handle_import_and_package.cpp @@ -50,7 +50,7 @@ static auto HandleDeclContent(Context& context, Context::StateStackEntry state, state.has_error = true; CARBON_DIAGNOSTIC(ExportImportPackage, Error, - "`export` cannot be used when importing a package."); + "`export` cannot be used when importing a package"); context.emitter().Emit(*package_name_token, ExportImportPackage); } names.package_id = context.tokens().GetIdentifier(*package_name_token); @@ -58,9 +58,9 @@ static auto HandleDeclContent(Context& context, Context::StateStackEntry state, } else if (declaration == NodeKind::PackageDecl || !context.PositionIs(Lex::TokenKind::Library)) { CARBON_DIAGNOSTIC(ExpectedIdentifierAfterPackage, Error, - "Expected identifier after `package`."); + "expected identifier after `package`"); CARBON_DIAGNOSTIC(ExpectedIdentifierAfterImport, Error, - "Expected identifier or `library` after `import`."); + "expected identifier or `library` after `import`"); context.emitter().Emit(*context.position(), declaration == NodeKind::PackageDecl ? ExpectedIdentifierAfterPackage @@ -94,7 +94,7 @@ static auto HandleDeclContent(Context& context, Context::StateStackEntry state, // "..."` yet, then most probably the user forgot to add `library` // before the library name. CARBON_DIAGNOSTIC(MissingLibraryKeyword, Error, - "Missing `library` keyword."); + "missing `library` keyword"); context.emitter().Emit(*context.position(), MissingLibraryKeyword); on_parse_error(); return; @@ -134,8 +134,8 @@ static auto VerifyInImports(Context& context, Lex::TokenIndex intro_token) CARBON_DIAGNOSTIC(ImportTooLate, Error, "`import` declarations must come after the `package` " "declaration (if present) and before any other " - "entities in the file."); - CARBON_DIAGNOSTIC(FirstDecl, Note, "First declaration is here."); + "entities in the file"); + CARBON_DIAGNOSTIC(FirstDecl, Note, "first declaration is here"); context.emitter() .Build(intro_token, ImportTooLate) .Note(context.first_non_packaging_token(), FirstDecl) @@ -158,7 +158,7 @@ static auto RestrictExportToApi(Context& context, auto packaging = context.tree().packaging_decl(); if (!packaging || packaging->is_impl) { CARBON_DIAGNOSTIC(ExportFromImpl, Error, - "`export` is only allowed in API files."); + "`export` is only allowed in API files"); context.emitter().Emit(state.token, ExportFromImpl); state.has_error = true; } @@ -214,10 +214,10 @@ static auto HandlePackageAndLibraryDecls(Context& context, if (state.token != Lex::TokenIndex::FirstNonCommentToken) { CARBON_DIAGNOSTIC( PackageTooLate, Error, - "The `{0}` declaration must be the first non-comment line.", + "the `{0}` declaration must be the first non-comment line", Lex::TokenKind); CARBON_DIAGNOSTIC(FirstNonCommentLine, Note, - "First non-comment line is here."); + "first non-comment line is here"); context.emitter() .Build(state.token, PackageTooLate, intro_token_kind) .Note(Lex::TokenIndex::FirstNonCommentToken, FirstNonCommentLine) diff --git a/toolchain/parse/handle_match.cpp b/toolchain/parse/handle_match.cpp index d026eb69835c5..345412c7eb77a 100644 --- a/toolchain/parse/handle_match.cpp +++ b/toolchain/parse/handle_match.cpp @@ -12,7 +12,7 @@ namespace Carbon::Parse { // have a larger look at this code and how it produces parse errors. This may be // good to re-examine when someone is working on implementing match checking. static auto DiagnoseMatchParseTODO(Context& context) -> void { - CARBON_DIAGNOSTIC(MatchParseTODO, Error, "TODO: Improve match parsing."); + CARBON_DIAGNOSTIC(MatchParseTODO, Error, "TODO: improve match parsing"); context.emitter().Emit(*context.position(), MatchParseTODO); } @@ -24,7 +24,7 @@ static auto HandleStatementsBlockStart(Context& context, State finish, if (!context.PositionIs(Lex::TokenKind::EqualGreater)) { if (!state.has_error) { CARBON_DIAGNOSTIC(ExpectedMatchCaseArrow, Error, - "Expected `=>` introducing statement block."); + "expected `=>` introducing statement block"); context.emitter().Emit(*context.position(), ExpectedMatchCaseArrow); } @@ -40,7 +40,7 @@ static auto HandleStatementsBlockStart(Context& context, State finish, if (!context.PositionIs(Lex::TokenKind::OpenCurlyBrace)) { if (!state.has_error) { CARBON_DIAGNOSTIC(ExpectedMatchCaseBlock, Error, - "Expected `{{` after `=>`."); + "expected `{{` after `=>`"); context.emitter().Emit(*context.position(), ExpectedMatchCaseBlock); } @@ -57,7 +57,7 @@ static auto HandleStatementsBlockStart(Context& context, State finish, static auto EmitUnexpectedTokenAndRecover(Context& context) -> void { CARBON_DIAGNOSTIC(UnexpectedTokenInMatchCasesBlock, Error, - "Unexpected `{0}`; expected `case`, `default` or `}`.", + "unexpected `{0}`; expected `case`, `default` or `}`", Lex::TokenKind); context.emitter().Emit(*context.position(), UnexpectedTokenInMatchCasesBlock, context.PositionKind()); @@ -81,7 +81,7 @@ auto HandleMatchConditionFinish(Context& context) -> void { if (!context.PositionIs(Lex::TokenKind::OpenCurlyBrace)) { if (!state.has_error) { CARBON_DIAGNOSTIC(ExpectedMatchCasesBlock, Error, - "Expected `{{` starting block with cases."); + "expected `{{` starting block with cases"); context.emitter().Emit(*context.position(), ExpectedMatchCasesBlock); } @@ -98,7 +98,7 @@ auto HandleMatchConditionFinish(Context& context) -> void { state.has_error = false; if (context.PositionIs(Lex::TokenKind::CloseCurlyBrace)) { - CARBON_DIAGNOSTIC(ExpectedMatchCases, Error, "Expected cases."); + CARBON_DIAGNOSTIC(ExpectedMatchCases, Error, "expected cases"); context.emitter().Emit(*context.position(), ExpectedMatchCases); state.has_error = true; } @@ -127,10 +127,10 @@ auto HandleMatchCaseLoopAfterDefault(Context& context) -> void { Lex::TokenKind kind = context.PositionKind(); if (kind == Lex::TokenKind::Case or kind == Lex::TokenKind::Default) { - CARBON_DIAGNOSTIC(UnreachableMatchCase, Error, "Unreachable case; `{0}{1}", - Lex::TokenKind, std::string); - context.emitter().Emit(*context.position(), UnreachableMatchCase, kind, - "` occurs after the `default`"); + CARBON_DIAGNOSTIC(UnreachableMatchCase, Error, + "unreachable case; `{0}` occurs after the `default`", + Lex::TokenKind); + context.emitter().Emit(*context.position(), UnreachableMatchCase, kind); context.ReturnErrorOnState(); context.PushState(State::MatchCaseLoopAfterDefault); diff --git a/toolchain/parse/handle_paren_expr.cpp b/toolchain/parse/handle_paren_expr.cpp index 888027c5bcb2e..ee698a7131e78 100644 --- a/toolchain/parse/handle_paren_expr.cpp +++ b/toolchain/parse/handle_paren_expr.cpp @@ -30,7 +30,7 @@ auto HandleOnlyParenExprFinish(Context& context) -> void { if (!context.PositionIs(Lex::TokenKind::CloseParen)) { if (!state.has_error) { CARBON_DIAGNOSTIC(UnexpectedTokenInCompoundMemberAccess, Error, - "Expected `)`."); + "expected `)`"); context.emitter().Emit(*context.position(), UnexpectedTokenInCompoundMemberAccess); state.has_error = true; diff --git a/toolchain/parse/handle_period.cpp b/toolchain/parse/handle_period.cpp index d620c9437a08a..1e4d7500ceea4 100644 --- a/toolchain/parse/handle_period.cpp +++ b/toolchain/parse/handle_period.cpp @@ -36,7 +36,7 @@ static auto HandlePeriodOrArrow(Context& context, NodeKind node_kind, return; } else { CARBON_DIAGNOSTIC(ExpectedIdentifierAfterPeriodOrArrow, Error, - "Expected identifier after `{0}`.", llvm::StringLiteral); + "expected identifier after `{0}`", llvm::StringLiteral); context.emitter().Emit( *context.position(), ExpectedIdentifierAfterPeriodOrArrow, is_arrow ? llvm::StringLiteral("->") : llvm::StringLiteral(".")); diff --git a/toolchain/parse/handle_requirement.cpp b/toolchain/parse/handle_requirement.cpp index 394bba49a0b95..e5345ff573394 100644 --- a/toolchain/parse/handle_requirement.cpp +++ b/toolchain/parse/handle_requirement.cpp @@ -43,7 +43,7 @@ auto HandleRequirementOperator(Context& context) -> void { if (!state.has_error) { CARBON_DIAGNOSTIC( RequirementEqualAfterNonDesignator, Error, - "Requirement can only use `=` after `.member` designator."); + "requirement can only use `=` after `.member` designator"); context.emitter().Emit(*context.position(), RequirementEqualAfterNonDesignator); } @@ -54,7 +54,7 @@ auto HandleRequirementOperator(Context& context) -> void { if (!state.has_error) { CARBON_DIAGNOSTIC( ExpectedRequirementOperator, Error, - "Requirement should use `impls`, `=`, or `==` operator."); + "requirement should use `impls`, `=`, or `==` operator"); context.emitter().Emit(*context.position(), ExpectedRequirementOperator); } diff --git a/toolchain/parse/handle_statement.cpp b/toolchain/parse/handle_statement.cpp index 4cfeb7822a07f..4243d3e5a10fc 100644 --- a/toolchain/parse/handle_statement.cpp +++ b/toolchain/parse/handle_statement.cpp @@ -78,7 +78,7 @@ static auto HandleStatementKeywordFinish(Context& context, NodeKind node_kind) auto semi = context.ConsumeIf(Lex::TokenKind::Semi); if (!semi) { CARBON_DIAGNOSTIC(ExpectedStatementSemi, Error, - "`{0}` statements must end with a `;`.", Lex::TokenKind); + "`{0}` statements must end with a `;`", Lex::TokenKind); context.emitter().Emit(*context.position(), ExpectedStatementSemi, context.tokens().GetKind(state.token)); state.has_error = true; @@ -112,7 +112,7 @@ auto HandleStatementForHeader(Context& context) -> void { context.AddLeafNode(NodeKind::VariableIntroducer, context.Consume()); } else { CARBON_DIAGNOSTIC(ExpectedVariableDecl, Error, - "Expected `var` declaration."); + "expected `var` declaration"); context.emitter().Emit(*context.position(), ExpectedVariableDecl); if (auto next_in = context.FindNextOf({Lex::TokenKind::In})) { diff --git a/toolchain/parse/handle_var.cpp b/toolchain/parse/handle_var.cpp index 8b4c0e6ca175b..fd2a5be9806e0 100644 --- a/toolchain/parse/handle_var.cpp +++ b/toolchain/parse/handle_var.cpp @@ -34,7 +34,7 @@ auto HandleVarAsReturned(Context& context) -> void { if (!context.PositionIs(Lex::TokenKind::Var)) { CARBON_DIAGNOSTIC(ExpectedVarAfterReturned, Error, - "Expected `var` after `returned`."); + "expected `var` after `returned`"); context.emitter().Emit(*context.position(), ExpectedVarAfterReturned); context.AddLeafNode(NodeKind::EmptyDecl, context.SkipPastLikelyEnd(returned_token), @@ -96,13 +96,13 @@ auto HandleVarFinishAsFor(Context& context) -> void { end_token = context.Consume(); } else if (context.PositionIs(Lex::TokenKind::Colon)) { CARBON_DIAGNOSTIC(ExpectedInNotColon, Error, - "`:` should be replaced by `in`."); + "`:` should be replaced by `in`"); context.emitter().Emit(*context.position(), ExpectedInNotColon); state.has_error = true; end_token = context.Consume(); } else { CARBON_DIAGNOSTIC(ExpectedIn, Error, - "Expected `in` after loop `var` declaration."); + "expected `in` after loop `var` declaration"); context.emitter().Emit(*context.position(), ExpectedIn); state.has_error = true; } diff --git a/toolchain/parse/testdata/alias/fail_syntax.carbon b/toolchain/parse/testdata/alias/fail_syntax.carbon index 9779d034d64a1..9273fd07f0633 100644 --- a/toolchain/parse/testdata/alias/fail_syntax.carbon +++ b/toolchain/parse/testdata/alias/fail_syntax.carbon @@ -8,63 +8,63 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/alias/fail_syntax.carbon -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: ERROR: `alias` introducer should be followed by a name. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: error: `alias` introducer should be followed by a name // CHECK:STDERR: alias = b; // CHECK:STDERR: ^ // CHECK:STDERR: alias = b; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: ERROR: `alias` requires a `=` for the source. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: error: `alias` requires a `=` for the source // CHECK:STDERR: alias a b; // CHECK:STDERR: ^ // CHECK:STDERR: alias a b; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:10: ERROR: Expected expression. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:10: error: expected expression // CHECK:STDERR: alias a =; // CHECK:STDERR: ^ // CHECK:STDERR: alias a =; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: ERROR: `alias` requires a `=` for the source. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: error: `alias` requires a `=` for the source // CHECK:STDERR: alias a; // CHECK:STDERR: ^ // CHECK:STDERR: alias a; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: ERROR: `alias` introducer should be followed by a name. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: error: `alias` introducer should be followed by a name // CHECK:STDERR: alias =; // CHECK:STDERR: ^ // CHECK:STDERR: alias =; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: ERROR: `alias` requires a `=` for the source. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: error: `alias` requires a `=` for the source // CHECK:STDERR: alias a b c = d; // CHECK:STDERR: ^ // CHECK:STDERR: alias a b c = d; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:13: ERROR: `alias` declarations must end with a `;`. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:13: error: `alias` declarations must end with a `;` // CHECK:STDERR: alias a = b c d; // CHECK:STDERR: ^ // CHECK:STDERR: alias a = b c d; fn F() { - // CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: ERROR: `alias` introducer should be followed by a name. + // CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: error: `alias` introducer should be followed by a name // CHECK:STDERR: alias; // CHECK:STDERR: ^ // CHECK:STDERR: alias; - // CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:12: ERROR: Expected expression. + // CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:12: error: expected expression // CHECK:STDERR: alias a =; // CHECK:STDERR: ^ // CHECK:STDERR: alias a =; alias a = -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:1: ERROR: Expected expression. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:1: error: expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -72,7 +72,7 @@ fn F() { alias a = b -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+56]]:21: ERROR: `alias` declarations must end with a `;`. +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+56]]:21: error: `alias` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_syntax.carbon diff --git a/toolchain/parse/testdata/array/fail_require_close_bracket.carbon b/toolchain/parse/testdata/array/fail_require_close_bracket.carbon index 16af719a5a1e3..d98b8aa6b031b 100644 --- a/toolchain/parse/testdata/array/fail_require_close_bracket.carbon +++ b/toolchain/parse/testdata/array/fail_require_close_bracket.carbon @@ -9,11 +9,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/array/fail_require_close_bracket.carbon // TODO: It should emit only one error message. -// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+7]]:8: ERROR: Opening symbol without a corresponding closing symbol. +// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+7]]:8: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:8: ERROR: Expected expression. +// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:8: error: expected expression // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ var x: [i32;; diff --git a/toolchain/parse/testdata/array/fail_require_semi.carbon b/toolchain/parse/testdata/array/fail_require_semi.carbon index 0754ff04843e9..dfcfa306e9cea 100644 --- a/toolchain/parse/testdata/array/fail_require_semi.carbon +++ b/toolchain/parse/testdata/array/fail_require_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/array/fail_require_semi.carbon -// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: ERROR: Expected `;` in array type. +// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: error: expected `;` in array type // CHECK:STDERR: var x: [i32]; // CHECK:STDERR: ^ var x: [i32]; diff --git a/toolchain/parse/testdata/array/fail_syntax.carbon b/toolchain/parse/testdata/array/fail_syntax.carbon index 4df2f5a5fe544..456a9d09ea093 100644 --- a/toolchain/parse/testdata/array/fail_syntax.carbon +++ b/toolchain/parse/testdata/array/fail_syntax.carbon @@ -10,7 +10,7 @@ // --- fail_type.carbon -// CHECK:STDERR: fail_type.carbon:[[@LINE+4]]:12: ERROR: Expected `;` in array type. +// CHECK:STDERR: fail_type.carbon:[[@LINE+4]]:12: error: expected `;` in array type // CHECK:STDERR: var x: [i32]; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -18,19 +18,19 @@ var x: [i32]; // --- fail_invalid_char.carbon -// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+16]]:12: ERROR: Expected expression. +// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+16]]:12: error: expected expression // CHECK:STDERR: fn X() -> [:]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+12]]:12: ERROR: Expected `;` in array type. +// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+12]]:12: error: expected `;` in array type // CHECK:STDERR: fn X() -> [:]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+8]]:12: ERROR: Expected expression. +// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+8]]:12: error: expected expression // CHECK:STDERR: fn X() -> [:]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+4]]:12: ERROR: Unexpected tokens before `]`. +// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+4]]:12: error: unexpected tokens before `]` // CHECK:STDERR: fn X() -> [:]; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -38,23 +38,23 @@ fn X() -> [:]; // --- fail_unlexed_expr.carbon -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+20]]:9: ERROR: Encountered unrecognized characters while parsing. +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+20]]:9: error: encountered unrecognized characters while parsing // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+16]]:9: ERROR: Expected expression. +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+16]]:9: error: expected expression // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+12]]:9: ERROR: Expected `;` in array type. +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+12]]:9: error: expected `;` in array type // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+8]]:9: ERROR: Expected expression. +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+8]]:9: error: expected expression // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+4]]:9: ERROR: Unexpected tokens before `]`. +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+4]]:9: error: unexpected tokens before `]` // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -62,11 +62,11 @@ var y: [`]; // --- fail_no_close_bracket.carbon -// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+8]]:8: ERROR: Opening symbol without a corresponding closing symbol. +// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+8]]:8: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+4]]:8: ERROR: Expected expression. +// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+4]]:8: error: expected expression // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -74,7 +74,7 @@ var x: [i32;; // --- fail_no_semi.carbon -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:12: ERROR: Expected `;` in array type. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:12: error: expected `;` in array type // CHECK:STDERR: var x: [i32]; // CHECK:STDERR: ^ var x: [i32]; diff --git a/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon b/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon index 77596e0c9987e..1a01898f5202a 100644 --- a/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon +++ b/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon @@ -10,20 +10,20 @@ // This is a valid parse tree even though the lex errors. fn F() { - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:11: ERROR: Opening symbol without a corresponding closing symbol. + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:11: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: ([i32; 3) = (0, 1, 2); // CHECK:STDERR: ^ // CHECK:STDERR: var x: ([i32; 3) = (0, 1, 2); - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: ERROR: Opening symbol without a corresponding closing symbol. + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: ERROR: Opening symbol without a corresponding closing symbol. + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: ERROR: Opening symbol without a corresponding closing symbol. + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ var x: {.y: (} = {.y = ((}; diff --git a/toolchain/parse/testdata/basics/fail_invalid_designators.carbon b/toolchain/parse/testdata/basics/fail_invalid_designators.carbon index 56e0e358d0917..dbfda443dd489 100644 --- a/toolchain/parse/testdata/basics/fail_invalid_designators.carbon +++ b/toolchain/parse/testdata/basics/fail_invalid_designators.carbon @@ -10,12 +10,12 @@ // NOTE: Move to its own directory when more tests are added. fn F() { - // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`. + // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: error: expected identifier after `.` // CHECK:STDERR: a.; // CHECK:STDERR: ^ // CHECK:STDERR: a.; - // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: ERROR: Expected identifier after `.`. + // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: error: expected identifier after `.` // CHECK:STDERR: a.fn; // CHECK:STDERR: ^~ a.fn; diff --git a/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon b/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon index b402e2dd4ab18..9f56e4cc74b33 100644 --- a/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon -// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: ERROR: Unrecognized declaration introducer. +// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: error: unrecognized declaration introducer // CHECK:STDERR: protected virtual; // CHECK:STDERR: ^ protected virtual; diff --git a/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon b/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon index 06fddaa882fe7..3c08b2ab8aeed 100644 --- a/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon -// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer. +// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer // CHECK:STDERR: foo; // CHECK:STDERR: ^~~ foo; diff --git a/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon b/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon index 0a2262f5cb376..2e0d99da30192 100644 --- a/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon -// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer. +// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer // CHECK:STDERR: foo bar baz // CHECK:STDERR: ^~~ foo bar baz diff --git a/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon b/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon index f7d687cdd407c..325fae833bf3c 100644 --- a/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon +++ b/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon @@ -8,17 +8,17 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_paren_match_regression.carbon -// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+8]]:5: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+8]]:5: error: expected name in binding pattern // CHECK:STDERR: var = (foo {}) // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+4]]:12: ERROR: Expected `,` or `)`. +// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+4]]:12: error: expected `,` or `)` // CHECK:STDERR: var = (foo {}) // CHECK:STDERR: ^ // CHECK:STDERR: var = (foo {}) -// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: ERROR: `var` declarations must end with a `;`. +// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: error: `var` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_paren_match_regression.carbon diff --git a/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon b/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon index 70f88f3ccaf51..fe00fbcceb11f 100644 --- a/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon +++ b/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon choice X { - // CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+3]]:4: ERROR: Expected `,` or `}`. + // CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+3]]:4: error: expected `,` or `}` // CHECK:STDERR: A[T:! type](value: T) // CHECK:STDERR: ^ A[T:! type](value: T) diff --git a/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon b/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon index dca47d89b3e59..5371354d22502 100644 --- a/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon +++ b/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon choice InvalidAlternativeIdentifier { - // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+4]]:5: ERROR: Expected choice alternative name. + // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+4]]:5: error: expected choice alternative name // CHECK:STDERR: ,Some, // CHECK:STDERR: ^ // CHECK:STDERR: ,Some, - // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+3]]:5: ERROR: Expected choice alternative name. + // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+3]]:5: error: expected choice alternative name // CHECK:STDERR: 42, // CHECK:STDERR: ^~ 42, diff --git a/toolchain/parse/testdata/choice/fail_invalid_braces.carbon b/toolchain/parse/testdata/choice/fail_invalid_braces.carbon index 1bfb0ffb6f0cc..2d51cd8c1ba38 100644 --- a/toolchain/parse/testdata/choice/fail_invalid_braces.carbon +++ b/toolchain/parse/testdata/choice/fail_invalid_braces.carbon @@ -8,13 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_invalid_braces.carbon -// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+4]]:22: ERROR: Choice definition expected. +// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+4]]:22: error: choice definition expected // CHECK:STDERR: choice InvalidBraces | // CHECK:STDERR: ^ // CHECK:STDERR: choice InvalidBraces | Some -// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer. +// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer // CHECK:STDERR: | // CHECK:STDERR: ^ | diff --git a/toolchain/parse/testdata/choice/fail_missing_definition.carbon b/toolchain/parse/testdata/choice/fail_missing_definition.carbon index b570bd299c010..cd440caca33d5 100644 --- a/toolchain/parse/testdata/choice/fail_missing_definition.carbon +++ b/toolchain/parse/testdata/choice/fail_missing_definition.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_missing_definition.carbon -// CHECK:STDERR: fail_missing_definition.carbon:[[@LINE+3]]:25: ERROR: Choice definition expected. +// CHECK:STDERR: fail_missing_definition.carbon:[[@LINE+3]]:25: error: choice definition expected // CHECK:STDERR: choice MissingDefinition; // CHECK:STDERR: ^ choice MissingDefinition; diff --git a/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon b/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon index b0f1bd8d343ce..05101b6797320 100644 --- a/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon +++ b/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon -// CHECK:STDERR: fail_missing_definition_parameterized.carbon:[[@LINE+3]]:35: ERROR: Choice definition expected. +// CHECK:STDERR: fail_missing_definition_parameterized.carbon:[[@LINE+3]]:35: error: choice definition expected // CHECK:STDERR: choice MissingDefinition(T:! type); // CHECK:STDERR: ^ choice MissingDefinition(T:! type); diff --git a/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon b/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon index 634c71d8a7f75..b266e787a85af 100644 --- a/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon +++ b/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon choice X { - // CHECK:STDERR: fail_qualified_alternative_name.carbon:[[@LINE+3]]:4: ERROR: Expected `,` or `}`. + // CHECK:STDERR: fail_qualified_alternative_name.carbon:[[@LINE+3]]:4: error: expected `,` or `}` // CHECK:STDERR: A.B // CHECK:STDERR: ^ A.B diff --git a/toolchain/parse/testdata/class/adapt.carbon b/toolchain/parse/testdata/class/adapt.carbon index 0d79cf70454d4..89714bc89d750 100644 --- a/toolchain/parse/testdata/class/adapt.carbon +++ b/toolchain/parse/testdata/class/adapt.carbon @@ -36,7 +36,7 @@ adapt i32; // --- fail_bad_syntax.carbon class A { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:11: ERROR: `adapt` declarations must end with a `;`. + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:11: error: `adapt` declarations must end with a `;` // CHECK:STDERR: adapt 1 trailing_token; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -44,7 +44,7 @@ class A { } class B { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:8: ERROR: Expected expression. + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:8: error: expected expression // CHECK:STDERR: adapt; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -53,14 +53,14 @@ class B { class C { adapt -// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:1: ERROR: Expected expression. +// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:1: error: expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: } class D { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:9: ERROR: Expected expression. + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:9: error: expected expression // CHECK:STDERR: adapt class; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ class D { } fn F() { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+3]]:3: ERROR: Expected expression. + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+3]]:3: error: expected expression // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~ adapt i32; diff --git a/toolchain/parse/testdata/class/fail_base.carbon b/toolchain/parse/testdata/class/fail_base.carbon index 1268b1fd931ed..9cf46f049a48a 100644 --- a/toolchain/parse/testdata/class/fail_base.carbon +++ b/toolchain/parse/testdata/class/fail_base.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/class/fail_base.carbon class A { - // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:7: ERROR: `class` or `:` expected after `base`. + // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:7: error: `class` or `:` expected after `base` // CHECK:STDERR: base; // CHECK:STDERR: ^ // CHECK:STDERR: base; - // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:9: ERROR: Expected expression. + // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:9: error: expected expression // CHECK:STDERR: base: ; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -23,11 +23,11 @@ class A { base: { } // We should resume parsing here after the previous error. - // CHECK:STDERR: fail_base.carbon:[[@LINE+7]]:3: ERROR: `base` declarations must end with a `;`. + // CHECK:STDERR: fail_base.carbon:[[@LINE+7]]:3: error: `base` declarations must end with a `;` // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base.carbon:[[@LINE+3]]:7: ERROR: Unrecognized declaration introducer. + // CHECK:STDERR: fail_base.carbon:[[@LINE+3]]:7: error: unrecognized declaration introducer // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^ var n: i32; diff --git a/toolchain/parse/testdata/class/fail_base_misplaced.carbon b/toolchain/parse/testdata/class/fail_base_misplaced.carbon index 551fc27976b20..97e238904c53a 100644 --- a/toolchain/parse/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/parse/testdata/class/fail_base_misplaced.carbon @@ -11,7 +11,7 @@ base class B {} fn F() { - // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: ERROR: Expected expression. + // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error: expected expression // CHECK:STDERR: base: B; // CHECK:STDERR: ^~~~ base: B; diff --git a/toolchain/parse/testdata/class/fail_modifiers.carbon b/toolchain/parse/testdata/class/fail_modifiers.carbon index 863932b9a8d0a..3a10dc6b3e2d6 100644 --- a/toolchain/parse/testdata/class/fail_modifiers.carbon +++ b/toolchain/parse/testdata/class/fail_modifiers.carbon @@ -11,14 +11,14 @@ // --- fail_virtual_class.carbon virtual class B -// CHECK:STDERR: fail_virtual_class.carbon:[[@LINE+4]]:1: ERROR: `virtual` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_virtual_class.carbon:[[@LINE+4]]:1: error: `virtual` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: // CHECK:STDERR: ^ // CHECK:STDERR: // --- fail_impl_class.carbon -// CHECK:STDERR: fail_impl_class.carbon:[[@LINE+4]]:1: ERROR: `impl` introducer should be followed by a name. +// CHECK:STDERR: fail_impl_class.carbon:[[@LINE+4]]:1: error: `impl` introducer should be followed by a name // CHECK:STDERR: impl class // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -27,7 +27,7 @@ impl class // --- fail_extend_adapt_base.carbon class C { - // CHECK:STDERR: fail_extend_adapt_base.carbon:[[@LINE+3]]:16: ERROR: Expected expression. + // CHECK:STDERR: fail_extend_adapt_base.carbon:[[@LINE+3]]:16: error: expected expression // CHECK:STDERR: extend adapt base B; // CHECK:STDERR: ^~~~ extend adapt base B; diff --git a/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon b/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon index a887d09fe9fe6..3ea688082e470 100644 --- a/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon +++ b/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon fn foo() { - // CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: ERROR: `:` should be replaced by `in`. + // CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: error: `:` should be replaced by `in` // CHECK:STDERR: for (var x: i32 : y) { // CHECK:STDERR: ^ for (var x: i32 : y) { diff --git a/toolchain/parse/testdata/for/fail_missing_cond.carbon b/toolchain/parse/testdata/for/fail_missing_cond.carbon index ed416009d04b0..590a7eeb105ac 100644 --- a/toolchain/parse/testdata/for/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/for/fail_missing_cond.carbon @@ -9,21 +9,21 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_cond.carbon fn F() { - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+8]]:7: ERROR: Expected `(` after `for`. + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+8]]:7: error: expected `(` after `for` // CHECK:STDERR: for { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:7: ERROR: Expected `var` declaration. + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:7: error: expected `var` declaration // CHECK:STDERR: for { // CHECK:STDERR: ^ // CHECK:STDERR: for { } -// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+7]]:1: ERROR: Expected braced code block. +// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+7]]:1: error: expected braced code block // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: ERROR: Expected expression. +// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: error: expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/for/fail_missing_in.carbon b/toolchain/parse/testdata/for/fail_missing_in.carbon index 90d074b24d4e9..7865876d1242d 100644 --- a/toolchain/parse/testdata/for/fail_missing_in.carbon +++ b/toolchain/parse/testdata/for/fail_missing_in.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_in.carbon fn foo() { - // CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: ERROR: Expected `in` after loop `var` declaration. + // CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: error: expected `in` after loop `var` declaration // CHECK:STDERR: for (var x: i32 y) { // CHECK:STDERR: ^ for (var x: i32 y) { diff --git a/toolchain/parse/testdata/for/fail_missing_var.carbon b/toolchain/parse/testdata/for/fail_missing_var.carbon index 5a0b89add7e68..69379f2c81679 100644 --- a/toolchain/parse/testdata/for/fail_missing_var.carbon +++ b/toolchain/parse/testdata/for/fail_missing_var.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_var.carbon fn foo() { - // CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: ERROR: Expected `var` declaration. + // CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: error: expected `var` declaration // CHECK:STDERR: for (x: i32 in y) { // CHECK:STDERR: ^ for (x: i32 in y) { diff --git a/toolchain/parse/testdata/for/fail_returned_var.carbon b/toolchain/parse/testdata/for/fail_returned_var.carbon index ab24884804eca..143f19178f710 100644 --- a/toolchain/parse/testdata/for/fail_returned_var.carbon +++ b/toolchain/parse/testdata/for/fail_returned_var.carbon @@ -10,7 +10,7 @@ fn foo() -> i32 { // TODO: Should we allow this? - // CHECK:STDERR: fail_returned_var.carbon:[[@LINE+3]]:8: ERROR: Expected `var` declaration. + // CHECK:STDERR: fail_returned_var.carbon:[[@LINE+3]]:8: error: expected `var` declaration // CHECK:STDERR: for (returned var x: i32 in y) { // CHECK:STDERR: ^~~~~~~~ for (returned var x: i32 in y) { diff --git a/toolchain/parse/testdata/for/fail_square_brackets.carbon b/toolchain/parse/testdata/for/fail_square_brackets.carbon index f9f21e6bb628c..30f89312e829c 100644 --- a/toolchain/parse/testdata/for/fail_square_brackets.carbon +++ b/toolchain/parse/testdata/for/fail_square_brackets.carbon @@ -9,19 +9,19 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_square_brackets.carbon fn F() { - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+15]]:7: ERROR: Expected `(` after `for`. + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+15]]:7: error: expected `(` after `for` // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:7: ERROR: Expected `var` declaration. + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:7: error: expected `var` declaration // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:8: ERROR: Expected expression. + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:8: error: expected expression // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: ERROR: Expected `;` in array type. + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: error: expected `;` in array type // CHECK:STDERR: for [] { // CHECK:STDERR: ^ for [] { diff --git a/toolchain/parse/testdata/function/declaration/extern.carbon b/toolchain/parse/testdata/function/declaration/extern.carbon index 4e9ebcab0966d..a2ca9892a22d4 100644 --- a/toolchain/parse/testdata/function/declaration/extern.carbon +++ b/toolchain/parse/testdata/function/declaration/extern.carbon @@ -22,7 +22,7 @@ extern library default fn G(); // --- fail_name_missing.carbon -// CHECK:STDERR: fail_name_missing.carbon:[[@LINE+4]]:16: ERROR: Expected `default` or a string literal to specify the library name. +// CHECK:STDERR: fail_name_missing.carbon:[[@LINE+4]]:16: error: expected `default` or a string literal to specify the library name // CHECK:STDERR: extern library fn G(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -30,11 +30,11 @@ extern library fn G(); // --- fail_identifier.carbon -// CHECK:STDERR: fail_identifier.carbon:[[@LINE+7]]:16: ERROR: Expected `default` or a string literal to specify the library name. +// CHECK:STDERR: fail_identifier.carbon:[[@LINE+7]]:16: error: expected `default` or a string literal to specify the library name // CHECK:STDERR: extern library foo fn G(); // CHECK:STDERR: ^~~ // CHECK:STDERR: -// CHECK:STDERR: fail_identifier.carbon:[[@LINE+3]]:16: ERROR: Unrecognized declaration introducer. +// CHECK:STDERR: fail_identifier.carbon:[[@LINE+3]]:16: error: unrecognized declaration introducer // CHECK:STDERR: extern library foo fn G(); // CHECK:STDERR: ^~~ extern library foo fn G(); diff --git a/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon b/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon index f06c59fd52f4d..b8f7f922f3ef7 100644 --- a/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon -// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: ERROR: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: fn foo bar; // CHECK:STDERR: ^~~ fn foo bar; diff --git a/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon b/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon index aa08ed2c1d362..441965b45ae3d 100644 --- a/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon @@ -9,11 +9,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon // Fix and uncomment this to test error handling. -// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+7]]:7: ERROR: Opening symbol without a corresponding closing symbol. +// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+7]]:7: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: fn Div[(); // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+3]]:7: ERROR: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+3]]:7: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: fn Div[(); // CHECK:STDERR: ^ fn Div[(); diff --git a/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon b/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon index b9407b7c2c9e6..c5eba8612b7ae 100644 --- a/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_name.carbon -// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name. +// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn (); // CHECK:STDERR: ^ fn (); diff --git a/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon index ebb055d8fd90a..a1c56e3eebf97 100644 --- a/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon @@ -10,7 +10,7 @@ fn foo -// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+10]]:21: ERROR: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+10]]:21: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_sig_or_semi.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon index d7662234261c2..1e7edd33a4183 100644 --- a/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon -// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: ERROR: `fn` introducer should be followed by a name. +// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn; // CHECK:STDERR: ^ fn; diff --git a/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon index ce1e8859963a6..f316cd2e92199 100644 --- a/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon -// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name. +// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn fn; // CHECK:STDERR: ^~ fn fn; diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon index 070bb007957c6..8ecdaad6123c7 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon - // CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: ERROR: `fn` introducer should be followed by a name. + // CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ fn (x, diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon index 451a198cb448f..8c1bc943ba0ff 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon -// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name. +// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ fn (x, diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon index 2602e8fc87d10..67f9fda454d93 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon -// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name. +// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ fn (x, diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon index 11d69d7cdd825..6b0afe63f12fe 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon -// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name. +// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn () // CHECK:STDERR: ^ fn () diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon index dad928424e01f..9b37c23bcd34a 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon -// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer. +// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer // CHECK:STDERR: struct X { fn () } // CHECK:STDERR: ^~~~~~ struct X { fn () } diff --git a/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon b/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon index 4271e80a04c94..b06a1a56ec9cb 100644 --- a/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon -// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: ERROR: Expected `:` or `:!` in binding pattern. +// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: error: expected `:` or `:!` in binding pattern // CHECK:STDERR: fn foo(bar); // CHECK:STDERR: ^ fn foo(bar); diff --git a/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon b/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon index e82c80fe21d9e..8329e737e43b0 100644 --- a/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon -// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name. +// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z); // CHECK:STDERR: ^ fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z); diff --git a/toolchain/parse/testdata/function/definition/fail_builtin.carbon b/toolchain/parse/testdata/function/definition/fail_builtin.carbon index a4e7fa5223b2d..8e26d047628bd 100644 --- a/toolchain/parse/testdata/function/definition/fail_builtin.carbon +++ b/toolchain/parse/testdata/function/definition/fail_builtin.carbon @@ -8,18 +8,18 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/definition/fail_builtin.carbon -// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:18: ERROR: Expected builtin function name after `=`. +// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:18: error: expected builtin function name after `=` // CHECK:STDERR: fn NotString() = banana; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fn NotString() = banana; -// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:32: ERROR: `fn` declarations must end with a `;`. +// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:32: error: `fn` declarations must end with a `;` // CHECK:STDERR: fn JunkAfterString() = "hello" "world"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn JunkAfterString() = "hello" "world"; -// CHECK:STDERR: fail_builtin.carbon:[[@LINE+3]]:23: ERROR: Expected builtin function name after `=`. +// CHECK:STDERR: fail_builtin.carbon:[[@LINE+3]]:23: error: expected builtin function name after `=` // CHECK:STDERR: fn SpuriousEquals() = { } // CHECK:STDERR: ^ fn SpuriousEquals() = { } diff --git a/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon b/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon index cdd7b3de02b2e..2f19aa29ea801 100644 --- a/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon +++ b/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon @@ -12,7 +12,7 @@ fn F() { // Note: this might become valid depending on the expression syntax. This test // shouldn't be taken as a sign it should remain invalid. bar -// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: ERROR: Expected `;` after expression statement. +// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: error: expected `;` after expression statement // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon b/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon index de5ebd4fb097f..68d17e4f4f34d 100644 --- a/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon @@ -8,25 +8,25 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:12: ERROR: A `(` for parameters is required after implicit parameters. +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:12: error: a `(` for parameters is required after implicit parameters // CHECK:STDERR: class Foo[]; // CHECK:STDERR: ^ // CHECK:STDERR: class Foo[]; -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:18: ERROR: A `(` for parameters is required after implicit parameters. +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:18: error: a `(` for parameters is required after implicit parameters // CHECK:STDERR: class Foo[a: i32]; // CHECK:STDERR: ^ // CHECK:STDERR: class Foo[a: i32]; -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:17: ERROR: A `(` for parameters is required after implicit parameters. +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:17: error: a `(` for parameters is required after implicit parameters // CHECK:STDERR: interface Bar[] {} // CHECK:STDERR: ^ // CHECK:STDERR: interface Bar[] {} -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+3]]:23: ERROR: A `(` for parameters is required after implicit parameters. +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+3]]:23: error: a `(` for parameters is required after implicit parameters // CHECK:STDERR: interface Bar[a: i32] {} // CHECK:STDERR: ^ interface Bar[a: i32] {} diff --git a/toolchain/parse/testdata/generics/impl/fail_impl.carbon b/toolchain/parse/testdata/generics/impl/fail_impl.carbon index a78cab279fa7b..cd59f5a709643 100644 --- a/toolchain/parse/testdata/generics/impl/fail_impl.carbon +++ b/toolchain/parse/testdata/generics/impl/fail_impl.carbon @@ -8,87 +8,87 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/impl/fail_impl.carbon -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:10: ERROR: Expected `as` in `impl` declaration. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:10: error: expected `as` in `impl` declaration // CHECK:STDERR: impl foo bar; // CHECK:STDERR: ^~~ // CHECK:STDERR: impl foo bar; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:12: ERROR: Expected expression. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:12: error: expected expression // CHECK:STDERR: impl i32 as; // CHECK:STDERR: ^ // CHECK:STDERR: impl i32 as; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:18: ERROR: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:18: error: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: impl bool as bar unexpected; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: impl bool as bar unexpected; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: ERROR: Expected expression. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: error: expected expression // CHECK:STDERR: impl return as A; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: impl return as A; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: ERROR: Expected expression. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: error: expected expression // CHECK:STDERR: impl return B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: impl return B; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:13: ERROR: Expected `[` after `forall` in `impl` declaration. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:13: error: expected `[` after `forall` in `impl` declaration // CHECK:STDERR: impl forall f32; // CHECK:STDERR: ^~~ // CHECK:STDERR: -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:16: ERROR: Expected `as` in `impl` declaration. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:16: error: expected `as` in `impl` declaration // CHECK:STDERR: impl forall f32; // CHECK:STDERR: ^ // CHECK:STDERR: impl forall f32; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:19: ERROR: Expected `as` in `impl` declaration. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:19: error: expected `as` in `impl` declaration // CHECK:STDERR: impl forall [] u32; // CHECK:STDERR: ^ // CHECK:STDERR: impl forall [] u32; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:21: ERROR: Expected `:` or `:!` in binding pattern. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:21: error: expected `:` or `:!` in binding pattern // CHECK:STDERR: impl forall [invalid] i8; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:25: ERROR: Expected `as` in `impl` declaration. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:25: error: expected `as` in `impl` declaration // CHECK:STDERR: impl forall [invalid] i8; // CHECK:STDERR: ^ // CHECK:STDERR: impl forall [invalid] i8; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:13: ERROR: Expected `[` after `forall` in `impl` declaration. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:13: error: expected `[` after `forall` in `impl` declaration // CHECK:STDERR: impl forall f16 as Quux; // CHECK:STDERR: ^~~ // CHECK:STDERR: impl forall f16 as Quux; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:30: ERROR: Expected `as` in `impl` declaration. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:30: error: expected `as` in `impl` declaration // CHECK:STDERR: impl forall [T:! type] String; // CHECK:STDERR: ^ // CHECK:STDERR: impl forall [T:! type] String; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:26: ERROR: Expected `as` in `impl` declaration. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:26: error: expected `as` in `impl` declaration // CHECK:STDERR: impl forall [T:! type] T missing_as; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: impl forall [T:! type] T missing_as; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:39: ERROR: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:39: error: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: impl forall [T:! type] T as Interface extra; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: impl forall [T:! type] T as Interface extra; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:5: ERROR: Expected expression. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:5: error: expected expression // CHECK:STDERR: impl; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -96,7 +96,7 @@ impl; impl -// CHECK:STDERR: fail_impl.carbon:[[@LINE+88]]:21: ERROR: Expected expression. +// CHECK:STDERR: fail_impl.carbon:[[@LINE+88]]:21: error: expected expression // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_impl.carbon diff --git a/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon b/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon index fa3c41a2da8f3..b99cb079f9d2f 100644 --- a/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon +++ b/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon @@ -18,7 +18,7 @@ impl bool as Interface { fn F(); } -// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+4]]:4: ERROR: `fn` introducer should be followed by a name. +// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name // CHECK:STDERR: fn (bool as Interface).F() {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -30,7 +30,7 @@ class C { } } -// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+3]]:6: ERROR: `.` should be followed by a name. +// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+3]]:6: error: `.` should be followed by a name // CHECK:STDERR: fn C.(Self as Interface).F() {} // CHECK:STDERR: ^ fn C.(Self as Interface).F() {} diff --git a/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon b/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon index 5cbce33a464eb..5c8fb21688226 100644 --- a/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_missing_name.carbon -// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:11: ERROR: `interface` introducer should be followed by a name. +// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:11: error: `interface` introducer should be followed by a name // CHECK:STDERR: interface { // CHECK:STDERR: ^ interface { diff --git a/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon b/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon index 1ca5f4953f505..8263cd392cd60 100644 --- a/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon -// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+4]]:15: ERROR: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+4]]:15: error: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: interface Bar Baz {} // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -16,7 +16,7 @@ interface Bar Baz {} interface Foo -// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+13]]:21: ERROR: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+13]]:21: error: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_missing_open_curly.carbon diff --git a/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon b/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon index c80522c7f12d6..fac843fb1154e 100644 --- a/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon interface Foo { - // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+4]]:13: ERROR: Expected `:` or `:!` in binding pattern. + // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+4]]:13: error: expected `:` or `:!` in binding pattern // CHECK:STDERR: fn Sub[me Self](b: Self) -> Self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: fn Sub[me Self](b: Self) -> Self; - // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+3]]:10: ERROR: Expected name in binding pattern. + // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+3]]:10: error: expected name in binding pattern // CHECK:STDERR: fn Mul[Self](b: Self) -> Self; // CHECK:STDERR: ^~~~ fn Mul[Self](b: Self) -> Self; diff --git a/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon b/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon index 8c47dd29f1763..714302410311b 100644 --- a/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon +++ b/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon @@ -8,13 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:12: ERROR: `constraint` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:12: error: `constraint` introducer should be followed by a name // CHECK:STDERR: constraint "Foo" // CHECK:STDERR: ^~~~~ // CHECK:STDERR: constraint "Foo" -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: ERROR: `constraint` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error: `constraint` introducer should be followed by a name // CHECK:STDERR: constraint // CHECK:STDERR: ^~~~~~~~~~ constraint diff --git a/toolchain/parse/testdata/if/fail_else_unbraced.carbon b/toolchain/parse/testdata/if/fail_else_unbraced.carbon index 3b47f64325546..8ae2b14dcf5ad 100644 --- a/toolchain/parse/testdata/if/fail_else_unbraced.carbon +++ b/toolchain/parse/testdata/if/fail_else_unbraced.carbon @@ -10,24 +10,24 @@ fn F() { if (a) - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:5: ERROR: Expected braced code block. + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:5: error: expected braced code block // CHECK:STDERR: if (b) // CHECK:STDERR: ^~ // CHECK:STDERR: if (b) - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: ERROR: Expected braced code block. + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block // CHECK:STDERR: c; // CHECK:STDERR: ^ // CHECK:STDERR: c; else - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: ERROR: Expected braced code block. + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block // CHECK:STDERR: d; // CHECK:STDERR: ^ // CHECK:STDERR: d; else - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+3]]:5: ERROR: Expected braced code block. + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+3]]:5: error: expected braced code block // CHECK:STDERR: e; // CHECK:STDERR: ^ e; diff --git a/toolchain/parse/testdata/if/fail_errors.carbon b/toolchain/parse/testdata/if/fail_errors.carbon index 77b75eb39cf24..c059b9409efb0 100644 --- a/toolchain/parse/testdata/if/fail_errors.carbon +++ b/toolchain/parse/testdata/if/fail_errors.carbon @@ -9,27 +9,27 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_errors.carbon fn F() { - // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:6: ERROR: Expected `(` after `if`. + // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:6: error: expected `(` after `if` // CHECK:STDERR: if a {} // CHECK:STDERR: ^ // CHECK:STDERR: if a {} - // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:7: ERROR: Expected expression. + // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:7: error: expected expression // CHECK:STDERR: if () {} // CHECK:STDERR: ^ // CHECK:STDERR: if () {} - // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:9: ERROR: Unexpected tokens before `)`. + // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:9: error: unexpected tokens before `)` // CHECK:STDERR: if (b c) {} // CHECK:STDERR: ^ // CHECK:STDERR: if (b c) {} if (d) -// CHECK:STDERR: fail_errors.carbon:[[@LINE+7]]:1: ERROR: Expected braced code block. +// CHECK:STDERR: fail_errors.carbon:[[@LINE+7]]:1: error: expected braced code block // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_errors.carbon:[[@LINE+3]]:1: ERROR: Expected expression. +// CHECK:STDERR: fail_errors.carbon:[[@LINE+3]]:1: error: expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/if/fail_missing_cond.carbon b/toolchain/parse/testdata/if/fail_missing_cond.carbon index af38aa5e7d787..964e29aa13bdc 100644 --- a/toolchain/parse/testdata/if/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/if/fail_missing_cond.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_missing_cond.carbon fn F() { - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:6: ERROR: Expected `(` after `if`. + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:6: error: expected `(` after `if` // CHECK:STDERR: if { // CHECK:STDERR: ^ if { diff --git a/toolchain/parse/testdata/if/fail_square_brackets.carbon b/toolchain/parse/testdata/if/fail_square_brackets.carbon index 018fb92241c4a..b9ee1fb087919 100644 --- a/toolchain/parse/testdata/if/fail_square_brackets.carbon +++ b/toolchain/parse/testdata/if/fail_square_brackets.carbon @@ -9,15 +9,15 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_square_brackets.carbon fn F() { - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:6: ERROR: Expected `(` after `if`. + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:6: error: expected `(` after `if` // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:7: ERROR: Expected expression. + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:7: error: expected expression // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:7: ERROR: Expected `;` in array type. + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:7: error: expected `;` in array type // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ if [] {} diff --git a/toolchain/parse/testdata/if/fail_unbraced.carbon b/toolchain/parse/testdata/if/fail_unbraced.carbon index c715e85d12481..4ce3f345ffa95 100644 --- a/toolchain/parse/testdata/if/fail_unbraced.carbon +++ b/toolchain/parse/testdata/if/fail_unbraced.carbon @@ -11,17 +11,17 @@ fn F() { if (a) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:5: ERROR: Expected braced code block. + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:5: error: expected braced code block // CHECK:STDERR: if (b) // CHECK:STDERR: ^~ // CHECK:STDERR: if (b) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:7: ERROR: Expected braced code block. + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block // CHECK:STDERR: if (c) // CHECK:STDERR: ^~ // CHECK:STDERR: if (c) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:9: ERROR: Expected braced code block. + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:9: error: expected braced code block // CHECK:STDERR: d; // CHECK:STDERR: ^ d; diff --git a/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon b/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon index e7822a0543626..6a5372762d95f 100644 --- a/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_condition_missing.carbon fn F() { - // CHECK:STDERR: fail_condition_missing.carbon:[[@LINE+3]]:18: ERROR: Expected expression. + // CHECK:STDERR: fail_condition_missing.carbon:[[@LINE+3]]:18: error: expected expression // CHECK:STDERR: var n: i32 = if; // CHECK:STDERR: ^ var n: i32 = if; diff --git a/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon b/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon index 493d1e44f052b..7229486e1a7bf 100644 --- a/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon fn F() { - // CHECK:STDERR: fail_else_expr_missing.carbon:[[@LINE+3]]:35: ERROR: Expected expression. + // CHECK:STDERR: fail_else_expr_missing.carbon:[[@LINE+3]]:35: error: expected expression // CHECK:STDERR: var n: i32 = if true then 1 else; // CHECK:STDERR: ^ var n: i32 = if true then 1 else; diff --git a/toolchain/parse/testdata/if_expr/fail_else_missing.carbon b/toolchain/parse/testdata/if_expr/fail_else_missing.carbon index 31a9b7f1c6cac..34d30296aeea9 100644 --- a/toolchain/parse/testdata/if_expr/fail_else_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_else_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_else_missing.carbon fn F() { - // CHECK:STDERR: fail_else_missing.carbon:[[@LINE+3]]:30: ERROR: Expected `else` after `if ... then ...`. + // CHECK:STDERR: fail_else_missing.carbon:[[@LINE+3]]:30: error: expected `else` after `if ... then ...` // CHECK:STDERR: var n: i32 = if true then 1; // CHECK:STDERR: ^ var n: i32 = if true then 1; diff --git a/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon b/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon index 7babebc1080b7..6eeccdc9f35f3 100644 --- a/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon fn F() { - // CHECK:STDERR: fail_then_expr_missing.carbon:[[@LINE+3]]:28: ERROR: Expected expression. + // CHECK:STDERR: fail_then_expr_missing.carbon:[[@LINE+3]]:28: error: expected expression // CHECK:STDERR: var n: i32 = if true then; // CHECK:STDERR: ^ var n: i32 = if true then; diff --git a/toolchain/parse/testdata/if_expr/fail_then_missing.carbon b/toolchain/parse/testdata/if_expr/fail_then_missing.carbon index f076d8c2600c1..fb10a8e3d4765 100644 --- a/toolchain/parse/testdata/if_expr/fail_then_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_then_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_then_missing.carbon fn F() { - // CHECK:STDERR: fail_then_missing.carbon:[[@LINE+3]]:23: ERROR: Expected `then` after `if` condition. + // CHECK:STDERR: fail_then_missing.carbon:[[@LINE+3]]:23: error: expected `then` after `if` condition // CHECK:STDERR: var n: i32 = if true; // CHECK:STDERR: ^ var n: i32 = if true; diff --git a/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon b/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon index c3db5d26f1383..026597de02bbc 100644 --- a/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon +++ b/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon @@ -9,15 +9,15 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_top_level_if.carbon fn F() { - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+11]]:6: ERROR: Expected `(` after `if`. + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+11]]:6: error: expected `(` after `if` // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+7]]:11: ERROR: Expected braced code block. + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+7]]:11: error: expected braced code block // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+3]]:11: ERROR: Expected expression. + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+3]]:11: error: expected expression // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ if true then 1 else 2; diff --git a/toolchain/parse/testdata/index/fail_empty_expr.carbon b/toolchain/parse/testdata/index/fail_empty_expr.carbon index 2567b3720e3b6..2655bba396794 100644 --- a/toolchain/parse/testdata/index/fail_empty_expr.carbon +++ b/toolchain/parse/testdata/index/fail_empty_expr.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/index/fail_empty_expr.carbon -// CHECK:STDERR: fail_empty_expr.carbon:[[@LINE+3]]:16: ERROR: Expected expression. +// CHECK:STDERR: fail_empty_expr.carbon:[[@LINE+3]]:16: error: expected expression // CHECK:STDERR: var v: i32 = t[]; // CHECK:STDERR: ^ var v: i32 = t[]; diff --git a/toolchain/parse/testdata/index/fail_malformed_expr.carbon b/toolchain/parse/testdata/index/fail_malformed_expr.carbon index 034e1638810f4..420e10fff0e5c 100644 --- a/toolchain/parse/testdata/index/fail_malformed_expr.carbon +++ b/toolchain/parse/testdata/index/fail_malformed_expr.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/index/fail_malformed_expr.carbon -// CHECK:STDERR: fail_malformed_expr.carbon:[[@LINE+3]]:17: ERROR: Unexpected tokens before `]`. +// CHECK:STDERR: fail_malformed_expr.carbon:[[@LINE+3]]:17: error: unexpected tokens before `]` // CHECK:STDERR: var v: i32 = t[0,]; // CHECK:STDERR: ^ var v: i32 = t[0,]; diff --git a/toolchain/parse/testdata/let/fail_bad_name.carbon b/toolchain/parse/testdata/let/fail_bad_name.carbon index 77a8f92c64956..832b802bb706e 100644 --- a/toolchain/parse/testdata/let/fail_bad_name.carbon +++ b/toolchain/parse/testdata/let/fail_bad_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_bad_name.carbon -// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error: expected name in binding pattern // CHECK:STDERR: let ? = 4; // CHECK:STDERR: ^ let ? = 4; diff --git a/toolchain/parse/testdata/let/fail_empty.carbon b/toolchain/parse/testdata/let/fail_empty.carbon index d19a83dc5391d..62fd6c334ee0c 100644 --- a/toolchain/parse/testdata/let/fail_empty.carbon +++ b/toolchain/parse/testdata/let/fail_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_empty.carbon -// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error: expected name in binding pattern // CHECK:STDERR: let; // CHECK:STDERR: ^ let; diff --git a/toolchain/parse/testdata/let/fail_missing_name.carbon b/toolchain/parse/testdata/let/fail_missing_name.carbon index c5c232d64daf9..4f5e1ffd65d3c 100644 --- a/toolchain/parse/testdata/let/fail_missing_name.carbon +++ b/toolchain/parse/testdata/let/fail_missing_name.carbon @@ -10,7 +10,7 @@ // --- fail_runtime_binding.carbon -// CHECK:STDERR: fail_runtime_binding.carbon:[[@LINE+4]]:5: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_runtime_binding.carbon:[[@LINE+4]]:5: error: expected name in binding pattern // CHECK:STDERR: let : i32 = 4; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -18,7 +18,7 @@ let : i32 = 4; // --- fail_complietime_binding.carbon -// CHECK:STDERR: fail_complietime_binding.carbon:[[@LINE+3]]:5: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_complietime_binding.carbon:[[@LINE+3]]:5: error: expected name in binding pattern // CHECK:STDERR: let :! bool = true; // CHECK:STDERR: ^~ let :! bool = true; diff --git a/toolchain/parse/testdata/let/fail_missing_type.carbon b/toolchain/parse/testdata/let/fail_missing_type.carbon index 5084a7282e439..cfee20a9518ef 100644 --- a/toolchain/parse/testdata/let/fail_missing_type.carbon +++ b/toolchain/parse/testdata/let/fail_missing_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_missing_type.carbon -// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:7: ERROR: Expected `:` or `:!` in binding pattern. +// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:7: error: expected `:` or `:!` in binding pattern // CHECK:STDERR: let a = 4; // CHECK:STDERR: ^ let a = 4; diff --git a/toolchain/parse/testdata/let/fail_no_semi.carbon b/toolchain/parse/testdata/let/fail_no_semi.carbon index b67d63d329197..1e31d901465b6 100644 --- a/toolchain/parse/testdata/let/fail_no_semi.carbon +++ b/toolchain/parse/testdata/let/fail_no_semi.carbon @@ -10,11 +10,11 @@ let -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error: expected name in binding pattern // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: ERROR: `let` declarations must end with a `;`. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error: `let` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/match/fail_cases_after_default.carbon b/toolchain/parse/testdata/match/fail_cases_after_default.carbon index bc8335ddaa879..048b15fedf9d0 100644 --- a/toolchain/parse/testdata/match/fail_cases_after_default.carbon +++ b/toolchain/parse/testdata/match/fail_cases_after_default.carbon @@ -12,17 +12,17 @@ fn f() -> i32 { var x: i32 = 3; match (x) { default => { return 1; } - // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: ERROR: Unreachable case; `case` occurs after the `default` + // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error: unreachable case; `case` occurs after the `default` // CHECK:STDERR: case a: i32 => { return 2; } // CHECK:STDERR: ^~~~ // CHECK:STDERR: case a: i32 => { return 2; } - // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: ERROR: Unreachable case; `default` occurs after the `default` + // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error: unreachable case; `default` occurs after the `default` // CHECK:STDERR: default => { return 3; } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default => { return 3; } - // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+3]]:5: ERROR: Unreachable case; `case` occurs after the `default` + // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+3]]:5: error: unreachable case; `case` occurs after the `default` // CHECK:STDERR: case (a: i32) if (a == 4) => { return 4; } // CHECK:STDERR: ^~~~ case (a: i32) if (a == 4) => { return 4; } diff --git a/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon b/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon index 26e930b949517..dcb87bb6e56d5 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon @@ -10,12 +10,12 @@ fn f() -> i32 { match (3) { - // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+4]]:17: ERROR: Expected `=>` introducing statement block. + // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+4]]:17: error: expected `=>` introducing statement block // CHECK:STDERR: case x: i32 { return 2; } // CHECK:STDERR: ^ // CHECK:STDERR: case x: i32 { return 2; } - // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+3]]:29: ERROR: Expected `=>` introducing statement block. + // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+3]]:29: error: expected `=>` introducing statement block // CHECK:STDERR: case x: i32 if (x == 3) { return 3; } // CHECK:STDERR: ^ case x: i32 if (x == 3) { return 3; } diff --git a/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon b/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon index ee71d4cd95a53..30e251fa2f42d 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon @@ -10,7 +10,7 @@ fn f() -> i32 { match (3) { - // CHECK:STDERR: fail_missing_case_pattern.carbon:[[@LINE+3]]:10: ERROR: Expected name in binding pattern. + // CHECK:STDERR: fail_missing_case_pattern.carbon:[[@LINE+3]]:10: error: expected name in binding pattern // CHECK:STDERR: case => { return 2; } // CHECK:STDERR: ^~ case => { return 2; } diff --git a/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon b/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon index 7fcf7723be35e..8331610e5a531 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon @@ -11,7 +11,7 @@ fn f() -> i32 { match (3) { case x: i32 => - // CHECK:STDERR: fail_missing_case_statements_block.carbon:[[@LINE+3]]:5: ERROR: Expected `{` after `=>`. + // CHECK:STDERR: fail_missing_case_statements_block.carbon:[[@LINE+3]]:5: error: expected `{` after `=>` // CHECK:STDERR: default => { return 3; } // CHECK:STDERR: ^~~~~~~ default => { return 3; } diff --git a/toolchain/parse/testdata/match/fail_missing_cases.carbon b/toolchain/parse/testdata/match/fail_missing_cases.carbon index 86974d9452dd2..6eb456fd9fb52 100644 --- a/toolchain/parse/testdata/match/fail_missing_cases.carbon +++ b/toolchain/parse/testdata/match/fail_missing_cases.carbon @@ -10,7 +10,7 @@ fn f() -> i32 { - // CHECK:STDERR: fail_missing_cases.carbon:[[@LINE+3]]:14: ERROR: Expected cases. + // CHECK:STDERR: fail_missing_cases.carbon:[[@LINE+3]]:14: error: expected cases // CHECK:STDERR: match (3) {} // CHECK:STDERR: ^ match (3) {} diff --git a/toolchain/parse/testdata/match/fail_missing_cases_block.carbon b/toolchain/parse/testdata/match/fail_missing_cases_block.carbon index 240cad926208f..7b0f2b60bc369 100644 --- a/toolchain/parse/testdata/match/fail_missing_cases_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_cases_block.carbon @@ -10,7 +10,7 @@ fn f() -> i32 { match (1) - // CHECK:STDERR: fail_missing_cases_block.carbon:[[@LINE+3]]:3: ERROR: Expected `{` starting block with cases. + // CHECK:STDERR: fail_missing_cases_block.carbon:[[@LINE+3]]:3: error: expected `{` starting block with cases // CHECK:STDERR: return 0; // CHECK:STDERR: ^~~~~~ return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon b/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon index e0a8c34b929b8..055b8568b3203 100644 --- a/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon +++ b/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon @@ -10,7 +10,7 @@ fn f() -> i32 { match (3) { - // CHECK:STDERR: fail_missing_default_arrow.carbon:[[@LINE+3]]:13: ERROR: Expected `=>` introducing statement block. + // CHECK:STDERR: fail_missing_default_arrow.carbon:[[@LINE+3]]:13: error: expected `=>` introducing statement block // CHECK:STDERR: default { return 1; } // CHECK:STDERR: ^ default { return 1; } diff --git a/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon b/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon index d402067d82092..10bd6134a7f83 100644 --- a/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon @@ -11,7 +11,7 @@ fn f() -> i32 { match (3) { default => - // CHECK:STDERR: fail_missing_default_statements_block.carbon:[[@LINE+3]]:3: ERROR: Expected `{` after `=>`. + // CHECK:STDERR: fail_missing_default_statements_block.carbon:[[@LINE+3]]:3: error: expected `{` after `=>` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon b/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon index 2b547cdcebacc..7564f4aba1789 100644 --- a/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon +++ b/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon @@ -10,11 +10,11 @@ fn f() -> i32 { match (true) { - // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+7]]:21: ERROR: Opening symbol without a corresponding closing symbol. + // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+7]]:21: error: opening symbol without a corresponding closing symbol // CHECK:STDERR: case x: bool if (false => { return 1; } // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+3]]:28: ERROR: TODO: Improve match parsing. + // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+3]]:28: error: TODO: improve match parsing // CHECK:STDERR: case x: bool if (false => { return 1; } // CHECK:STDERR: ^~ case x: bool if (false => { return 1; } diff --git a/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon b/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon index fa659ac5dc0c0..74f52411fd61f 100644 --- a/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon +++ b/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon @@ -10,11 +10,11 @@ fn f() -> i32 { match (true) { - // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+7]]:21: ERROR: TODO: Improve match parsing. + // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+7]]:21: error: TODO: improve match parsing // CHECK:STDERR: case x: bool if false) => { return 1; } // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+3]]:26: ERROR: Closing symbol without a corresponding opening symbol. + // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+3]]:26: error: closing symbol without a corresponding opening symbol // CHECK:STDERR: case x: bool if false) => { return 1; } // CHECK:STDERR: ^ case x: bool if false) => { return 1; } diff --git a/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon b/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon index c3f6d5b9b1911..f3de2dcdcf5b8 100644 --- a/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon +++ b/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/match/fail_missing_matched_expr.carbon fn f() -> i32 { - // CHECK:STDERR: fail_missing_matched_expr.carbon:[[@LINE+3]]:9: ERROR: Expected `(` after `match`. + // CHECK:STDERR: fail_missing_matched_expr.carbon:[[@LINE+3]]:9: error: expected `(` after `match` // CHECK:STDERR: match { // CHECK:STDERR: ^ match { diff --git a/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon b/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon index 5a4eab54f2a4c..a47d817d433f5 100644 --- a/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon +++ b/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon @@ -11,26 +11,26 @@ fn f() -> i32 { var x: i32 = 3; match (x) { - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `let`; expected `case`, `default` or `}`. + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `let`; expected `case`, `default` or `}` // CHECK:STDERR: let u: i32 = // CHECK:STDERR: ^~~ // CHECK:STDERR: let u: i32 = case y: i32 if (y > 2) => { return 1; } - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `if`; expected `case`, `default` or `}`. + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `if`; expected `case`, `default` or `}` // CHECK:STDERR: if (true) { // CHECK:STDERR: ^~ // CHECK:STDERR: if (true) { return 2; } - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `var`; expected `case`, `default` or `}`. + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `var`; expected `case`, `default` or `}` // CHECK:STDERR: var w // CHECK:STDERR: ^~~ // CHECK:STDERR: var w case z: i32 if (z == 3) => { return 3; } - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `{`; expected `case`, `default` or `}`. + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `{`; expected `case`, `default` or `}` // CHECK:STDERR: { // CHECK:STDERR: ^ // CHECK:STDERR: @@ -38,12 +38,12 @@ fn f() -> i32 { break; } default => { return 3; } - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: ERROR: Unexpected `return`; expected `case`, `default` or `}`. + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `return`; expected `case`, `default` or `}` // CHECK:STDERR: return 1; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: return 1; - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+3]]:5: ERROR: Unexpected `(`; expected `case`, `default` or `}`. + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+3]]:5: error: unexpected `(`; expected `case`, `default` or `}` // CHECK:STDERR: ((), (), ()) // CHECK:STDERR: ^ ((), (), ()) diff --git a/toolchain/parse/testdata/member_access/fail_keyword.carbon b/toolchain/parse/testdata/member_access/fail_keyword.carbon index 6cbee85c71bb1..0cf38144a032a 100644 --- a/toolchain/parse/testdata/member_access/fail_keyword.carbon +++ b/toolchain/parse/testdata/member_access/fail_keyword.carbon @@ -9,32 +9,32 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/member_access/fail_keyword.carbon fn F() { - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`. + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.` // CHECK:STDERR: a.self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: a.self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`. + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.` // CHECK:STDERR: a.Self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: a.Self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`. + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.` // CHECK:STDERR: a.for; // CHECK:STDERR: ^~~ // CHECK:STDERR: a.for; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: ERROR: Expected identifier after `->`. + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error: expected identifier after `->` // CHECK:STDERR: p->self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: p->self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: ERROR: Expected identifier after `->`. + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error: expected identifier after `->` // CHECK:STDERR: p->Self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: p->Self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+3]]:6: ERROR: Expected identifier after `->`. + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+3]]:6: error: expected identifier after `->` // CHECK:STDERR: p->while; // CHECK:STDERR: ^~~~~ p->while; diff --git a/toolchain/parse/testdata/namespace/fail_arrow.carbon b/toolchain/parse/testdata/namespace/fail_arrow.carbon index ad5f8e4f98b92..cd020acb01181 100644 --- a/toolchain/parse/testdata/namespace/fail_arrow.carbon +++ b/toolchain/parse/testdata/namespace/fail_arrow.carbon @@ -10,7 +10,7 @@ namespace Foo; -// CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:10: ERROR: `class` declarations must either end with a `;` or have a `{ ... }` block for a definition. +// CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:10: error: `class` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: class Foo->Bar {} // CHECK:STDERR: ^~ class Foo->Bar {} diff --git a/toolchain/parse/testdata/namespace/fail_incomplete.carbon b/toolchain/parse/testdata/namespace/fail_incomplete.carbon index f4725da061aca..2d6a7be5d2501 100644 --- a/toolchain/parse/testdata/namespace/fail_incomplete.carbon +++ b/toolchain/parse/testdata/namespace/fail_incomplete.carbon @@ -8,37 +8,37 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_incomplete.carbon -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name // CHECK:STDERR: namespace 123 // CHECK:STDERR: ^~~ // CHECK:STDERR: namespace 123 -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name // CHECK:STDERR: namespace "" // CHECK:STDERR: ^~ // CHECK:STDERR: namespace "" -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name // CHECK:STDERR: namespace + // CHECK:STDERR: ^ // CHECK:STDERR: namespace + -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name // CHECK:STDERR: namespace bool // CHECK:STDERR: ^~~~ // CHECK:STDERR: namespace bool -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name // CHECK:STDERR: namespace namespace namespace namespace namespace // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: namespace namespace namespace namespace namespace -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error: `namespace` introducer should be followed by a name // CHECK:STDERR: namespace // CHECK:STDERR: ^~~~~~~~~ namespace diff --git a/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon b/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon index a3d86daceae93..eec62bff6bd6d 100644 --- a/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon +++ b/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_incomplete_name.carbon -// CHECK:STDERR: fail_incomplete_name.carbon:[[@LINE+3]]:15: ERROR: `.` should be followed by a name. +// CHECK:STDERR: fail_incomplete_name.carbon:[[@LINE+3]]:15: error: `.` should be followed by a name // CHECK:STDERR: namespace Foo.; // CHECK:STDERR: ^ namespace Foo.; diff --git a/toolchain/parse/testdata/namespace/fail_modifiers.carbon b/toolchain/parse/testdata/namespace/fail_modifiers.carbon index bd49765c47a31..edca7db78acad 100644 --- a/toolchain/parse/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/parse/testdata/namespace/fail_modifiers.carbon @@ -10,11 +10,11 @@ virtual namespace B -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: ERROR: `namespace` declarations must end with a `;`. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: error: `namespace` declarations must end with a `;` // CHECK:STDERR: impl namespace // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:6: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:6: error: `namespace` introducer should be followed by a name // CHECK:STDERR: impl namespace // CHECK:STDERR: ^~~~~~~~~ impl namespace diff --git a/toolchain/parse/testdata/namespace/fail_no_name.carbon b/toolchain/parse/testdata/namespace/fail_no_name.carbon index 71ac7cd322316..3604f32ae509e 100644 --- a/toolchain/parse/testdata/namespace/fail_no_name.carbon +++ b/toolchain/parse/testdata/namespace/fail_no_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:10: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:10: error: `namespace` introducer should be followed by a name // CHECK:STDERR: namespace; // CHECK:STDERR: ^ namespace; diff --git a/toolchain/parse/testdata/operators/fail_chained_assign.carbon b/toolchain/parse/testdata/operators/fail_chained_assign.carbon index 34d7e4b7b0404..58722842476d0 100644 --- a/toolchain/parse/testdata/operators/fail_chained_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_chained_assign.carbon @@ -13,7 +13,7 @@ fn F() { var b: i32; // TODO: Produce a custom diagnostic for this. - // CHECK:STDERR: fail_chained_assign.carbon:[[@LINE+3]]:9: ERROR: Operator `=` can only be used as a complete statement. + // CHECK:STDERR: fail_chained_assign.carbon:[[@LINE+3]]:9: error: operator `=` can only be used as a complete statement // CHECK:STDERR: a = b = 1; // CHECK:STDERR: ^ a = b = 1; diff --git a/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon b/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon index ee650c6d62bf0..f9c7ff8e42d36 100644 --- a/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon +++ b/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon @@ -10,7 +10,7 @@ // TODO: We could figure out that this first Failed example is infix // with one-token lookahead. -// CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+3]]:16: ERROR: `var` declarations must end with a `;`. +// CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+3]]:16: error: `var` declarations must end with a `;` // CHECK:STDERR: var n: i8 = n* n; // CHECK:STDERR: ^ var n: i8 = n* n; diff --git a/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon b/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon index 3ef371f7b301d..5bfa6535ff90c 100644 --- a/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon +++ b/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon -// CHECK:STDERR: fail_infix_uneven_space_before.carbon:[[@LINE+3]]:15: ERROR: Whitespace missing after binary operator. +// CHECK:STDERR: fail_infix_uneven_space_before.carbon:[[@LINE+3]]:15: error: whitespace missing after binary operator // CHECK:STDERR: var n: i8 = n *n; // CHECK:STDERR: ^ var n: i8 = n *n; diff --git a/toolchain/parse/testdata/operators/fail_invalid_infix.carbon b/toolchain/parse/testdata/operators/fail_invalid_infix.carbon index 43d91d75c9d6a..328058a59170d 100644 --- a/toolchain/parse/testdata/operators/fail_invalid_infix.carbon +++ b/toolchain/parse/testdata/operators/fail_invalid_infix.carbon @@ -8,21 +8,21 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_invalid_infix.carbon -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:19: ERROR: Expected expression. +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:19: error: expected expression // CHECK:STDERR: var a: i32 = n == ; // CHECK:STDERR: ^ // CHECK:STDERR: var a: i32 = n == ; -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:14: ERROR: Expected expression. +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:14: error: expected expression // CHECK:STDERR: var b: i32 = == n; // CHECK:STDERR: ^~ // CHECK:STDERR: var b: i32 = == n; -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+7]]:14: ERROR: Expected expression. +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+7]]:14: error: expected expression // CHECK:STDERR: var c: i32 = == ; // CHECK:STDERR: ^~ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+3]]:17: ERROR: Expected expression. +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+3]]:17: error: expected expression // CHECK:STDERR: var c: i32 = == ; // CHECK:STDERR: ^ var c: i32 = == ; diff --git a/toolchain/parse/testdata/operators/fail_postfix_space.carbon b/toolchain/parse/testdata/operators/fail_postfix_space.carbon index b7b02435ce3ba..375e699d4678e 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space.carbon -// CHECK:STDERR: fail_postfix_space.carbon:[[@LINE+3]]:18: ERROR: Whitespace is not allowed before this unary operator. +// CHECK:STDERR: fail_postfix_space.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator // CHECK:STDERR: var v: type = i8 *; // CHECK:STDERR: ^ var v: type = i8 *; diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon index 96378673ecbe0..95a8b13a47deb 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon -// CHECK:STDERR: fail_postfix_space_before_comma.carbon:[[@LINE+3]]:18: ERROR: Whitespace is not allowed before this unary operator. +// CHECK:STDERR: fail_postfix_space_before_comma.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator // CHECK:STDERR: var n: i8 = F(i8 *, 0); // CHECK:STDERR: ^ var n: i8 = F(i8 *, 0); diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon index 2cd0004a4f6db..b31da2a7af4e1 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon -// CHECK:STDERR: fail_postfix_space_in_call.carbon:[[@LINE+3]]:18: ERROR: Whitespace is not allowed before this unary operator. +// CHECK:STDERR: fail_postfix_space_in_call.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator // CHECK:STDERR: var n: i8 = F(i8 *); // CHECK:STDERR: ^ var n: i8 = F(i8 *); diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon index e3ba50e910d37..acbb30868b77d 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon -// CHECK:STDERR: fail_postfix_space_surrounding.carbon:[[@LINE+3]]:18: ERROR: Whitespace is not allowed before this unary operator. +// CHECK:STDERR: fail_postfix_space_surrounding.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator // CHECK:STDERR: var v: type = i8 * ; // CHECK:STDERR: ^ var v: type = i8 * ; diff --git a/toolchain/parse/testdata/operators/fail_postincrement.carbon b/toolchain/parse/testdata/operators/fail_postincrement.carbon index 0752a21d45788..f539c4c85f6a0 100644 --- a/toolchain/parse/testdata/operators/fail_postincrement.carbon +++ b/toolchain/parse/testdata/operators/fail_postincrement.carbon @@ -11,12 +11,12 @@ fn F() { var n: i32 = 0; // TODO: It'd be nice to produce a custom diagnostic here. - // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+4]]:4: ERROR: Expected `;` after expression statement. + // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement // CHECK:STDERR: n++; // CHECK:STDERR: ^~ // CHECK:STDERR: n++; - // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+3]]:4: ERROR: Expected `;` after expression statement. + // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+3]]:4: error: expected `;` after expression statement // CHECK:STDERR: n--; // CHECK:STDERR: ^~ n--; diff --git a/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon b/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon index 5f0f70bf89725..be56acc3f61f0 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_precedence_and_or.carbon fn F() { - // CHECK:STDERR: fail_precedence_and_or.carbon:[[@LINE+3]]:11: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_and_or.carbon:[[@LINE+3]]:11: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: a and b or c; // CHECK:STDERR: ^~ a and b or c; diff --git a/toolchain/parse/testdata/operators/fail_precedence_as.carbon b/toolchain/parse/testdata/operators/fail_precedence_as.carbon index f767842bf3d6b..58b18ae37de45 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_as.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_as.carbon @@ -10,43 +10,43 @@ fn F(n: i32) { // No ordering between `not` and `as`. - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: not true as bool; // CHECK:STDERR: ^~ // CHECK:STDERR: not true as bool; // No ordering between mathematical binary operators and `as`. - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: 1 + 1 as i32; // CHECK:STDERR: ^~ // CHECK:STDERR: 1 + 1 as i32; - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: 5 % 2 as i32; // CHECK:STDERR: ^~ // CHECK:STDERR: 5 % 2 as i32; // No ordering between logical binary operators and `as`. - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: 3 as i32 and true; // CHECK:STDERR: ^~~ // CHECK:STDERR: 3 as i32 and true; - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:14: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:14: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: false or 4 as i32; // CHECK:STDERR: ^~ // CHECK:STDERR: false or 4 as i32; // No ordering between relational binary operators and `as`. - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: 6 as i32 == 7; // CHECK:STDERR: ^~ // CHECK:STDERR: 6 as i32 == 7; - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+3]]:10: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+3]]:10: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: 8 <= 9 as i32; // CHECK:STDERR: ^~ 8 <= 9 as i32; diff --git a/toolchain/parse/testdata/operators/fail_precedence_assign.carbon b/toolchain/parse/testdata/operators/fail_precedence_assign.carbon index 24485d7f876ae..e6805a40a9c34 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_assign.carbon @@ -12,26 +12,26 @@ fn F() { var a: i32; // Assignment can only appear as an expression statement, not as a subexpression. // TODO: Produce the "can only be used as a complete statement" diagnostic in each of these cases. - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:10: ERROR: Expected `,` or `)`. + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:10: error: expected `,` or `)` // CHECK:STDERR: 1 + (a = 1); // CHECK:STDERR: ^ // CHECK:STDERR: 1 + (a = 1); - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+8]]:19: ERROR: Expected `else` after `if ... then ...`. + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+8]]:19: error: expected `else` after `if ... then ...` // CHECK:STDERR: (if true then a += 1 else a /= 2); // CHECK:STDERR: ^~ // CHECK:STDERR: - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:19: ERROR: Expected `,` or `)`. + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:19: error: expected `,` or `)` // CHECK:STDERR: (if true then a += 1 else a /= 2); // CHECK:STDERR: ^~ // CHECK:STDERR: (if true then a += 1 else a /= 2); - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:7: ERROR: Operator `++` can only be used as a complete statement. + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:7: error: operator `++` can only be used as a complete statement // CHECK:STDERR: a + ++a; // CHECK:STDERR: ^~ // CHECK:STDERR: a + ++a; - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+3]]:5: ERROR: Parentheses are required around this unary `if` operator. + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+3]]:5: error: parentheses are required around this unary `if` operator // CHECK:STDERR: ++if c then a else b; // CHECK:STDERR: ^~ ++if c then a else b; diff --git a/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon b/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon index c23b117e6dda1..8beaf3bceeb33 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_precedence_or_and.carbon fn F() { - // CHECK:STDERR: fail_precedence_or_and.carbon:[[@LINE+3]]:10: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_precedence_or_and.carbon:[[@LINE+3]]:10: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: a or b and c; // CHECK:STDERR: ^~~ a or b and c; diff --git a/toolchain/parse/testdata/operators/fail_precedence_where.carbon b/toolchain/parse/testdata/operators/fail_precedence_where.carbon index 10aaba3a3640b..8c2b37ba34936 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_where.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_where.carbon @@ -11,7 +11,7 @@ // --- fail_and_where.carbon fn AndWhere() { - // CHECK:STDERR: fail_and_where.carbon:[[@LINE+4]]:14: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_and_where.carbon:[[@LINE+4]]:14: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: true and T where .A = B; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -21,7 +21,7 @@ fn AndWhere() { // --- fail_where_or.carbon fn WhereOr() { - // CHECK:STDERR: fail_where_or.carbon:[[@LINE+4]]:22: ERROR: Expected `;` after expression statement. + // CHECK:STDERR: fail_where_or.carbon:[[@LINE+4]]:22: error: expected `;` after expression statement // CHECK:STDERR: U where .C impls D or false; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -31,7 +31,7 @@ fn WhereOr() { // --- fail_equals_where.carbon fn EqualsWhere() { - // CHECK:STDERR: fail_equals_where.carbon:[[@LINE+4]]:10: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_equals_where.carbon:[[@LINE+4]]:10: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: e == V where .G == f32; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -41,7 +41,7 @@ fn EqualsWhere() { // --- fail_where_neq.carbon fn WhereNEq() { - // CHECK:STDERR: fail_where_neq.carbon:[[@LINE+4]]:21: ERROR: Expected `;` after expression statement. + // CHECK:STDERR: fail_where_neq.carbon:[[@LINE+4]]:21: error: expected `;` after expression statement // CHECK:STDERR: W where .H = bool != i; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -51,7 +51,7 @@ fn WhereNEq() { // --- fail_less_requirement.carbon fn LessRequirement() { - // CHECK:STDERR: fail_less_requirement.carbon:[[@LINE+4]]:14: ERROR: Requirement should use `impls`, `=`, or `==` operator. + // CHECK:STDERR: fail_less_requirement.carbon:[[@LINE+4]]:14: error: requirement should use `impls`, `=`, or `==` operator // CHECK:STDERR: X where .J < .K; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -61,7 +61,7 @@ fn LessRequirement() { // --- fail_as_where.carbon fn AsWhere() { - // CHECK:STDERR: fail_as_where.carbon:[[@LINE+4]]:10: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_as_where.carbon:[[@LINE+4]]:10: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: Y as Z where .L impls M; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -71,7 +71,7 @@ fn AsWhere() { // --- fail_where_as.carbon fn WhereAs() { - // CHECK:STDERR: fail_where_as.carbon:[[@LINE+4]]:21: ERROR: Expected `;` after expression statement. + // CHECK:STDERR: fail_where_as.carbon:[[@LINE+4]]:21: error: expected `;` after expression statement // CHECK:STDERR: S where .N == i32 as type; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -81,7 +81,7 @@ fn WhereAs() { // --- fail_as_in_argument.carbon fn AsInArgument() { - // CHECK:STDERR: fail_as_in_argument.carbon:[[@LINE+4]]:14: ERROR: Requirement should use `impls`, `=`, or `==` operator. + // CHECK:STDERR: fail_as_in_argument.carbon:[[@LINE+4]]:14: error: requirement should use `impls`, `=`, or `==` operator // CHECK:STDERR: R where .O as type impls P; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -91,7 +91,7 @@ fn AsInArgument() { // --- fail_greater_in_argument.carbon fn GreaterInArgument() { - // CHECK:STDERR: fail_greater_in_argument.carbon:[[@LINE+3]]:15: ERROR: Requirement should use `impls`, `=`, or `==` operator. + // CHECK:STDERR: fail_greater_in_argument.carbon:[[@LINE+3]]:15: error: requirement should use `impls`, `=`, or `==` operator // CHECK:STDERR: Q where .AA > .BB impls CC; // CHECK:STDERR: ^ Q where .AA > .BB impls CC; diff --git a/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon b/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon index 470218e2c6a51..3daa7a0ce6c44 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_repeat.carbon -// CHECK:STDERR: fail_prefix_repeat.carbon:[[@LINE+3]]:17: ERROR: Parentheses are required around this unary `const` operator. +// CHECK:STDERR: fail_prefix_repeat.carbon:[[@LINE+3]]:17: error: parentheses are required around this unary `const` operator // CHECK:STDERR: fn F() -> const const i32* { // CHECK:STDERR: ^~~~~ fn F() -> const const i32* { diff --git a/toolchain/parse/testdata/operators/fail_prefix_space.carbon b/toolchain/parse/testdata/operators/fail_prefix_space.carbon index 1aa603f273b0b..f450185a540dd 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_space.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_space.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_space.carbon -// CHECK:STDERR: fail_prefix_space.carbon:[[@LINE+3]]:13: ERROR: Whitespace is not allowed after this unary operator. +// CHECK:STDERR: fail_prefix_space.carbon:[[@LINE+3]]:13: error: whitespace is not allowed after this unary operator // CHECK:STDERR: var n: i8 = - n; // CHECK:STDERR: ^ var n: i8 = - n; diff --git a/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon b/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon index 149eb94518166..89faab0f44844 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon -// CHECK:STDERR: fail_prefix_uneven_space_with_assign.carbon:[[@LINE+3]]:12: ERROR: Whitespace is not allowed after this unary operator. +// CHECK:STDERR: fail_prefix_uneven_space_with_assign.carbon:[[@LINE+3]]:12: error: whitespace is not allowed after this unary operator // CHECK:STDERR: var n: i8 =- n; // CHECK:STDERR: ^ var n: i8 =- n; diff --git a/toolchain/parse/testdata/operators/fail_star_minus.carbon b/toolchain/parse/testdata/operators/fail_star_minus.carbon index 8c1dc6aa698a9..22792f5aa2373 100644 --- a/toolchain/parse/testdata/operators/fail_star_minus.carbon +++ b/toolchain/parse/testdata/operators/fail_star_minus.carbon @@ -13,7 +13,7 @@ // available because it has already accepted that first part of the expression, // so it is recovering by using the second option, but the diagnostic should // ideally offer (or consider) both fixes as alternatives. -// CHECK:STDERR: fail_star_minus.carbon:[[@LINE+3]]:16: ERROR: Whitespace missing after binary operator. +// CHECK:STDERR: fail_star_minus.carbon:[[@LINE+3]]:16: error: whitespace missing after binary operator // CHECK:STDERR: var n: i8 = n* -n; // CHECK:STDERR: ^ var n: i8 = n* -n; diff --git a/toolchain/parse/testdata/operators/fail_star_star.carbon b/toolchain/parse/testdata/operators/fail_star_star.carbon index 8703d2596ad75..496bc8225af55 100644 --- a/toolchain/parse/testdata/operators/fail_star_star.carbon +++ b/toolchain/parse/testdata/operators/fail_star_star.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_star_star.carbon -// CHECK:STDERR: fail_star_star.carbon:[[@LINE+3]]:16: ERROR: Whitespace missing after binary operator. +// CHECK:STDERR: fail_star_star.carbon:[[@LINE+3]]:16: error: whitespace missing after binary operator // CHECK:STDERR: var n: i8 = n* *p; // CHECK:STDERR: ^ var n: i8 = n* *p; diff --git a/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon b/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon index aef4e42b3d3cc..e55133c8694cc 100644 --- a/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon +++ b/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon @@ -12,7 +12,7 @@ // before we notice the missing whitespace around the second `*`. // It'd be better to (somehow) form n*(*p) and reject due to the missing // whitespace around the first `*`. -// CHECK:STDERR: fail_star_star_no_space.carbon:[[@LINE+3]]:16: ERROR: `var` declarations must end with a `;`. +// CHECK:STDERR: fail_star_star_no_space.carbon:[[@LINE+3]]:16: error: `var` declarations must end with a `;` // CHECK:STDERR: var n: i8 = n**p; // CHECK:STDERR: ^ var n: i8 = n**p; diff --git a/toolchain/parse/testdata/operators/fail_variety.carbon b/toolchain/parse/testdata/operators/fail_variety.carbon index 46ea4d53086f8..706d25c8be25b 100644 --- a/toolchain/parse/testdata/operators/fail_variety.carbon +++ b/toolchain/parse/testdata/operators/fail_variety.carbon @@ -9,23 +9,23 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_variety.carbon fn F() { - // CHECK:STDERR: fail_variety.carbon:[[@LINE+19]]:21: ERROR: Operator `=` can only be used as a complete statement. + // CHECK:STDERR: fail_variety.carbon:[[@LINE+19]]:21: error: operator `=` can only be used as a complete statement // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+15]]:29: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_variety.carbon:[[@LINE+15]]:29: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^~ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+11]]:34: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_variety.carbon:[[@LINE+11]]:34: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+7]]:38: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_variety.carbon:[[@LINE+7]]:38: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+3]]:40: ERROR: Parentheses are required around this unary `not` operator. + // CHECK:STDERR: fail_variety.carbon:[[@LINE+3]]:40: error: parentheses are required around this unary `not` operator // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^~~ n = a * b + c * d = d * d << e & f - not g; diff --git a/toolchain/parse/testdata/package_expr/fail_in_name.carbon b/toolchain/parse/testdata/package_expr/fail_in_name.carbon index 6119893486947..8b391283b85ca 100644 --- a/toolchain/parse/testdata/package_expr/fail_in_name.carbon +++ b/toolchain/parse/testdata/package_expr/fail_in_name.carbon @@ -8,19 +8,19 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/package_expr/fail_in_name.carbon -// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:5: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:5: error: expected name in binding pattern // CHECK:STDERR: var package.val: i32; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var package.val: i32; -// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:11: ERROR: `namespace` introducer should be followed by a name. +// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name // CHECK:STDERR: namespace package.NS; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: namespace package.NS; -// CHECK:STDERR: fail_in_name.carbon:[[@LINE+3]]:7: ERROR: `class` introducer should be followed by a name. +// CHECK:STDERR: fail_in_name.carbon:[[@LINE+3]]:7: error: `class` introducer should be followed by a name // CHECK:STDERR: class package.C { // CHECK:STDERR: ^~~~~~~ class package.C { diff --git a/toolchain/parse/testdata/packages/export.carbon b/toolchain/parse/testdata/packages/export.carbon index ce0de9887547e..c79383fa5c51c 100644 --- a/toolchain/parse/testdata/packages/export.carbon +++ b/toolchain/parse/testdata/packages/export.carbon @@ -28,7 +28,7 @@ export Foo.Bar; package Pkg; -// CHECK:STDERR: fail_expr.carbon:[[@LINE+4]]:8: ERROR: `export` introducer should be followed by a name. +// CHECK:STDERR: fail_expr.carbon:[[@LINE+4]]:8: error: `export` introducer should be followed by a name // CHECK:STDERR: export (); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -38,7 +38,7 @@ export (); package Pkg; -// CHECK:STDERR: fail_package_in_name.carbon:[[@LINE+4]]:8: ERROR: `export` introducer should be followed by a name. +// CHECK:STDERR: fail_package_in_name.carbon:[[@LINE+4]]:8: error: `export` introducer should be followed by a name // CHECK:STDERR: export package.Bar; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -48,7 +48,7 @@ export package.Bar; package Pkg; -// CHECK:STDERR: fail_keyword_only:[[@LINE+4]]:1: ERROR: `export` introducer should be followed by a name. +// CHECK:STDERR: fail_keyword_only:[[@LINE+4]]:1: error: `export` introducer should be followed by a name // CHECK:STDERR: export // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -58,7 +58,7 @@ export package Pkg; -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+4]]:8: ERROR: `export` introducer should be followed by a name. +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+4]]:8: error: `export` introducer should be followed by a name // CHECK:STDERR: export ; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -69,7 +69,7 @@ export ; package Pkg; export Foo -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:1: ERROR: `export` declarations must end with a `;`. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:1: error: `export` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDERR: ^ // CHECK:STDERR: @@ -78,7 +78,7 @@ export Foo package Pkg; -// CHECK:STDERR: fail_incomplete_qual_name.carbon:[[@LINE+4]]:12: ERROR: `.` should be followed by a name. +// CHECK:STDERR: fail_incomplete_qual_name.carbon:[[@LINE+4]]:12: error: `.` should be followed by a name // CHECK:STDERR: export Foo.; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -88,7 +88,7 @@ export Foo.; package Pkg; -// CHECK:STDERR: fail_incomplete_qual_name2.carbon:[[@LINE+4]]:8: ERROR: `export` introducer should be followed by a name. +// CHECK:STDERR: fail_incomplete_qual_name2.carbon:[[@LINE+4]]:8: error: `export` introducer should be followed by a name // CHECK:STDERR: export .Bar; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -108,10 +108,10 @@ package Pkg; export Foo; -// CHECK:STDERR: fail_before_import.carbon:[[@LINE+7]]:1: ERROR: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file. +// CHECK:STDERR: fail_before_import.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import library "lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_before_import.carbon:[[@LINE-5]]:1: First declaration is here. +// CHECK:STDERR: fail_before_import.carbon:[[@LINE-5]]:1: first declaration is here // CHECK:STDERR: export Foo; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -119,7 +119,7 @@ import library "lib"; // --- fail_in_default_library.carbon -// CHECK:STDERR: fail_in_default_library.carbon:[[@LINE+4]]:1: ERROR: `export` is only allowed in API files. +// CHECK:STDERR: fail_in_default_library.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files // CHECK:STDERR: export Foo; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -129,7 +129,7 @@ export Foo; impl package Pkg; -// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: ERROR: `export` is only allowed in API files. +// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: error: `export` is only allowed in API files // CHECK:STDERR: export Foo; // CHECK:STDERR: ^~~~~~ export Foo; diff --git a/toolchain/parse/testdata/packages/import/export.carbon b/toolchain/parse/testdata/packages/import/export.carbon index bca0c93d60452..e378e94b25daf 100644 --- a/toolchain/parse/testdata/packages/import/export.carbon +++ b/toolchain/parse/testdata/packages/import/export.carbon @@ -12,7 +12,7 @@ package Pkg; -// CHECK:STDERR: fail_package.carbon:[[@LINE+4]]:15: ERROR: `export` cannot be used when importing a package. +// CHECK:STDERR: fail_package.carbon:[[@LINE+4]]:15: error: `export` cannot be used when importing a package // CHECK:STDERR: export import Bar; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -38,10 +38,10 @@ export import library "a"; class C; -// CHECK:STDERR: fail_order.carbon:[[@LINE+7]]:1: ERROR: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file. +// CHECK:STDERR: fail_order.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: export import library "b"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_order.carbon:[[@LINE-5]]:1: First declaration is here. +// CHECK:STDERR: fail_order.carbon:[[@LINE-5]]:1: first declaration is here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -49,7 +49,7 @@ export import library "b"; // --- fail_in_default_library.carbon -// CHECK:STDERR: fail_in_default_library.carbon:[[@LINE+4]]:1: ERROR: `export` is only allowed in API files. +// CHECK:STDERR: fail_in_default_library.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files // CHECK:STDERR: export import library "lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -59,7 +59,7 @@ export import library "lib"; impl package Pkg; -// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: ERROR: `export` is only allowed in API files. +// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: error: `export` is only allowed in API files // CHECK:STDERR: export import library "lib"; // CHECK:STDERR: ^~~~~~ export import library "lib"; diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon index 746b03be00669..ce1d3aaa28dc8 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon @@ -10,10 +10,10 @@ fn A(); -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: ERROR: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file. +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: First declaration is here. +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ import B; diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon index 27e19adac5abc..d192436c4be99 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon @@ -10,10 +10,10 @@ fn A(); -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: ERROR: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file. +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-5]]:1: First declaration is here. +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-5]]:1: first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -21,10 +21,10 @@ import B; // Note this is still invalid, but doesn't warn because it's sequential. import C; -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: ERROR: The `package` declaration must be the first non-comment line. +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package D; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-16]]:1: First non-comment line is here. +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-16]]:1: first non-comment line is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -32,10 +32,10 @@ package D; fn E(); -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+6]]:1: ERROR: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file. +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+6]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import F; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-27]]:1: First declaration is here. +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-27]]:1: first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ import F; diff --git a/toolchain/parse/testdata/packages/import/fail_extra_string.carbon b/toolchain/parse/testdata/packages/import/fail_extra_string.carbon index 17867e0f66081..d87628d54685e 100644 --- a/toolchain/parse/testdata/packages/import/fail_extra_string.carbon +++ b/toolchain/parse/testdata/packages/import/fail_extra_string.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_extra_string.carbon -// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:26: ERROR: `import` declarations must end with a `;`. +// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:26: error: `import` declarations must end with a `;` // CHECK:STDERR: import Foo library "bar" "baz"; // CHECK:STDERR: ^~~~~ import Foo library "bar" "baz"; diff --git a/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon b/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon index de2d019caa76f..8be5617b08de2 100644 --- a/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon +++ b/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon -// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:25: ERROR: Expected a string literal to specify the library name. +// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:25: error: expected a string literal to specify the library name // CHECK:STDERR: import Geometry library Shapes; // CHECK:STDERR: ^~~~~~ import Geometry library Shapes; diff --git a/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon b/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon index 06b1bb52e3257..8ca4c06864587 100644 --- a/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon +++ b/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon -// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:8: ERROR: Expected identifier or `library` after `import`. +// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:8: error: expected identifier or `library` after `import` // CHECK:STDERR: import fn; // CHECK:STDERR: ^~ import fn; diff --git a/toolchain/parse/testdata/packages/import/fail_no_name.carbon b/toolchain/parse/testdata/packages/import/fail_no_name.carbon index eca368456de05..c0436e010efef 100644 --- a/toolchain/parse/testdata/packages/import/fail_no_name.carbon +++ b/toolchain/parse/testdata/packages/import/fail_no_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:7: ERROR: Expected identifier or `library` after `import`. +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:7: error: expected identifier or `library` after `import` // CHECK:STDERR: import; // CHECK:STDERR: ^ import; diff --git a/toolchain/parse/testdata/packages/import/fail_no_semi.carbon b/toolchain/parse/testdata/packages/import/fail_no_semi.carbon index 582be4217676f..b0f6913c9745f 100644 --- a/toolchain/parse/testdata/packages/import/fail_no_semi.carbon +++ b/toolchain/parse/testdata/packages/import/fail_no_semi.carbon @@ -10,7 +10,7 @@ import Geometry -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: ERROR: `import` declarations must end with a `;`. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: error: `import` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon b/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon index e8a36376c9fa5..6dbb4947044f5 100644 --- a/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon +++ b/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon -// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:17: ERROR: Missing `library` keyword. +// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:17: error: missing `library` keyword // CHECK:STDERR: import Geometry "Shapes"; // CHECK:STDERR: ^~~~~~~~ import Geometry "Shapes"; diff --git a/toolchain/parse/testdata/packages/import/fail_type.carbon b/toolchain/parse/testdata/packages/import/fail_type.carbon index a7a08999d450a..cca3d921c8574 100644 --- a/toolchain/parse/testdata/packages/import/fail_type.carbon +++ b/toolchain/parse/testdata/packages/import/fail_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_type.carbon -// CHECK:STDERR: fail_type.carbon:[[@LINE+3]]:17: ERROR: `import` declarations must end with a `;`. +// CHECK:STDERR: fail_type.carbon:[[@LINE+3]]:17: error: `import` declarations must end with a `;` // CHECK:STDERR: import Geometry api; // CHECK:STDERR: ^~~ import Geometry api; diff --git a/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon b/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon index 549d16f611ec2..a5bdcc0255d2e 100644 --- a/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon +++ b/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon @@ -10,7 +10,7 @@ // --- fail_identifier.carbon -// CHECK:STDERR: fail_identifier.carbon:[[@LINE+4]]:9: ERROR: Expected `default` or a string literal to specify the library name. +// CHECK:STDERR: fail_identifier.carbon:[[@LINE+4]]:9: error: expected `default` or a string literal to specify the library name // CHECK:STDERR: library Shapes; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ library Shapes; // --- fail_raw_identifier.carbon -// CHECK:STDERR: fail_raw_identifier.carbon:[[@LINE+4]]:9: ERROR: Expected `default` or a string literal to specify the library name. +// CHECK:STDERR: fail_raw_identifier.carbon:[[@LINE+4]]:9: error: expected `default` or a string literal to specify the library name // CHECK:STDERR: library r#default; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -26,7 +26,7 @@ library r#default; // --- fail_missing.carbon -// CHECK:STDERR: fail_missing.carbon:[[@LINE+4]]:8: ERROR: Expected `default` or a string literal to specify the library name. +// CHECK:STDERR: fail_missing.carbon:[[@LINE+4]]:8: error: expected `default` or a string literal to specify the library name // CHECK:STDERR: library; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -34,7 +34,7 @@ library; // --- fail_missing_with_api.carbon -// CHECK:STDERR: fail_missing_with_api.carbon:[[@LINE+4]]:8: ERROR: Expected `default` or a string literal to specify the library name. +// CHECK:STDERR: fail_missing_with_api.carbon:[[@LINE+4]]:8: error: expected `default` or a string literal to specify the library name // CHECK:STDERR: library; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -42,7 +42,7 @@ library; // --- fail_trailing_impl.carbon -// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+4]]:25: ERROR: `library` declarations must end with a `;`. +// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+4]]:25: error: `library` declarations must end with a `;` // CHECK:STDERR: library "trailing_impl" impl // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ library "[[@TEST_NAME]]" impl library "[[@TEST_NAME]]" -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+46]]:21: ERROR: `library` declarations must end with a `;`. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+46]]:21: error: `library` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_identifier.carbon diff --git a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon index 3a684f4c9a7c4..753dbbd08f8fa 100644 --- a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon @@ -10,10 +10,10 @@ ; -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: ERROR: The `library` declaration must be the first non-comment line. +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error: the `library` declaration must be the first non-comment line // CHECK:STDERR: library "semi_before"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: First non-comment line is here. +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: first non-comment line is here // CHECK:STDERR: ; // CHECK:STDERR: ^ library "[[@TEST_NAME]]"; diff --git a/toolchain/parse/testdata/packages/library/fail_too_late.carbon b/toolchain/parse/testdata/packages/library/fail_too_late.carbon index 641126afdcf86..094f221a90b9e 100644 --- a/toolchain/parse/testdata/packages/library/fail_too_late.carbon +++ b/toolchain/parse/testdata/packages/library/fail_too_late.carbon @@ -10,10 +10,10 @@ import Geometry; -// CHECK:STDERR: fail_too_late.carbon:[[@LINE+6]]:1: ERROR: The `library` declaration must be the first non-comment line. +// CHECK:STDERR: fail_too_late.carbon:[[@LINE+6]]:1: error: the `library` declaration must be the first non-comment line // CHECK:STDERR: library "too_late"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: First non-comment line is here. +// CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: first non-comment line is here // CHECK:STDERR: import Geometry; // CHECK:STDERR: ^~~~~~ library "[[@TEST_NAME]]"; diff --git a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon index a9e2091e158f5..68343815297cd 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon @@ -10,10 +10,10 @@ fn A(); -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: ERROR: The `package` declaration must be the first non-comment line. +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: First non-comment line is here. +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: first non-comment line is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_after_import.carbon b/toolchain/parse/testdata/packages/package/fail_after_import.carbon index edd8d66235ff3..3b4ad86497ab2 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_import.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_import.carbon @@ -10,10 +10,10 @@ import A; -// CHECK:STDERR: fail_after_import.carbon:[[@LINE+6]]:1: ERROR: The `package` declaration must be the first non-comment line. +// CHECK:STDERR: fail_after_import.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_import.carbon:[[@LINE-5]]:1: First non-comment line is here. +// CHECK:STDERR: fail_after_import.carbon:[[@LINE-5]]:1: first non-comment line is here // CHECK:STDERR: import A; // CHECK:STDERR: ^~~~~~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_after_package.carbon b/toolchain/parse/testdata/packages/package/fail_after_package.carbon index d87568478497c..fa01df6048abc 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_package.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_package.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_after_package.carbon package A; -// CHECK:STDERR: fail_after_package.carbon:[[@LINE+6]]:1: ERROR: The `package` declaration must be the first non-comment line. +// CHECK:STDERR: fail_after_package.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_package.carbon:[[@LINE-4]]:1: First non-comment line is here. +// CHECK:STDERR: fail_after_package.carbon:[[@LINE-4]]:1: first non-comment line is here // CHECK:STDERR: package A; // CHECK:STDERR: ^~~~~~~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_extra_string.carbon b/toolchain/parse/testdata/packages/package/fail_extra_string.carbon index 0bdbc3501ae6e..1c980444ef545 100644 --- a/toolchain/parse/testdata/packages/package/fail_extra_string.carbon +++ b/toolchain/parse/testdata/packages/package/fail_extra_string.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_extra_string.carbon -// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:27: ERROR: `package` declarations must end with a `;`. +// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:27: error: `package` declarations must end with a `;` // CHECK:STDERR: package Foo library "bar" "baz"; // CHECK:STDERR: ^~~~~ package Foo library "bar" "baz"; diff --git a/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon b/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon index 456d5c68ea73b..ebcff05e61cc7 100644 --- a/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon +++ b/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon -// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:26: ERROR: Expected a string literal to specify the library name. +// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:26: error: expected a string literal to specify the library name // CHECK:STDERR: package Geometry library Shapes; // CHECK:STDERR: ^~~~~~ package Geometry library Shapes; diff --git a/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon b/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon index 56124481eb7fb..2aea5f8e6db35 100644 --- a/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon +++ b/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon -// CHECK:STDERR: fail_library_skips_name.carbon:[[@LINE+3]]:9: ERROR: Expected identifier after `package`. +// CHECK:STDERR: fail_library_skips_name.carbon:[[@LINE+3]]:9: error: expected identifier after `package` // CHECK:STDERR: package library "Shapes"; // CHECK:STDERR: ^~~~~~~ package library "Shapes"; diff --git a/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon b/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon index 4ccac09654c04..e17ec94413f26 100644 --- a/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon +++ b/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon -// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:9: ERROR: Expected identifier after `package`. +// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:9: error: expected identifier after `package` // CHECK:STDERR: package fn; // CHECK:STDERR: ^~ package fn; diff --git a/toolchain/parse/testdata/packages/package/fail_no_name.carbon b/toolchain/parse/testdata/packages/package/fail_no_name.carbon index d81b05bda8fd6..cc78d664a3fc7 100644 --- a/toolchain/parse/testdata/packages/package/fail_no_name.carbon +++ b/toolchain/parse/testdata/packages/package/fail_no_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:8: ERROR: Expected identifier after `package`. +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:8: error: expected identifier after `package` // CHECK:STDERR: package; // CHECK:STDERR: ^ package; diff --git a/toolchain/parse/testdata/packages/package/fail_no_semi.carbon b/toolchain/parse/testdata/packages/package/fail_no_semi.carbon index f1728321edf47..9c1211ed89eaf 100644 --- a/toolchain/parse/testdata/packages/package/fail_no_semi.carbon +++ b/toolchain/parse/testdata/packages/package/fail_no_semi.carbon @@ -10,7 +10,7 @@ package Geometry -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: ERROR: `package` declarations must end with a `;`. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: error: `package` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon b/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon index 059e5980fa614..7d0c372da8cfd 100644 --- a/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon +++ b/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon -// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:18: ERROR: Missing `library` keyword. +// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:18: error: missing `library` keyword // CHECK:STDERR: package Geometry "Shapes"; // CHECK:STDERR: ^~~~~~~~ package Geometry "Shapes"; diff --git a/toolchain/parse/testdata/packages/package/fail_semi_before.carbon b/toolchain/parse/testdata/packages/package/fail_semi_before.carbon index b31cce5c31244..b9a32e2036c7b 100644 --- a/toolchain/parse/testdata/packages/package/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/package/fail_semi_before.carbon @@ -10,10 +10,10 @@ ; -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: ERROR: The `package` declaration must be the first non-comment line. +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line // CHECK:STDERR: package Geometry; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: First non-comment line is here. +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: first non-comment line is here // CHECK:STDERR: ; // CHECK:STDERR: ^ package Geometry; diff --git a/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon b/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon index 3a45194061b83..a5f986d72e1ea 100644 --- a/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon +++ b/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon -// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+3]]:18: ERROR: `package` declarations must end with a `;`. +// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+3]]:18: error: `package` declarations must end with a `;` // CHECK:STDERR: package Geometry impl; // CHECK:STDERR: ^~~~ package Geometry impl; diff --git a/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon b/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon index 0a2cfd23dd267..d8bcd0dd0d0ec 100644 --- a/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon +++ b/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon fn F() -> i32 { - // CHECK:STDERR: fail_pointer_type_in_expr.carbon:[[@LINE+3]]:14: ERROR: Parentheses are required to disambiguate operator precedence. + // CHECK:STDERR: fail_pointer_type_in_expr.carbon:[[@LINE+3]]:14: error: parentheses are required to disambiguate operator precedence // CHECK:STDERR: return *i32*; // CHECK:STDERR: ^ return *i32*; diff --git a/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon b/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon index 41461008893a1..9187356598555 100644 --- a/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon +++ b/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon @@ -9,49 +9,49 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon fn F() { - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:6: ERROR: Expected expression. + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:6: error: expected expression // CHECK:STDERR: x.(); // CHECK:STDERR: ^ // CHECK:STDERR: x.(); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: ERROR: Expected `)`. + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected `)` // CHECK:STDERR: y.(1,); // CHECK:STDERR: ^ // CHECK:STDERR: y.(1,); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: ERROR: Expected `)`. + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected `)` // CHECK:STDERR: z.(a, b); // CHECK:STDERR: ^ // CHECK:STDERR: z.(a, b); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: ERROR: Expected `)`. + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)` // CHECK:STDERR: w.(c d e ()); // CHECK:STDERR: ^ // CHECK:STDERR: w.(c d e ()); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: ERROR: Expected expression. + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected expression // CHECK:STDERR: v->(); // CHECK:STDERR: ^ // CHECK:STDERR: v->(); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: ERROR: Expected `)`. + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)` // CHECK:STDERR: u->(f,); // CHECK:STDERR: ^ // CHECK:STDERR: u->(f,); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: ERROR: Expected `)`. + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)` // CHECK:STDERR: t->(2, 3); // CHECK:STDERR: ^ // CHECK:STDERR: t->(2, 3); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+3]]:9: ERROR: Expected `)`. + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+3]]:9: error: expected `)` // CHECK:STDERR: s->(g h i ()); // CHECK:STDERR: ^ s->(g h i ()); diff --git a/toolchain/parse/testdata/return/fail_expr_no_semi.carbon b/toolchain/parse/testdata/return/fail_expr_no_semi.carbon index a7c98efb1741e..c91c8678d75df 100644 --- a/toolchain/parse/testdata/return/fail_expr_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_expr_no_semi.carbon @@ -10,7 +10,7 @@ fn F() { return x -// CHECK:STDERR: fail_expr_no_semi.carbon:[[@LINE+3]]:1: ERROR: `return` statements must end with a `;`. +// CHECK:STDERR: fail_expr_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/return/fail_no_semi.carbon b/toolchain/parse/testdata/return/fail_no_semi.carbon index 2b0e20bd77fb1..804d57e01bf5b 100644 --- a/toolchain/parse/testdata/return/fail_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_no_semi.carbon @@ -10,11 +10,11 @@ fn F() { return -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+7]]:1: ERROR: Expected expression. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+7]]:1: error: expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:1: ERROR: `return` statements must end with a `;`. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/return/fail_returned_no_var.carbon b/toolchain/parse/testdata/return/fail_returned_no_var.carbon index 384736c975fd3..007290f0c0b8e 100644 --- a/toolchain/parse/testdata/return/fail_returned_no_var.carbon +++ b/toolchain/parse/testdata/return/fail_returned_no_var.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/return/fail_returned_no_var.carbon fn F() -> String { - // CHECK:STDERR: fail_returned_no_var.carbon:[[@LINE+3]]:12: ERROR: Expected `var` after `returned`. + // CHECK:STDERR: fail_returned_no_var.carbon:[[@LINE+3]]:12: error: expected `var` after `returned` // CHECK:STDERR: returned fn G() -> i32; // CHECK:STDERR: ^~ returned fn G() -> i32; diff --git a/toolchain/parse/testdata/return/fail_var_no_semi.carbon b/toolchain/parse/testdata/return/fail_var_no_semi.carbon index 08ef701a1d7e6..5bda394838470 100644 --- a/toolchain/parse/testdata/return/fail_var_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_var_no_semi.carbon @@ -10,7 +10,7 @@ fn F() { return var -// CHECK:STDERR: fail_var_no_semi.carbon:[[@LINE+3]]:1: ERROR: `return` statements must end with a `;`. +// CHECK:STDERR: fail_var_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/struct/fail_comma_only.carbon b/toolchain/parse/testdata/struct/fail_comma_only.carbon index 0d5a5faba461a..dbe52a09dd6fa 100644 --- a/toolchain/parse/testdata/struct/fail_comma_only.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_only.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_only.carbon -// CHECK:STDERR: fail_comma_only.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`. +// CHECK:STDERR: fail_comma_only.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {,} = {}; // CHECK:STDERR: ^ var x: {,} = {}; diff --git a/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon b/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon index c397cf2222b98..f942e44bd1324 100644 --- a/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon -// CHECK:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+3]]:17: ERROR: Expected `.field: field_type`. +// CHECK:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+3]]:17: error: expected `.field: field_type` // CHECK:STDERR: var x: {.a: i32,,} = {}; // CHECK:STDERR: ^ var x: {.a: i32,,} = {}; diff --git a/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon b/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon index e243437786624..a3d80938583e6 100644 --- a/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon -// CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: ERROR: Expected `.field = value`. +// CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: error: expected `.field = value` // CHECK:STDERR: var x: {.a = 0,,} = {}; // CHECK:STDERR: ^ var x: {.a = 0,,} = {}; diff --git a/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon b/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon index 1534f3fd171d9..4a7112875c5fd 100644 --- a/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon +++ b/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon -// CHECK:STDERR: fail_extra_token_in_type.carbon:[[@LINE+3]]:17: ERROR: Expected `,` or `}`. +// CHECK:STDERR: fail_extra_token_in_type.carbon:[[@LINE+3]]:17: error: expected `,` or `}` // CHECK:STDERR: var x: {.a: i32 banana} = {.a = 0}; // CHECK:STDERR: ^~~~~~ var x: {.a: i32 banana} = {.a = 0}; diff --git a/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon b/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon index fad657d3e6b0d..a79a0f21ea60a 100644 --- a/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon +++ b/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon -// CHECK:STDERR: fail_extra_token_in_value.carbon:[[@LINE+3]]:28: ERROR: Expected `,` or `}`. +// CHECK:STDERR: fail_extra_token_in_value.carbon:[[@LINE+3]]:28: error: expected `,` or `}` // CHECK:STDERR: var x: {.a: i32} = {.a = 0 banana}; // CHECK:STDERR: ^~~~~~ var x: {.a: i32} = {.a = 0 banana}; diff --git a/toolchain/parse/testdata/struct/fail_identifier_colon.carbon b/toolchain/parse/testdata/struct/fail_identifier_colon.carbon index 22ab8783af809..62dcc40674002 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_colon.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_colon.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_colon.carbon -// CHECK:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`. +// CHECK:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {a:} = {}; // CHECK:STDERR: ^ var x: {a:} = {}; diff --git a/toolchain/parse/testdata/struct/fail_identifier_equals.carbon b/toolchain/parse/testdata/struct/fail_identifier_equals.carbon index cf7c8592cd7c0..46ff9769cbf7e 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_equals.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_equals.carbon -// CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`. +// CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {a=} = {}; // CHECK:STDERR: ^ var x: {a=} = {}; diff --git a/toolchain/parse/testdata/struct/fail_identifier_only.carbon b/toolchain/parse/testdata/struct/fail_identifier_only.carbon index 10a5d8b4692ba..375f9342be93d 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_only.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_only.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_only.carbon -// CHECK:STDERR: fail_identifier_only.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`. +// CHECK:STDERR: fail_identifier_only.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {a} = {}; // CHECK:STDERR: ^ var x: {a} = {}; diff --git a/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon b/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon index c2c5c6a3cd8ea..36da1916eec44 100644 --- a/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon +++ b/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon -// CHECK:STDERR: fail_invalid_struct_designator.carbon:[[@LINE+3]]:16: ERROR: Expected identifier after `.`. +// CHECK:STDERR: fail_invalid_struct_designator.carbon:[[@LINE+3]]:16: error: expected identifier after `.` // CHECK:STDERR: var x: i32 = {.7 = 8}; // CHECK:STDERR: ^ var x: i32 = {.7 = 8}; diff --git a/toolchain/parse/testdata/struct/fail_missing_type.carbon b/toolchain/parse/testdata/struct/fail_missing_type.carbon index 068ff69ba78f8..491810ef6b2d1 100644 --- a/toolchain/parse/testdata/struct/fail_missing_type.carbon +++ b/toolchain/parse/testdata/struct/fail_missing_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_missing_type.carbon -// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:12: ERROR: Expected expression. +// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:12: error: expected expression // CHECK:STDERR: var x: {.a:} = {}; // CHECK:STDERR: ^ var x: {.a:} = {}; diff --git a/toolchain/parse/testdata/struct/fail_missing_value.carbon b/toolchain/parse/testdata/struct/fail_missing_value.carbon index 206dc980c197f..ac41cea752488 100644 --- a/toolchain/parse/testdata/struct/fail_missing_value.carbon +++ b/toolchain/parse/testdata/struct/fail_missing_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_missing_value.carbon -// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:12: ERROR: Expected expression. +// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:12: error: expected expression // CHECK:STDERR: var x: {.a=} = {}; // CHECK:STDERR: ^ var x: {.a=} = {}; diff --git a/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon b/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon index f030a50224bd8..78c0bb4d0ba56 100644 --- a/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon -// CHECK:STDERR: fail_mix_type_and_value.carbon:[[@LINE+3]]:21: ERROR: Expected `.field: field_type`. +// CHECK:STDERR: fail_mix_type_and_value.carbon:[[@LINE+3]]:21: error: expected `.field: field_type` // CHECK:STDERR: var x: {.a: i32, .b = 0} = {}; // CHECK:STDERR: ^ var x: {.a: i32, .b = 0} = {}; diff --git a/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon b/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon index a243648fe6492..73c9270cd97f7 100644 --- a/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon -// CHECK:STDERR: fail_mix_value_and_type.carbon:[[@LINE+3]]:17: ERROR: Expected `.field = value`. +// CHECK:STDERR: fail_mix_value_and_type.carbon:[[@LINE+3]]:17: error: expected `.field = value` // CHECK:STDERR: var x: {.a = 0, b: i32} = {}; // CHECK:STDERR: ^ var x: {.a = 0, b: i32} = {}; diff --git a/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon b/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon index 382e59a2a9d6a..836dfc2935c52 100644 --- a/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon @@ -8,21 +8,21 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+8]]:25: ERROR: Expected `.field = value`. +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+8]]:25: error: expected `.field = value` // CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32}; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+4]]:29: ERROR: Expected `.field = value`. +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+4]]:29: error: expected `.field = value` // CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32}; // CHECK:STDERR: ^ // CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32}; -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+7]]:26: ERROR: Expected `.field: field_type`. +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+7]]:26: error: expected `.field: field_type` // CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:31: ERROR: Expected `.field: field_type`. +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:31: error: expected `.field: field_type` // CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDERR: ^ var x: i32 = {.a: i32, .b, .c = 1}; diff --git a/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon b/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon index 642ba026e84fc..4fc06e2372e8c 100644 --- a/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon -// CHECK:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+3]]:11: ERROR: Expected `.field: field_type` or `.field = value`. +// CHECK:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+3]]:11: error: expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {.a} = {}; // CHECK:STDERR: ^ var x: {.a} = {}; diff --git a/toolchain/parse/testdata/struct/fail_period_only.carbon b/toolchain/parse/testdata/struct/fail_period_only.carbon index 7b491126689e3..e953de6760d13 100644 --- a/toolchain/parse/testdata/struct/fail_period_only.carbon +++ b/toolchain/parse/testdata/struct/fail_period_only.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_only.carbon -// CHECK:STDERR: fail_period_only.carbon:[[@LINE+3]]:10: ERROR: Expected identifier after `.`. +// CHECK:STDERR: fail_period_only.carbon:[[@LINE+3]]:10: error: expected identifier after `.` // CHECK:STDERR: var x: {.} = {}; // CHECK:STDERR: ^ var x: {.} = {}; diff --git a/toolchain/parse/testdata/struct/fail_period_paren.carbon b/toolchain/parse/testdata/struct/fail_period_paren.carbon index 0d2d121cc9f18..0d4ef238394aa 100644 --- a/toolchain/parse/testdata/struct/fail_period_paren.carbon +++ b/toolchain/parse/testdata/struct/fail_period_paren.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_paren.carbon -// CHECK:STDERR: fail_period_paren.carbon:[[@LINE+3]]:10: ERROR: Expected identifier after `.`. +// CHECK:STDERR: fail_period_paren.carbon:[[@LINE+3]]:10: error: expected identifier after `.` // CHECK:STDERR: var x: {.(a) = 1}; // CHECK:STDERR: ^ var x: {.(a) = 1}; diff --git a/toolchain/parse/testdata/struct/fail_period_string_colon.carbon b/toolchain/parse/testdata/struct/fail_period_string_colon.carbon index b0be9b6a1887a..07aa55e7b4c1e 100644 --- a/toolchain/parse/testdata/struct/fail_period_string_colon.carbon +++ b/toolchain/parse/testdata/struct/fail_period_string_colon.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_string_colon.carbon -// CHECK:STDERR: fail_period_string_colon.carbon:[[@LINE+3]]:10: ERROR: Expected identifier after `.`. +// CHECK:STDERR: fail_period_string_colon.carbon:[[@LINE+3]]:10: error: expected identifier after `.` // CHECK:STDERR: var x: {."hello": i32, .y: i32} = {}; // CHECK:STDERR: ^~~~~~~ var x: {."hello": i32, .y: i32} = {}; diff --git a/toolchain/parse/testdata/struct/fail_period_string_equals.carbon b/toolchain/parse/testdata/struct/fail_period_string_equals.carbon index 41484b8c8dcda..15b7152c87989 100644 --- a/toolchain/parse/testdata/struct/fail_period_string_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_period_string_equals.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_string_equals.carbon -// CHECK:STDERR: fail_period_string_equals.carbon:[[@LINE+3]]:10: ERROR: Expected identifier after `.`. +// CHECK:STDERR: fail_period_string_equals.carbon:[[@LINE+3]]:10: error: expected identifier after `.` // CHECK:STDERR: var x: {."hello" = 0, .y = 4} = {}; // CHECK:STDERR: ^~~~~~~ var x: {."hello" = 0, .y = 4} = {}; diff --git a/toolchain/parse/testdata/struct/fail_type_no_designator.carbon b/toolchain/parse/testdata/struct/fail_type_no_designator.carbon index a5a322b2f8ecd..575a8d64701a0 100644 --- a/toolchain/parse/testdata/struct/fail_type_no_designator.carbon +++ b/toolchain/parse/testdata/struct/fail_type_no_designator.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_type_no_designator.carbon -// CHECK:STDERR: fail_type_no_designator.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`. +// CHECK:STDERR: fail_type_no_designator.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {i32} = {}; // CHECK:STDERR: ^~~ var x: {i32} = {}; diff --git a/toolchain/parse/testdata/var/fail_bad_name.carbon b/toolchain/parse/testdata/var/fail_bad_name.carbon index 0610bf5639b48..56ca252554804 100644 --- a/toolchain/parse/testdata/var/fail_bad_name.carbon +++ b/toolchain/parse/testdata/var/fail_bad_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/var/fail_bad_name.carbon -// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error: expected name in binding pattern // CHECK:STDERR: var *; // CHECK:STDERR: ^ var *; diff --git a/toolchain/parse/testdata/var/fail_empty.carbon b/toolchain/parse/testdata/var/fail_empty.carbon index 99402577d6a3d..412b97118f533 100644 --- a/toolchain/parse/testdata/var/fail_empty.carbon +++ b/toolchain/parse/testdata/var/fail_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/var/fail_empty.carbon -// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error: expected name in binding pattern // CHECK:STDERR: var; // CHECK:STDERR: ^ var; diff --git a/toolchain/parse/testdata/var/fail_no_semi.carbon b/toolchain/parse/testdata/var/fail_no_semi.carbon index 8daed5a8732e3..ffb4a0dfc0d1a 100644 --- a/toolchain/parse/testdata/var/fail_no_semi.carbon +++ b/toolchain/parse/testdata/var/fail_no_semi.carbon @@ -10,11 +10,11 @@ var -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: ERROR: Expected name in binding pattern. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error: expected name in binding pattern // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: ERROR: `var` declarations must end with a `;`. +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error: `var` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/where_expr/designators.carbon b/toolchain/parse/testdata/where_expr/designators.carbon index 9095bcb4112a1..ae3c257cf96e4 100644 --- a/toolchain/parse/testdata/where_expr/designators.carbon +++ b/toolchain/parse/testdata/where_expr/designators.carbon @@ -18,7 +18,7 @@ fn Success() { // --- fail_numeric_designator.carbon fn FailNumeric() { - // CHECK:STDERR: fail_numeric_designator.carbon:[[@LINE+4]]:4: ERROR: Expected identifier or `Self` after `.`. + // CHECK:STDERR: fail_numeric_designator.carbon:[[@LINE+4]]:4: error: expected identifier or `Self` after `.` // CHECK:STDERR: .1; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -28,7 +28,7 @@ fn FailNumeric() { // --- fail_keyword_designator.carbon fn FailKeyword() { - // CHECK:STDERR: fail_keyword_designator.carbon:[[@LINE+4]]:4: ERROR: Expected identifier or `Self` after `.`. + // CHECK:STDERR: fail_keyword_designator.carbon:[[@LINE+4]]:4: error: expected identifier or `Self` after `.` // CHECK:STDERR: .base; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -38,7 +38,7 @@ fn FailKeyword() { // --- fail_empty_designator.carbon fn FailEmpty() { - // CHECK:STDERR: fail_empty_designator.carbon:[[@LINE+4]]:4: ERROR: Expected identifier or `Self` after `.`. + // CHECK:STDERR: fail_empty_designator.carbon:[[@LINE+4]]:4: error: expected identifier or `Self` after `.` // CHECK:STDERR: .; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -48,7 +48,7 @@ fn FailEmpty() { // --- fail_star_designator.carbon fn FailStar() { - // CHECK:STDERR: fail_star_designator.carbon:[[@LINE+4]]:4: ERROR: Expected identifier or `Self` after `.`. + // CHECK:STDERR: fail_star_designator.carbon:[[@LINE+4]]:4: error: expected identifier or `Self` after `.` // CHECK:STDERR: .*; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -59,11 +59,11 @@ fn FailStar() { var x: i32 = . -// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+93]]:21: ERROR: Expected identifier or `Self` after `.`. +// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+93]]:21: error: expected identifier or `Self` after `.` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+89]]:21: ERROR: `var` declarations must end with a `;`. +// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+89]]:21: error: `var` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: designator.carbon diff --git a/toolchain/parse/testdata/where_expr/fail_rewrite.carbon b/toolchain/parse/testdata/where_expr/fail_rewrite.carbon index 81cc9b5edc3dd..911d60b971299 100644 --- a/toolchain/parse/testdata/where_expr/fail_rewrite.carbon +++ b/toolchain/parse/testdata/where_expr/fail_rewrite.carbon @@ -13,7 +13,7 @@ // --- fail_not_designator.carbon -// CHECK:STDERR: fail_not_designator.carbon:[[@LINE+4]]:37: ERROR: Requirement can only use `=` after `.member` designator. +// CHECK:STDERR: fail_not_designator.carbon:[[@LINE+4]]:37: error: requirement can only use `=` after `.member` designator // CHECK:STDERR: fn NotDesignator(T:! type where i32 = .U); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -21,7 +21,7 @@ fn NotDesignator(T:! type where i32 = .U); // --- fail_designator_in_parens.carbon -// CHECK:STDERR: fail_designator_in_parens.carbon:[[@LINE+4]]:40: ERROR: Requirement can only use `=` after `.member` designator. +// CHECK:STDERR: fail_designator_in_parens.carbon:[[@LINE+4]]:40: error: requirement can only use `=` after `.member` designator // CHECK:STDERR: fn DesignatorInParens(V:! I where (.J) = bool); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -29,7 +29,7 @@ fn DesignatorInParens(V:! I where (.J) = bool); // --- fail_dot_self.carbon -// CHECK:STDERR: fail_dot_self.carbon:[[@LINE+4]]:30: ERROR: Requirement can only use `=` after `.member` designator. +// CHECK:STDERR: fail_dot_self.carbon:[[@LINE+4]]:30: error: requirement can only use `=` after `.member` designator // CHECK:STDERR: fn DotSelf(W:! K where .Self = f32); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -37,7 +37,7 @@ fn DotSelf(W:! K where .Self = f32); // --- fail_dot_keyword.carbon -// CHECK:STDERR: fail_dot_keyword.carbon:[[@LINE+4]]:28: ERROR: Expected identifier or `Self` after `.`. +// CHECK:STDERR: fail_dot_keyword.carbon:[[@LINE+4]]:28: error: expected identifier or `Self` after `.` // CHECK:STDERR: fn DotKeyword(W:! K where .and = u8); // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -45,7 +45,7 @@ fn DotKeyword(W:! K where .and = u8); // --- fail_postfix_after_designator.carbon -// CHECK:STDERR: fail_postfix_after_designator.carbon:[[@LINE+4]]:43: ERROR: Requirement can only use `=` after `.member` designator. +// CHECK:STDERR: fail_postfix_after_designator.carbon:[[@LINE+4]]:43: error: requirement can only use `=` after `.member` designator // CHECK:STDERR: fn PostfixAfterDesignator(X:! L where .M* = u64*); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -53,7 +53,7 @@ fn PostfixAfterDesignator(X:! L where .M* = u64*); // --- fail_binary_op_after_designator.carbon -// CHECK:STDERR: fail_binary_op_after_designator.carbon:[[@LINE+4]]:48: ERROR: Requirement can only use `=` after `.member` designator. +// CHECK:STDERR: fail_binary_op_after_designator.carbon:[[@LINE+4]]:48: error: requirement can only use `=` after `.member` designator // CHECK:STDERR: fn BinaryOpAfterDesignator(Y:! N where .O + .P = {}); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -61,7 +61,7 @@ fn BinaryOpAfterDesignator(Y:! N where .O + .P = {}); // --- fail_after_and.carbon -// CHECK:STDERR: fail_after_and.carbon:[[@LINE+3]]:43: ERROR: Requirement can only use `=` after `.member` designator. +// CHECK:STDERR: fail_after_and.carbon:[[@LINE+3]]:43: error: requirement can only use `=` after `.member` designator // CHECK:STDERR: fn AfterAnd(Z:! Q where .R impls S and () = .A); // CHECK:STDERR: ^ fn AfterAnd(Z:! Q where .R impls S and () = .A); diff --git a/toolchain/parse/testdata/where_expr/where_and.carbon b/toolchain/parse/testdata/where_expr/where_and.carbon index b7e850d5dfe81..d528205493277 100644 --- a/toolchain/parse/testdata/where_expr/where_and.carbon +++ b/toolchain/parse/testdata/where_expr/where_and.carbon @@ -16,7 +16,7 @@ fn TwoAnd(Y:! I where .J impls K and .L == .M and .N = bool); // --- fail_and_prefix.carbon -// CHECK:STDERR: fail_and_prefix.carbon:[[@LINE+4]]:29: ERROR: Expected expression. +// CHECK:STDERR: fail_and_prefix.carbon:[[@LINE+4]]:29: error: expected expression // CHECK:STDERR: fn AndPrefix(T:! type where and .V == .W); // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -24,7 +24,7 @@ fn AndPrefix(T:! type where and .V == .W); // --- fail_and_suffix.carbon -// CHECK:STDERR: fail_and_suffix.carbon:[[@LINE+4]]:40: ERROR: Expected expression. +// CHECK:STDERR: fail_and_suffix.carbon:[[@LINE+4]]:40: error: expected expression // CHECK:STDERR: fn AndSuffix(Y:! I where .J impls K and); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -32,7 +32,7 @@ fn AndSuffix(Y:! I where .J impls K and); // --- fail_and_early.carbon -// CHECK:STDERR: fail_and_early.carbon:[[@LINE+3]]:28: ERROR: Requirement should use `impls`, `=`, or `==` operator. +// CHECK:STDERR: fail_and_early.carbon:[[@LINE+3]]:28: error: requirement should use `impls`, `=`, or `==` operator // CHECK:STDERR: fn AndEarly(Z:! L where .M and N); // CHECK:STDERR: ^~~ fn AndEarly(Z:! L where .M and N); diff --git a/toolchain/parse/testdata/while/fail_missing_cond.carbon b/toolchain/parse/testdata/while/fail_missing_cond.carbon index a4735ea8202c4..d8cd219a6aff4 100644 --- a/toolchain/parse/testdata/while/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/while/fail_missing_cond.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/while/fail_missing_cond.carbon fn F() { - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:9: ERROR: Expected `(` after `while`. + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:9: error: expected `(` after `while` // CHECK:STDERR: while { // CHECK:STDERR: ^ while { diff --git a/toolchain/parse/testdata/while/fail_no_semi.carbon b/toolchain/parse/testdata/while/fail_no_semi.carbon index db79b6567a5f7..f51349a009fcc 100644 --- a/toolchain/parse/testdata/while/fail_no_semi.carbon +++ b/toolchain/parse/testdata/while/fail_no_semi.carbon @@ -12,14 +12,14 @@ fn F() { while (a) { if (b) { break - // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:5: ERROR: `break` statements must end with a `;`. + // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:5: error: `break` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: } if (c) { continue - // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:5: ERROR: `continue` statements must end with a `;`. + // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:5: error: `continue` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/while/fail_unbraced.carbon b/toolchain/parse/testdata/while/fail_unbraced.carbon index 00c1156c5a335..38fc968b85932 100644 --- a/toolchain/parse/testdata/while/fail_unbraced.carbon +++ b/toolchain/parse/testdata/while/fail_unbraced.carbon @@ -11,7 +11,7 @@ fn F() { while (a) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:5: ERROR: Expected braced code block. + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:5: error: expected braced code block // CHECK:STDERR: break; // CHECK:STDERR: ^~~~~ break; diff --git a/toolchain/source/source_buffer.cpp b/toolchain/source/source_buffer.cpp index ee340385bc4af..9edfce557db37 100644 --- a/toolchain/source/source_buffer.cpp +++ b/toolchain/source/source_buffer.cpp @@ -36,14 +36,14 @@ auto SourceBuffer::MakeFromFile(llvm::vfs::FileSystem& fs, fs.openFileForRead(filename); if (file.getError()) { CARBON_DIAGNOSTIC(ErrorOpeningFile, Error, - "Error opening file for read: {0}", std::string); + "error opening file for read: {0}", std::string); emitter.Emit(filename, ErrorOpeningFile, file.getError().message()); return std::nullopt; } llvm::ErrorOr status = (*file)->status(); if (status.getError()) { - CARBON_DIAGNOSTIC(ErrorStattingFile, Error, "Error statting file: {0}", + CARBON_DIAGNOSTIC(ErrorStattingFile, Error, "error statting file: {0}", std::string); emitter.Emit(filename, ErrorStattingFile, file.getError().message()); return std::nullopt; @@ -68,7 +68,7 @@ auto SourceBuffer::MakeFromMemoryBuffer( DiagnosticEmitter emitter(converter, consumer); if (buffer.getError()) { - CARBON_DIAGNOSTIC(ErrorReadingFile, Error, "Error reading file: {0}", + CARBON_DIAGNOSTIC(ErrorReadingFile, Error, "error reading file: {0}", std::string); emitter.Emit(filename, ErrorReadingFile, buffer.getError().message()); return std::nullopt; @@ -76,7 +76,7 @@ auto SourceBuffer::MakeFromMemoryBuffer( if (buffer.get()->getBufferSize() >= std::numeric_limits::max()) { CARBON_DIAGNOSTIC(FileTooLarge, Error, - "File is over the 2GiB input limit; size is {0} bytes.", + "file is over the 2GiB input limit; size is {0} bytes", int64_t); emitter.Emit(filename, FileTooLarge, buffer.get()->getBufferSize()); return std::nullopt; From 50bce0c865800b62e8238cbf212a19efdb30e945 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 19 Sep 2024 17:25:15 -0700 Subject: [PATCH 7/8] Adopt new diagnostic conventions in handle_class.cpp (#4327) Doing this to a couple of diagnostics was suggested in review comments on #4320, so I've applied the suggestions across the whole file. --------- Co-authored-by: Jon Ross-Perkins --- toolchain/check/handle_class.cpp | 48 +++++++++---------- .../testdata/class/fail_adapt_bad_decl.carbon | 14 +++--- .../testdata/class/fail_adapt_bad_type.carbon | 2 +- .../class/fail_adapt_with_subobjects.carbon | 16 +++---- .../testdata/class/fail_base_bad_type.carbon | 10 ++-- .../testdata/class/fail_base_misplaced.carbon | 2 +- .../testdata/class/fail_base_modifiers.carbon | 2 +- .../testdata/class/fail_base_no_extend.carbon | 2 +- .../testdata/class/fail_base_repeated.carbon | 8 ++-- .../fail_redeclaration_introducer.carbon | 24 +++++----- toolchain/diagnostics/diagnostic_kind.def | 7 +-- 11 files changed, 68 insertions(+), 67 deletions(-) diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index ee0c6dbcb64bc..664c04a313aa0 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -79,9 +79,9 @@ static auto MergeClassRedecl(Context& context, SemIRLoc new_loc, // TODO: The rule here is not yet decided. See #3384. if (prev_class.inheritance_kind != new_class.inheritance_kind) { CARBON_DIAGNOSTIC(ClassRedeclarationDifferentIntroducer, Error, - "Class redeclared with different inheritance kind."); + "class redeclared with different inheritance kind"); CARBON_DIAGNOSTIC(ClassRedeclarationDifferentIntroducerPrevious, Note, - "Previously declared here."); + "previously declared here"); context.emitter() .Build(new_loc, ClassRedeclarationDifferentIntroducer) .Note(prev_loc, ClassRedeclarationDifferentIntroducerPrevious) @@ -322,8 +322,7 @@ static auto DiagnoseClassSpecificDeclOutsideClass(Context& context, SemIRLoc loc, Lex::TokenKind tok) -> void { CARBON_DIAGNOSTIC(ClassSpecificDeclOutsideClass, Error, - "`{0}` declaration can only be used in a class.", - Lex::TokenKind); + "`{0}` declaration outside class", Lex::TokenKind); context.emitter().Emit(loc, ClassSpecificDeclOutsideClass, tok); } @@ -345,16 +344,17 @@ static auto DiagnoseClassSpecificDeclRepeated(Context& context, SemIRLoc new_loc, SemIRLoc prev_loc, Lex::TokenKind tok) -> void { - CARBON_DIAGNOSTIC(ClassSpecificDeclRepeated, Error, - "Multiple `{0}` declarations in class.{1}", Lex::TokenKind, - std::string); - const llvm::StringRef extra = tok == Lex::TokenKind::Base - ? " Multiple inheritance is not permitted." - : ""; + CARBON_DIAGNOSTIC(AdaptDeclRepeated, Error, + "multiple `adapt` declarations in class"); + CARBON_DIAGNOSTIC(BaseDeclRepeated, Error, + "multiple `base` declarations in class; multiple " + "inheritance is not permitted"); CARBON_DIAGNOSTIC(ClassSpecificDeclPrevious, Note, - "Previous `{0}` declaration is here.", Lex::TokenKind); + "previous `{0}` declaration is here", Lex::TokenKind); + CARBON_CHECK(tok == Lex::TokenKind::Adapt || tok == Lex::TokenKind::Base); context.emitter() - .Build(new_loc, ClassSpecificDeclRepeated, tok, extra.str()) + .Build(new_loc, tok == Lex::TokenKind::Adapt ? AdaptDeclRepeated + : BaseDeclRepeated) .Note(prev_loc, ClassSpecificDeclPrevious, tok) .Emit(); } @@ -390,7 +390,7 @@ auto HandleParseNode(Context& context, Parse::AdaptDeclId node_id) -> bool { auto adapted_type_id = ExprAsType(context, node_id, adapted_type_expr_id); adapted_type_id = context.AsCompleteType(adapted_type_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInAdaptDecl, Error, - "Adapted type `{0}` is an incomplete type.", + "adapted type `{0}` is an incomplete type", SemIR::TypeId); return context.emitter().Build(node_id, IncompleteTypeInAdaptDecl, adapted_type_id); @@ -454,8 +454,8 @@ constexpr BaseInfo BaseInfo::Error = {.type_id = SemIR::TypeId::Error, static auto DiagnoseBaseIsFinal(Context& context, Parse::NodeId node_id, SemIR::TypeId base_type_id) -> void { CARBON_DIAGNOSTIC(BaseIsFinal, Error, - "Deriving from final type `{0}`. Base type must be an " - "`abstract` or `base` class.", + "deriving from final type `{0}`; base type must be an " + "`abstract` or `base` class", SemIR::TypeId); context.emitter().Emit(node_id, BaseIsFinal, base_type_id); } @@ -466,7 +466,7 @@ static auto CheckBaseType(Context& context, Parse::NodeId node_id, auto base_type_id = ExprAsType(context, node_id, base_expr_id); base_type_id = context.AsCompleteType(base_type_id, [&] { CARBON_DIAGNOSTIC(IncompleteTypeInBaseDecl, Error, - "Base `{0}` is an incomplete type.", SemIR::TypeId); + "base `{0}` is an incomplete type", SemIR::TypeId); return context.emitter().Build(node_id, IncompleteTypeInBaseDecl, base_type_id); }); @@ -505,7 +505,7 @@ auto HandleParseNode(Context& context, Parse::BaseDeclId node_id) -> bool { LimitModifiersOnDecl(context, introducer, KeywordModifierSet::Extend); if (!introducer.modifier_set.HasAnyOf(KeywordModifierSet::Extend)) { CARBON_DIAGNOSTIC(BaseMissingExtend, Error, - "Missing `extend` before `base` declaration in class."); + "missing `extend` before `base` declaration"); context.emitter().Emit(node_id, BaseMissingExtend); } @@ -570,23 +570,23 @@ static auto CheckCompleteAdapterClassType(Context& context, -> SemIR::InstId { const auto& class_info = context.classes().Get(class_id); if (class_info.base_id.is_valid()) { - CARBON_DIAGNOSTIC(AdaptWithBase, Error, - "Adapter cannot have a base class."); - CARBON_DIAGNOSTIC(AdaptBaseHere, Note, "`base` declaration is here."); + CARBON_DIAGNOSTIC(AdaptWithBase, Error, "adapter with base class"); + CARBON_DIAGNOSTIC(AdaptWithBaseHere, Note, "`base` declaration is here"); context.emitter() .Build(class_info.adapt_id, AdaptWithBase) - .Note(class_info.base_id, AdaptBaseHere) + .Note(class_info.base_id, AdaptWithBaseHere) .Emit(); return SemIR::InstId::BuiltinError; } if (!context.inst_blocks().Get(fields_id).empty()) { auto first_field_id = context.inst_blocks().Get(fields_id).front(); - CARBON_DIAGNOSTIC(AdaptWithFields, Error, "Adapter cannot have fields."); - CARBON_DIAGNOSTIC(AdaptFieldHere, Note, "First field declaration is here."); + CARBON_DIAGNOSTIC(AdaptWithFields, Error, "adapter with fields"); + CARBON_DIAGNOSTIC(AdaptWithFieldHere, Note, + "first field declaration is here"); context.emitter() .Build(class_info.adapt_id, AdaptWithFields) - .Note(first_field_id, AdaptFieldHere) + .Note(first_field_id, AdaptWithFieldHere) .Emit(); return SemIR::InstId::BuiltinError; } diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index cf58f8dbbb944..0f6a5da236d68 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -53,10 +53,10 @@ library "[[@TEST_NAME]]"; class MultipleAdapts { adapt (); - // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: Multiple `adapt` declarations in class. + // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: multiple `adapt` declarations in class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: Previous `adapt` declaration is here. + // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: previous `adapt` declaration is here // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -65,10 +65,10 @@ class MultipleAdapts { class MultipleAdaptsSameType { adapt (); - // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: Multiple `adapt` declarations in class. + // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: multiple `adapt` declarations in class // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: Previous `adapt` declaration is here. + // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: previous `adapt` declaration is here // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -79,14 +79,14 @@ class MultipleAdaptsSameType { library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:1: error: `adapt` declaration can only be used in a class. +// CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:1: error: `adapt` declaration outside class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: adapt {}; interface I { - // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:3: error: `adapt` declaration can only be used in a class. + // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:3: error: `adapt` declaration outside class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -95,7 +95,7 @@ interface I { class C { interface I { - // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+3]]:5: error: `adapt` declaration can only be used in a class. + // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+3]]:5: error: `adapt` declaration outside class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ adapt {}; diff --git a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon index 80da74081e279..4dbde4defbf41 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon @@ -15,7 +15,7 @@ library "[[@TEST_NAME]]"; class Incomplete; class AdaptIncomplete { - // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:3: error: Adapted type `Incomplete` is an incomplete type. + // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:3: error: adapted type `Incomplete` is an incomplete type // CHECK:STDERR: adapt Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-6]]:1: class was forward declared here diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index b00025a1949a4..61d748b6ca0ba 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -15,11 +15,11 @@ library "[[@TEST_NAME]]"; base class Base {} class AdaptWithBase { - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+3]]:3: error: Adapter cannot have a base class. + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+3]]:3: error: adapter with base class // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+4]]:3: `base` declaration is here. + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+4]]:3: `base` declaration is here // CHECK:STDERR: extend base: Base; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,11 +31,11 @@ class AdaptWithBase { library "[[@TEST_NAME]]"; class AdaptWithField { - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error: Adapter cannot have fields. + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error: adapter with fields // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: First field declaration is here. + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: first field declaration is here // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -43,11 +43,11 @@ class AdaptWithField { } class AdaptWithFields { - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error: Adapter cannot have fields. + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error: adapter with fields // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: First field declaration is here. + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: first field declaration is here // CHECK:STDERR: var a: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -65,10 +65,10 @@ base class Base {} class AdaptWithBaseAndFields { extend base: Base; var n: i32; - // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+6]]:3: error: Adapter cannot have a base class. + // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+6]]:3: error: adapter with base class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE-5]]:3: `base` declaration is here. + // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE-5]]:3: `base` declaration is here // CHECK:STDERR: extend base: Base; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ adapt {}; diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 0836614919aa8..902f337f55384 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -38,7 +38,7 @@ class DeriveFromNonType { fn AccessMemberWithInvalidBasNonType(p: DeriveFromNonType*) -> i32 { return (*p).n; } class DeriveFromi32 { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: Deriving from final type `i32`. Base type must be an `abstract` or `base` class. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: deriving from final type `i32`; base type must be an `abstract` or `base` class // CHECK:STDERR: extend base: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -59,7 +59,7 @@ fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } fn AccessMemberWithInvalidBasei32(p: DeriveFromi32*) -> i32 { return (*p).n; } class DeriveFromTuple { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: Deriving from final type `(Base,)`. Base type must be an `abstract` or `base` class. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: deriving from final type `(Base,)`; base type must be an `abstract` or `base` class // CHECK:STDERR: extend base: (Base,); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -80,7 +80,7 @@ fn AccessMemberWithInvalidBaseTuple(p: DeriveFromTuple*) -> i32 { return (*p).n; // TODO: Should we allow this? // We do allow `{.base = {.a: i32, .b: i32}}`. class DeriveFromStruct { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: Deriving from final type `{.a: i32, .b: i32}`. Base type must be an `abstract` or `base` class. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: deriving from final type `{.a: i32, .b: i32}`; base type must be an `abstract` or `base` class // CHECK:STDERR: extend base: {.a: i32, .b: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -102,7 +102,7 @@ fn AccessMemberWithInvalidBaseStruct(p: DeriveFromStruct*) -> i32 { return (*p). base class Incomplete; class DeriveFromIncomplete { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:16: error: Base `Incomplete` is an incomplete type. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+7]]:16: error: base `Incomplete` is an incomplete type // CHECK:STDERR: extend base: Incomplete; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE-6]]:1: class was forward declared here @@ -124,7 +124,7 @@ fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return fn AccessMemberWithInvalidBaseIncomplete(p: DeriveFromIncomplete*) -> i32 { return (*p).n; } class DeriveFromFinal { - // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: Deriving from final type `Final`. Base type must be an `abstract` or `base` class. + // CHECK:STDERR: fail_base_bad_type.carbon:[[@LINE+4]]:16: error: deriving from final type `Final`; base type must be an `abstract` or `base` class // CHECK:STDERR: extend base: Final; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_base_misplaced.carbon b/toolchain/check/testdata/class/fail_base_misplaced.carbon index 9164de8aee8a0..8885e7cdd68da 100644 --- a/toolchain/check/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/check/testdata/class/fail_base_misplaced.carbon @@ -10,7 +10,7 @@ base class B {} -// CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+4]]:1: error: `base` declaration can only be used in a class. +// CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+4]]:1: error: `base` declaration outside class // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index 95ed651eb30c9..1f11ea28495ad 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -23,7 +23,7 @@ class C2 { // CHECK:STDERR: abstract base: B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: error: Missing `extend` before `base` declaration in class. + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: error: missing `extend` before `base` declaration // CHECK:STDERR: abstract base: B; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/class/fail_base_no_extend.carbon b/toolchain/check/testdata/class/fail_base_no_extend.carbon index 00e25dc29a569..e72bedecfd0eb 100644 --- a/toolchain/check/testdata/class/fail_base_no_extend.carbon +++ b/toolchain/check/testdata/class/fail_base_no_extend.carbon @@ -11,7 +11,7 @@ base class B {} class C { - // CHECK:STDERR: fail_base_no_extend.carbon:[[@LINE+3]]:3: error: Missing `extend` before `base` declaration in class. + // CHECK:STDERR: fail_base_no_extend.carbon:[[@LINE+3]]:3: error: missing `extend` before `base` declaration // CHECK:STDERR: base: B; // CHECK:STDERR: ^~~~~~~~ base: B; diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index 9c1398e139b08..e446618bb3b46 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -13,10 +13,10 @@ base class B2 {} class C { extend base: B1; - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+7]]:3: error: Multiple `base` declarations in class. Multiple inheritance is not permitted. + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+7]]:3: error: multiple `base` declarations in class; multiple inheritance is not permitted // CHECK:STDERR: extend base: B2; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: Previous `base` declaration is here. + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: previous `base` declaration is here // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -26,10 +26,10 @@ class C { class D { // TODO: Consider adding a custom diagnostic for this case. extend base: B1; - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+6]]:3: error: Multiple `base` declarations in class. Multiple inheritance is not permitted. + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+6]]:3: error: multiple `base` declarations in class; multiple inheritance is not permitted // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: Previous `base` declaration is here. + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: previous `base` declaration is here // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ extend base: B1; diff --git a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon index 918e40a507b7f..217e1574bb589 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon @@ -13,10 +13,10 @@ library "[[@TEST_NAME]]"; class A; -// CHECK:STDERR: fail_add_base.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_add_base.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: base class A {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_add_base.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_add_base.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: class A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -27,10 +27,10 @@ base class A {} library "[[@TEST_NAME]]"; class B; -// CHECK:STDERR: fail_add_abstract.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_add_abstract.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: abstract class B {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_add_abstract.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_add_abstract.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: class B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -41,10 +41,10 @@ abstract class B {} library "[[@TEST_NAME]]"; base class C; -// CHECK:STDERR: fail_remove_base.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_remove_base.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_remove_base.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_remove_base.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: base class C; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -55,10 +55,10 @@ class C {} library "[[@TEST_NAME]]"; base class D; -// CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: abstract class D {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_base_to_abstract.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: base class D; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -69,10 +69,10 @@ abstract class D {} library "[[@TEST_NAME]]"; abstract class E; -// CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE+7]]:1: error: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE+7]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: class E {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_remove_abstract.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: abstract class E; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -83,10 +83,10 @@ class E {} library "[[@TEST_NAME]]"; abstract class F; -// CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE+6]]:1: error: Class redeclared with different inheritance kind. +// CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE+6]]:1: error: class redeclared with different inheritance kind // CHECK:STDERR: base class F {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE-4]]:1: Previously declared here. +// CHECK:STDERR: fail_abstract_to_base.carbon:[[@LINE-4]]:1: previously declared here // CHECK:STDERR: abstract class F; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ base class F {} diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index d512d265abc74..e01f3386d00df 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -202,10 +202,12 @@ CARBON_DIAGNOSTIC_KIND(UnknownBuiltinFunctionName) CARBON_DIAGNOSTIC_KIND(InvalidBuiltinSignature) // Class checking. +CARBON_DIAGNOSTIC_KIND(AdaptDeclRepeated) CARBON_DIAGNOSTIC_KIND(AdaptWithBase) CARBON_DIAGNOSTIC_KIND(AdaptWithFields) -CARBON_DIAGNOSTIC_KIND(AdaptBaseHere) -CARBON_DIAGNOSTIC_KIND(AdaptFieldHere) +CARBON_DIAGNOSTIC_KIND(AdaptWithBaseHere) +CARBON_DIAGNOSTIC_KIND(AdaptWithFieldHere) +CARBON_DIAGNOSTIC_KIND(BaseDeclRepeated) CARBON_DIAGNOSTIC_KIND(BaseIsFinal) CARBON_DIAGNOSTIC_KIND(BaseMissingExtend) CARBON_DIAGNOSTIC_KIND(ClassForwardDeclaredHere) @@ -213,7 +215,6 @@ CARBON_DIAGNOSTIC_KIND(ClassRedeclarationDifferentIntroducer) CARBON_DIAGNOSTIC_KIND(ClassRedeclarationDifferentIntroducerPrevious) CARBON_DIAGNOSTIC_KIND(ClassSpecificDeclOutsideClass) CARBON_DIAGNOSTIC_KIND(ClassSpecificDeclPrevious) -CARBON_DIAGNOSTIC_KIND(ClassSpecificDeclRepeated) CARBON_DIAGNOSTIC_KIND(ClassIncompleteWithinDefinition) CARBON_DIAGNOSTIC_KIND(ConstructionOfAbstractClass) From 864c8329719b12e5c116c6ca4a1eae5fbfc5cb81 Mon Sep 17 00:00:00 2001 From: CJ Johnson <6013273+CJ-Johnson@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:08:59 -0400 Subject: [PATCH 8/8] Lambdas (#3848) This document proposes a path forward to add lambdas to Carbon. It further proposes augmenting function declarations to create a more continuous syntax between the two categories of functions. In short, both lambdas and function declarations will be introduced with the `fn` keyword. The presence of a name distinguishes a function declaration from a lambda expression, and the rest of the syntax applies to both kinds. By providing a valid lambda syntax in Carbon, migration from from C++ to Carbon will be made easier and more idiomatic. In C++, lambdas are defined at their point of use and are often anonymous, meaning replacing them solely with function declarations would create an ergonomic burden compounded by the need for the migration tool to select a name. Associated discussion docs: * [Lambdas Discussion 1](https://docs.google.com/document/d/1rZ9SXL4Voa3z20EQz4UgBMOZg8xc8xzKqA1ufPQdTao/) * [Lambdas Discussion 2](https://docs.google.com/document/d/14K_YLjChWyyNv3wv5Mn7uLFHa0JZTc21v_WP8RzC8M4/) * [Lambdas Discussion 3](https://docs.google.com/document/d/1VVOlRuPGt8GQpjsygMwH2B7Wd0mBsS3Qif8Ve2yhX_A/) * [Lambdas Discussion 4](https://docs.google.com/document/d/1Sevhvjo06Bc6wTigNL1pK-mlF3IXvzmU1lI2X1W9OYA/) --------- Co-authored-by: Chandler Carruth Co-authored-by: Richard Smith --- proposals/p3848.md | 710 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 710 insertions(+) create mode 100644 proposals/p3848.md diff --git a/proposals/p3848.md b/proposals/p3848.md new file mode 100644 index 0000000000000..1083f5a03246c --- /dev/null +++ b/proposals/p3848.md @@ -0,0 +1,710 @@ +# Lambdas + + + +[Pull request](https://github.com/carbon-language/carbon-lang/pull/3848) + + + +## Table of contents + +- [Abstract](#abstract) +- [Syntax Overview](#syntax-overview) + - [Syntax Defined](#syntax-defined) +- [Introducer](#introducer) +- [Positional Parameters](#positional-parameters) + - [Positional Parameter Restrictions](#positional-parameter-restrictions) +- [Function Captures](#function-captures) + - [Capture Modes](#capture-modes) + - [Default Capture Mode](#default-capture-mode) +- [Function Fields](#function-fields) +- [Copy Semantics](#copy-semantics) +- [Self and Recursion](#self-and-recursion) +- [Rationale](#rationale) +- [Alternatives Considered](#alternatives-considered) + - [Alternative Considered: Terse vs Elaborated](#alternative-considered-terse-vs-elaborated) + - [Alternative Considered: Sigil](#alternative-considered-sigil) + - [Alternative Considered: Additional Positional Parameter Restriction](#alternative-considered-additional-positional-parameter-restriction) + - [Alternative Considered: Recursive Self](#alternative-considered-recursive-self) +- [Future Work](#future-work) + - [Future Work: Reference Captures](#future-work-reference-captures) + + + +## Abstract + +This document proposes a path forward to add lambdas to Carbon. It further +proposes augmenting function declarations to create a more continuous syntax +between the two categories of functions. In short, both lambdas and function +declarations will be introduced with the `fn` keyword. The presence of a name +distinguishes a function declaration from a lambda expression, and the rest of +the syntax applies to both kinds. By providing a valid lambda syntax in Carbon, +migration from from C++ to Carbon will be made easier and more idiomatic. In +C++, lambdas are defined at their point of use and are often anonymous, meaning +replacing them solely with function declarations would create an ergonomic +burden compounded by the need for the migration tool to select a name. + +Associated discussion docs: + +- [Lambdas Discussion 1](https://docs.google.com/document/d/1rZ9SXL4Voa3z20EQz4UgBMOZg8xc8xzKqA1ufPQdTao/) +- [Lambdas Discussion 2](https://docs.google.com/document/d/14K_YLjChWyyNv3wv5Mn7uLFHa0JZTc21v_WP8RzC8M4/) +- [Lambdas Discussion 3](https://docs.google.com/document/d/1VVOlRuPGt8GQpjsygMwH2B7Wd0mBsS3Qif8Ve2yhX_A/) +- [Lambdas Discussion 4](https://docs.google.com/document/d/1Sevhvjo06Bc6wTigNL1pK-mlF3IXvzmU1lI2X1W9OYA/) + +# Background + +Refer to the following documentation about lambdas in other languages. What +separates these three and makes them more analegous to Carbon's direction is the +use of "captures" such that the lambda has state, a lifetime, etc. + +- [Lambdas in C++](https://en.cppreference.com/w/cpp/language/lambda) +- [Closures in Swift](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/closures/) +- [Closures in Rust](https://doc.rust-lang.org/rust-by-example/fn/closures.html) + +## Syntax Overview + +**Proposal**: A largely continuous syntax between lambdas and function +declarations. + +At a high level, lambdas and function declarations will look like the following. + +``` +// In a variable: +let lambda: auto = fn => T.Make(); +// Equivalent in C++23: +// const auto lambda = [] { return T::Make(); }; + +// In a function call: +Foo(10, 20, fn => T.Make()); +// Equivalent in C++23: +// Foo(10, 20, [] { return T::Make(); }); +``` + +``` +// In a variable: +let lambda: auto = fn -> T { return T.Make(); }; +// Equivalent in C++23: +// const auto lambda = [] -> T { return T::Make(); }; + +// In a function call: +PushBack(my_list, fn => T.Make()); +// Equivalent in C++23: +// PushBack(my_list, [] { return T::Make(); }); +``` + +``` +fn FunctionDeclaration => T.Make(); +// Equivalent in C++23: +// auto FunctionDeclaration() { return T.Make(); } +``` + +``` +fn FunctionDeclaration -> T { return T.Make(); } +// Equivalent in C++23: +// auto FunctionDeclaration() -> T { return T::Make(); } +``` + +There are functions which return an expression, such that the return type is +`auto`. + +``` +// In a variable: +let lambda: auto = fn => T.Make(); +// Equivalent in C++23: +// const auto lambda = [] { return T::Make(); }; + +// In a function call: +Foo(fn => T.Make()); +// Equivalent in C++23: +// Foo([] { return T::Make(); }); +``` + +``` +fn FunctionDeclaration => T.Make(); +// Equivalent in C++23: +// auto FunctionDeclaration() { return T::Make(); } +``` + +And there are functions with an explicit return type that provide a body of +statements. + +``` +// In a variable: +let lambda: auto = fn -> T { return T.Make(); }; +// Equivalent in C++23: +// const auto lambda = [] -> T { return T::Make(); }; + +// In a function call: +Foo(fn -> T { return T.Make(); }) +// Equivalent in C++23: +// Foo([] -> T { return T::Make(); }); +``` + +``` +fn FunctionDeclaration -> T { return T.Make(); } +// Equivalent in C++23: +// auto FunctionDeclaration() -> T { return T::Make(); } +``` + +There are even functions that provide a body of statements but no return value. + +``` +// In a variable: +let lambda: auto = fn { Print(T.Make()); }; +// Equivalent in C++23: +// const auto lambda = [] -> void { Print(T::Make()); }; + +// In a function call: +Foo(fn { Print(T.Make()); }); +// Equivalent in C++23: +// Foo([] -> void { Print(T::Make()); }); +``` + +``` +fn FunctionDeclaration { Print(T.Make()); } +// Equivalent in C++23: +// auto FunctionDeclaration() -> void { Print(T::Make()); } +``` + +Functions support [captures](#function-captures), [fields](#function-fields) and +deduced parameters in the square brackets. In addition, `self: Self` or +`addr self: Self*` can be added to the square brackets of function declarations +that exist inside class or interface definitions. + +``` +fn Foo(x: i32) { + // In a variable: + let lambda: auto = fn [var x, var y: i32 = 0] { Print(++x, ++y); }; + // Equivalent in C++23: + // const auto lambda = [x, y = int32_t{0}] mutable -> void { Print(++x, ++y); }; + + // In a function call: + Foo(fn [var x, var y: i32 = 0] { Print(++x, ++y); }); + // Equivalent in C++23: + // Foo([x, y = int32_t{0}] mutable -> void { Print(++x, ++y); }); + + fn FunctionDeclaration[var x, var y: i32 = 0] { Print(++x, ++y); } + // Equivalent in C++23: + // auto FunctionDeclaration = [x, y = int32_t{0}] mutable -> void { Print(++x, ++y); }; +} +``` + +Functions also support so-called +["positional parameters"](#positional-parameters) that are defined at their +point of use using a dollar sign and a non-negative integer. They are implicitly +of type `auto`. + +``` +fn Foo() { + let lambda: auto = fn { Print($0); }; + // Equivalent in C++23: + // auto lambda = [](auto _0, auto...) -> void { Print(_0); }; + // Equivalent in Swift: + // let lambda = { Print($0) }; + + fn FunctionDeclaration { Print($0); } + // Equivalent in C++23: + // auto FunctionDeclaration = [](auto _0, auto...) -> void { Print(_0); }; + // Equivalent in Swift: + // let FunctionDeclaration = { Print($0) }; +} +``` + +Of course, functions can also have named parameters, but a single function can't +have both named and positional parameters. + +``` +fn Foo() { + // In a variable: + let lambda: auto = fn (v: auto) { Print(v); }; + // Equivalent in C++23: + // const auto lambda = [](v: auto) -> void { Print(v); }; + + // In a function call: + Foo(fn (v: auto) { Print(v); }); + // Equivalent in C++23: + // Foo([](v: auto) { Print(v); }); + + fn FunctionDeclaration(v: auto) { Print(v); } + // Equivalent in C++23: + // auto FunctionDeclaration(v: auto) -> void { Print(v); } +} +``` + +And in additional the option between positional and named parameters, deduced +parameters are always permitted. + +``` +fn Foo() { + let lambda: auto = fn [T:! Printable](t: T) { Print(t); }; + + fn FunctionDeclaration[T:! Printable](t: T) { Print(t); } +} +``` + +### Syntax Defined + +Function definitions and lambda expressions have one of the following syntactic +forms (where items in square brackets are optional and independent): + +`fn` \[_name_\] \[_implicit-parameters_\] \[_tuple-pattern_\] `=>` _expression_ +\[`;`\] + +`fn` \[_name_\] \[_implicit-parameters_\] \[_tuple-pattern_\] \[`->` +_return-type_\] `{` _statements_ `}` + +The first form is a shorthand for the second: "`=>` _expression_ `;`" is +equivalent to "`-> auto { return` _expression_ `; }`". + +_implicit-parameters_ consists of square brackets enclosing a optional default +capture mode and any number of explicit captures, function fields, and deduced +parameters, all separated by commas. The default capture mode (if any) must come +first; the other items can appear in any order. If _implicit-parameters_ is +omitted, it is equivalent to `[]`. + +The presence of _name_ determines whether this is a function definition or a +lambda expression. The trailing `;` in the first form is required for a function +definition, but is not part of the syntax of a lambda expression. + +The presence of _tuple-pattern_ determines whether the function body uses named +or positional parameters. + +The presence of "`->` _return-type_" determines whether the function body can +(and must) return a value. + +To understand how the syntax between lambdas and function declarations is +reasonably "continuous", refer to this table of syntactic positions and the +following code examples. + +| Syntactic Position | Syntax Allowed in Given Position (optional, unless otherwise stated) | +| :----------------: | :----------------------------------------------------------------------------------------------------------------: | +| A1 | Required Returned Expression ([positional parameters](#positional-parameters) allowed) | +| A2 | Required Returned Expression ([positional parameters](#positional-parameters) disallowed) | +| B | [Default Capture Mode](#default-capture-mode) | +| C | Explicit [Captures](#function-captures), [Function Fields](#function-fields) and Deduced Parameters (in any order) | +| D | Explicit Parameters | +| E1 | Body of Statements (no return value) ([positional parameters](#positional-parameters) allowed) | +| E2 | Body of Statements (with return value) ([positional parameters](#positional-parameters) allowed) | +| E3 | Body of Statements (no return value) ([positional parameters](#positional-parameters) disallowed) | +| E4 | Body of Statements (with return value) ([positional parameters](#positional-parameters) disallowed) | +| F | Required Return Type | +| G | Function Declaration Name | + +``` +// Lambdas (all the following are in an expression context and are +// themselves expressions) + +fn => A1 + +fn [B, C] => A1 + +fn (D) => A2 + +fn [B, C](D) => A2 + +fn { E1; } + +fn -> F { E2; } + +fn [B, C] { E1; } + +fn [B, C] -> F { E2; } + +fn (D) { E3; } + +fn (D) -> F { E4; } + +fn [B, C](D) { E3; } + +fn [B, C](D) -> F { E4; } +``` + +``` +// Function Declarations (all the following are allowed as statements in a +// function body or as declarations in other scopes) + +fn G => A1; + +fn G[B, C] => A1; + +fn G(D) => A2; + +fn G[B, C](D) => A2; + +fn G { E1; } + +fn G -> F { E2; } + +fn G[B, C] { E1; } + +fn G[B, C] -> F { E2; } + +fn G(D) { E3; } + +fn G(D) -> F { E4; } + +fn G[B, C](D) { E3; } + +fn G[B, C](D) -> F { E4; } +``` + +## Introducer + +**Proposal**: Introduce with the `fn` keyword to mirror function declarations. +If a statement or declaration begins with `fn`, a name is required and it +becomes a function declaration. Otherwise, if in an expression context, `fn` +introduces a lambda. + +``` +let lambda1: auto = fn => T.Make(); + +let lambda2: auto = fn -> T { return T.Make(); }; + +fn FunctionDeclaration1 => T.Make(); + +fn FunctionDeclaration2 -> T { return T.Make(); } +``` + +## Positional Parameters + +**Proposal**: Positional parameters, introduced in the body of a function by way +of the dollar sign and a corresponding non-negative parameter position integer +(ex: `$3`), are `auto` parameters to the function in which they are defined. +They can be used in any lambda or function declaration that lacks an explicit +parameter list (parentheses). They are variadic by design, meaning an unbounded +number of arguments can be passed to any function that lacks an explicit +parameter list. Only the parameters that are named in the body will be read +from, meaning the highest named parameter denotes the minimum number of +arguments required by the function. The function body is free to omit +lower-numbered parameters (ex: `fn { Print($10); }`). + +This syntax was inpsired by Swift's +[Shorthand Argument Names](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/closures/#Shorthand-Argument-Names). + +``` +// A lambda that takes two positional parameters being used as a comparator +Sort(my_list, fn => $0.val < $1.val); +// In Swift: { $0.val < $1.val } +``` + +### Positional Parameter Restrictions + +**Proposal**: There are two restrictions applied to functions with positional +parameters. The first restriction is that the definitions of function +declarations must be attached to the declarations. The second restriction is +that positional parameters can only be used in a context where there is exactly +one enclosing function without an explicit parameter list. For example... + +``` +fn Foo1 { + fn Bar1 {} // ❌ Invalid: Foo1 is already using positional parameters +} + +fn Foo2 { + Print($0); + fn Bar2 {} // ❌ Invalid: Foo2 is already using positional parameters +} + +fn Foo3 { + fn Bar3 { + Print($0); // ❌ Invalid: Foo3 is already using positional parameters + } +} + +fn Foo4() { + fn Bar4 { + Print($0); // ✅ Valid: Foo4 has explicit parameters + } +} + +fn Foo5 { + fn Bar5() {} // ✅ Valid: Bar5 has explicit parameters +} + +fn Foo6() { + my_list.Sort( + fn => $0 < $1 // ✅ Valid: Foo6 has explicit parameters + ); +} +``` + +## Function Captures + +**Proposal**: Function captures in Carbon mirror the non-init captures of C++. A +function capture declaration consists of a capture mode (for `var` captures) +followed by the name of a binding from the enclosing scope, and makes that +identifier available in the inner function body. The lifetime of a capture is +the lifetime of the function in which it exists. For example... + +``` +fn Foo() { + let handle: Handle = Handle.Get(); + var thread: Thread = Thread.Make(fn [var handle] { handle.Process(); }); + thread.Join(); +} +``` + +``` +fn Foo() { + let handle: Handle = Handle.Get(); + fn MyThread[handle]() { handle.Process(); } + var thread: Thread = Thread.Make(MyThread); + thread.Join(); +} +``` + +### Capture Modes + +**Proposal**: `let` and `var` can appear as function captures. They behave as +they would in regular bindings. + +To prevent ambiguities, captures can only exist on functions where the +definition is attached to the declaration. This means they are supported on +lambdas (which always exist in an expression context) and they are supported on +function declarations that are immediately defined inside the body of another +function (which is in a statement context), but they are not supported on +forward-declared functions nor are they supported as class members where +`self: Self` is permitted. + +Capture modes can be used as +[default capture mode specifiers](#default-capture-mode) or for explicit +captures as shown in the example code below. + +``` +fn Example { + var a: i32 = 0; + var b: i32 = 0; + + let lambda: auto = fn [a, var b] { + a += 1; // ❌ Invalid: by-value captures are immutable + + b += 1; // ✅ Valid: Modifies the captured copy of the by-object capture + }; + + lambda(); +} +``` + +``` +fn Example { + fn Invalid() -> auto { + var s: String = "Hello world"; + return fn [s]() => s; + } + + // ❌ Invalid: returned lambda references `s` which is no longer alive + // when the lambda is invoked. + Print(Invalid()()); +} +``` + +Note: If a function object F has mutable state, either because it has a +by-object capture or because it has a by-object function field, then a call to F +should require the callee to be a reference expression rather than a value +expression. We need a mutable handle to the function in order to be able to +mutate its mutable state. + +### Default Capture Mode + +**Proposal**: By default, there is no capturing in functions. The lack of any +square brackets is the same as an empty pair of square brackets. Users can opt +into capturing behavior. This is done either by way of individual explicit +captures, or more succinctly by way of a default capture mode. The default +capture mode roughly mirrors the syntax `[=]` and `[&]` capture modes from C++ +by being the first thing to appear in the square brackets. + +``` +fn Foo1() { + let handle: Handle = Handle.Get(); + fn MyThread[var]() { + handle.Process(); // `handle` is captured by-object due to the default capture + // mode specifier of `var` + } + var thread: Thread = Thread.Make(MyThread); + thread.Join(); +} + +fn Foo2() { + let handle: Handle = Handle.Get(); + fn MyThread[let]() { + handle.Process(); // `handle` is captured by-value due to the default capture + // mode specifier of `let` + } + var thread: Thread = Thread.Make(MyThread); + thread.Join(); +} +``` + +## Function Fields + +**Proposal**: Function fields mirror the behavior of init captures in C++. A +function field definition consists of an irrefutable pattern, `=`, and an +initializer. It matches the pattern with the initializer when the function +definition is evaluated. The bindings in the pattern have the same lifetime as +the function, and their scope extends to the end of the function body. + +To prevent ambiguities, function fields can only exist on functions where the +definition is attached to the declaration. This means they are supported on +lambdas (which always exist in an expression context) and they are supported on +function declarations that are immediately defined inside the body of another +function (which is in a statement context), but they are not supported on +forward-declared functions nor are they supported as class members where +`self: Self` is permitted. + +``` +fn Foo() { + var h1: Handle = Handle.Get(); + var h2: Handle = Handle.Get(); + var thread: Thread = Thread.Make(fn [a: auto = h1, var b: auto = h2] { + a.Process(); + b.Process(); + }); + thread.Join(); +} +``` + +## Copy Semantics + +**Proposal**: To mirror the behavior of C++, function declarations and lambdas +will be as copyable as their contained function fields and function captures. +This means that, if a function holds a by-object function field, if the type of +the field is copyable, so too is the function that contains it. This also +applies to captures. + +The other case is by-value function fields. Since C++ const references, when +made into fields of a class, prevent the class from being copied assigned, so +too should by-value function fields prevent the function in which it is +contained from being copied assigned. + +## Self and Recursion + +**Proposal**: To mirror C++'s use of capturing `this`, `self` should always come +from the outer scope as a capture. `self: Self` is never permitted on lambdas. +For function declarations, it is only permitted when the function is a member of +a class type or an interface, such that it refers to the class/interface and not +to the function itself. + +Note: Given the direction in +[#3720](https://github.com/carbon-language/carbon-lang/pull/3720), an expression +of the form `x.(F)`, where `F` is a function with a `self` or `addr self` +parameter, produces a callable that holds the value of `x`, and does not hold +the value of `F`. As a consequence, we can't support combining captures and +function fields with a `self` parameter. + +## Rationale + +Lambdas in Carbon serve two purposes. The primary purpose is in support of the +["Code that is easy to read, understand, and write"](/docs/project/goals.md#code-that-is-easy-to-read-understand-and-write) +goal. It is because of this goal that we leverage syntactic features such as the +returned expression (indicated by `=>`) and positional parameters (indicated by +the lack of a tuple pattern of explicit parameters as well as the use of `$N` in +the body of such functions). In addition, Lambdas serve to support the +[Interoperability with and migration from existing C++ code](/docs/project/goals.md#interoperability-with-and-migration-from-existing-c-code) +goal. They are defined at their point of use and are often anonymous, meaning +replacing C++ lambdas solely with function declarations will create an ergonomic +burden compounded by the need for the migration tool to select a name. + +## Alternatives Considered + +### Alternative Considered: Terse vs Elaborated + +Proposed above is a continuous syntax between lambdas and function declarations. +Alternatively, Carbon could adopt a few different categories of functions, as +was considered in a previous discussion doc +([Lambdas Discussion 2](https://docs.google.com/document/d/14K_YLjChWyyNv3wv5Mn7uLFHa0JZTc21v_WP8RzC8M4/)). +These categories would be terse lambdas, elaborated lambdas, and function +declarations. Unfortunately, separating these categories out presented a +syntactic challenge in the form of cliffs, explained below. As a result, they +were decided against. + +Terse lambdas were slated to be the most compact form of a lambda. Combined with +a [sigil introducer](#alternative-considered-sigil), they would be syntactically +minimal. One way in which syntax was minimized was the granting of an +**implicit** default [capture](#function-captures) mode. If no square brackets +were present, by-value captures would be allowed. This, combined with the lack +of an arrow to signify a return value, created syntax of the following form +(being passed into the filter function below). + +``` +let zero: i32 = 0; +let list_all: List(i32) = GetAllValues(); +let list_positive: List(i32) = list_all.Filter( + @ $0 > zero +); +``` + +To give users more control over the feature set in a lambda, the next step up +was an elaborated lambda. This provided the ability to add both square brackets +and explicit parameters to lambdas at the cost of more syntax. Unfortunately, +this also meant there was a bit of a _syntactic cliff_ and a stumbling block. It +was considered desirable for empty square brackets to mean capturing is +disabled. But since the no-square-brackets form needed to support capturing for +terse lambdas, elaborated lambdas needed to both add the square brackets and +also add an explicit default capture mode at the same time just to maintain the +existing capturing behavior. The net result was code that looked like the +following (being passed into the filter function again). + +``` +let zero: i32 = 0; +let list_all: List(i32) = GetAllValues(); +let list_positive: List(i32) = list_all.Filter( + @[let](x: auto) x > zero +); +``` + +Finally, if a user wanted to upgrade a lambda to a function declaration, this +created another cliff where they needed to switch from the sigil to the `fn` +keyword, on top of adding a name. Ultimately these downsides suggested that a +continuous syntax was the better path forward, despite the face that the +shortest spellable lambda would be a bit less terse than the alternative +considered. + +### Alternative Considered: Sigil + +Proposed above is the use of `fn` as the [introducer](#introducer) for all +functions/lambdas. An alternative considered was to tntroduce with a sigil, such +as `$` or `@`. Since introducer punctuation is such a scarce resource, and since +there was no consensus on what sigil would best represent a lambda, and since +there was a desire to create a more continuous syntax between lambdas and +function declarations, this alternative was decided against. It would have +looked like the following: + +``` +let lambda1: auto = @ => T.Make(); + +let lambda2: auto = @[]() -> T { return T.Make(); }; +``` + +### Alternative Considered: Additional Positional Parameter Restriction + +In addition to +[the above proposed restrictions](#positional-parameter-restrictions) to +positional parameters, an additional restriction was considered. That being, +visibility of functions with positional parameters could be restricted to only +non-public interfaces. This alternative was considered by way of a leads +question ([#3860](https://github.com/carbon-language/carbon-lang/issues/3860)) +and was decided against, with the speculation that such a restriction may be +enforced by way of an HOA rule as opposed to a compiler error. + +### Alternative Considered: Recursive Self + +Proposed above is a deliniation between function declarations that can provide a +`self` parameter and functions declarations (plus lambdas) which cannot. An +alternative was considered such that, for use in recursion, `self: Self` could +be permitted on all functions and lambdas and refer to the function itself. +Unfortunately, it created a bit of a discontinuity between class members and +non-class members and was thus decided against. + +## Future Work + +### Future Work: Reference Captures + +Much discussion has been had so far about the implications of capturing by +reference. For now, such behavior is supported not through captures but instead +through function fields formed from the address of an object in the outer scope. +It is **imperative** that more work be done in this area to address the +ergonomic concerns of the current solution.