diff --git a/core/BUILD b/core/BUILD new file mode 100644 index 000000000000..950ef71c0f5a --- /dev/null +++ b/core/BUILD @@ -0,0 +1,9 @@ +# 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 + +filegroup( + name = "core", + data = glob(["**/*.carbon"]), + visibility = ["//visibility:public"], +) diff --git a/core/prelude.carbon b/core/prelude.carbon new file mode 100644 index 000000000000..8ddac9a3371b --- /dev/null +++ b/core/prelude.carbon @@ -0,0 +1,13 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE + +package Core library "prelude" api; + +// TODO: Uncomment once name deduplication works. +// TODO: These are here for name lookup. Add a way to export import and move them out. +// fn Int32() -> type = "int.make_type_32"; +// fn Float(size: i32) -> type = "float.make_type"; +// fn Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index 25837f0635f5..555967d7fd10 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -1028,7 +1028,7 @@ static auto BuildApiMapAndDiagnosePackaging( } auto CheckParseTrees(const SemIR::File& builtin_ir, - llvm::MutableArrayRef units, + llvm::MutableArrayRef units, bool prelude_import, llvm::raw_ostream* vlog_stream) -> void { // Prepare diagnostic emitters in case we run into issues during package // checking. @@ -1047,17 +1047,31 @@ auto CheckParseTrees(const SemIR::File& builtin_ir, llvm::SmallVector ready_to_check; ready_to_check.reserve(units.size()); for (auto& unit_info : unit_infos) { - if (const auto& packaging = - unit_info.unit->parse_tree->packaging_directive()) { - if (packaging->api_or_impl == Parse::Tree::ApiOrImpl::Impl) { - // An `impl` has an implicit import of its `api`. - auto implicit_names = packaging->names; - implicit_names.package_id = IdentifierId::Invalid; - TrackImport(api_map, nullptr, unit_info, implicit_names); - } + const auto& packaging = unit_info.unit->parse_tree->packaging_directive(); + if (packaging && packaging->api_or_impl == Parse::Tree::ApiOrImpl::Impl) { + // An `impl` has an implicit import of its `api`. + auto implicit_names = packaging->names; + implicit_names.package_id = IdentifierId::Invalid; + TrackImport(api_map, nullptr, unit_info, implicit_names); } llvm::DenseMap explicit_import_map; + + // Add the prelude import. It's added to explicit_import_map so that it can + // conflict with an explicit import of the prelude. + // TODO: Add --no-prelude-import for `/no_prelude/` subdirs. + IdentifierId core_ident_id = + unit_info.unit->value_stores->identifiers().Add("Core"); + if (prelude_import && + !(packaging && packaging->names.package_id == core_ident_id)) { + auto prelude_id = + unit_info.unit->value_stores->string_literal_values().Add("prelude"); + TrackImport(api_map, &explicit_import_map, unit_info, + {.node_id = Parse::InvalidNodeId(), + .package_id = core_ident_id, + .library_id = prelude_id}); + } + for (const auto& import : unit_info.unit->parse_tree->imports()) { TrackImport(api_map, &explicit_import_map, unit_info, import); } diff --git a/toolchain/check/check.h b/toolchain/check/check.h index 2a4215d1296b..89c8c6543253 100644 --- a/toolchain/check/check.h +++ b/toolchain/check/check.h @@ -33,7 +33,7 @@ struct Unit { // Checks a group of parse trees. This will use imports to decide the order of // checking. auto CheckParseTrees(const SemIR::File& builtin_ir, - llvm::MutableArrayRef units, + llvm::MutableArrayRef units, bool prelude_import, llvm::raw_ostream* vlog_stream) -> void; } // namespace Carbon::Check diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 303a0fb75cbf..c9909d19ac92 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -180,11 +180,11 @@ auto Context::DiagnoseDuplicateName(SemIRLoc dup_def, SemIRLoc prev_def) .Emit(); } -auto Context::DiagnoseNameNotFound(SemIR::LocId loc_id, SemIR::NameId name_id) +auto Context::DiagnoseNameNotFound(SemIRLoc loc, SemIR::NameId name_id) -> void { CARBON_DIAGNOSTIC(NameNotFound, Error, "Name `{0}` not found.", SemIR::NameId); - emitter_->Emit(loc_id, NameNotFound, name_id); + emitter_->Emit(loc, NameNotFound, name_id); } auto Context::NoteIncompleteClass(SemIR::ClassId class_id, @@ -416,6 +416,58 @@ auto Context::LookupQualifiedName(Parse::NodeId node_id, SemIR::NameId name_id, return result_id; } +// Returns the scope of the Core package, or Invalid if it's not found. +// +// TODO: Consider tracking the Core package in SemIR so we don't need to use +// name lookup to find it. +static auto GetCorePackage(Context& context, SemIRLoc loc) + -> SemIR::NameScopeId { + auto core_ident_id = context.identifiers().Add("Core"); + auto packaging = context.parse_tree().packaging_directive(); + if (packaging && packaging->names.package_id == core_ident_id) { + return SemIR::NameScopeId::Package; + } + auto core_name_id = SemIR::NameId::ForIdentifier(core_ident_id); + + // Look up `package.Core`. + auto core_inst_id = context.LookupNameInExactScope( + loc, core_name_id, context.name_scopes().Get(SemIR::NameScopeId::Package), + /*mark_imports_used=*/true); + if (!core_inst_id.is_valid()) { + context.DiagnoseNameNotFound(loc, core_name_id); + return SemIR::NameScopeId::Invalid; + } + + // We expect it to be a namespace. + if (auto namespace_inst = + context.insts().TryGetAs(core_inst_id)) { + return namespace_inst->name_scope_id; + } + // TODO: This should really diagnose the name issue. + context.DiagnoseNameNotFound(loc, core_name_id); + return SemIR::NameScopeId::Invalid; +} + +auto Context::LookupNameInCore(SemIRLoc loc, llvm::StringRef name) + -> SemIR::InstId { + auto core_package_id = GetCorePackage(*this, loc); + if (!core_package_id.is_valid()) { + return SemIR::InstId::BuiltinError; + } + + auto name_id = SemIR::NameId::ForIdentifier(identifiers().Add(name)); + auto inst_id = + LookupNameInExactScope(loc, name_id, name_scopes().Get(core_package_id), + /*mark_imports_used=*/true); + if (!inst_id.is_valid()) { + DiagnoseNameNotFound(loc, name_id); + return SemIR::InstId::BuiltinError; + } + + // Look through import_refs and aliases. + return constant_values().Get(inst_id).inst_id(); +} + template static auto AddDominatedBlockAndBranchImpl(Context& context, Parse::NodeId node_id, Args... args) diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 86050141d048..8073fb4f617b 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -123,11 +123,15 @@ class Context { SemIR::NameScopeId scope_id, bool required = true) -> SemIR::InstId; + // Returns the instruction corresponding to a name in the core package, or + // BuiltinError if not found. + auto LookupNameInCore(SemIRLoc loc, llvm::StringRef name) -> SemIR::InstId; + // Prints a diagnostic for a duplicate name. auto DiagnoseDuplicateName(SemIRLoc dup_def, SemIRLoc prev_def) -> void; // Prints a diagnostic for a missing name. - auto DiagnoseNameNotFound(SemIR::LocId loc_id, SemIR::NameId name_id) -> void; + auto DiagnoseNameNotFound(SemIRLoc loc, SemIR::NameId name_id) -> void; // Adds a note to a diagnostic explaining that a class is incomplete. auto NoteIncompleteClass(SemIR::ClassId class_id, DiagnosticBuilder& builder) diff --git a/toolchain/check/handle_literal.cpp b/toolchain/check/handle_literal.cpp index 383b634ad326..92d0711e8618 100644 --- a/toolchain/check/handle_literal.cpp +++ b/toolchain/check/handle_literal.cpp @@ -2,6 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include "toolchain/check/call.h" #include "toolchain/check/context.h" namespace Carbon::Check { @@ -69,6 +70,10 @@ auto HandleStringLiteral(Context& context, Parse::StringLiteralId node_id) auto HandleBoolTypeLiteral(Context& context, Parse::BoolTypeLiteralId node_id) -> bool { + // TODO: Migrate once functions can be in prelude.carbon. + // auto fn_inst_id = context.LookupNameInCore(node_id, "Bool"); + // auto type_inst_id = PerformCall(context, node_id, fn_inst_id, {}); + // context.node_stack().Push(node_id, type_inst_id); context.node_stack().Push(node_id, SemIR::InstId::BuiltinBoolType); return true; } @@ -80,6 +85,10 @@ auto HandleIntTypeLiteral(Context& context, Parse::IntTypeLiteralId node_id) if (text != "i32") { return context.TODO(node_id, "Currently only i32 is allowed"); } + // TODO: Migrate once functions can be in prelude.carbon. + // auto fn_inst_id = context.LookupNameInCore(node_id, "Int32"); + // auto type_inst_id = PerformCall(context, node_id, fn_inst_id, {}); + // context.node_stack().Push(node_id, type_inst_id); context.node_stack().Push(node_id, SemIR::InstId::BuiltinIntType); return true; } @@ -97,6 +106,16 @@ auto HandleFloatTypeLiteral(Context& context, Parse::FloatTypeLiteralId node_id) if (text != "f64") { return context.TODO(node_id, "Currently only f64 is allowed"); } + // TODO: Migrate once functions can be in prelude.carbon. + // auto fn_inst_id = context.LookupNameInCore(node_id, "Float"); + // auto width_inst_id = context.AddInstInNoBlock( + // {node_id, + // SemIR::IntLiteral{ + // context.GetBuiltinType(SemIR::BuiltinKind::IntType), + // context.ints().Add(llvm::APInt(/*numBits=*/32, /*val=*/64))}}); + // auto type_inst_id = + // PerformCall(context, node_id, fn_inst_id, {width_inst_id}); + // context.node_stack().Push(node_id, type_inst_id); context.node_stack().Push(node_id, SemIR::InstId::BuiltinFloatType); return true; } diff --git a/toolchain/check/node_stack.h b/toolchain/check/node_stack.h index 2b442a5f87ac..02fa21b82020 100644 --- a/toolchain/check/node_stack.h +++ b/toolchain/check/node_stack.h @@ -502,7 +502,9 @@ class NodeStack { auto RequireIdKind(Parse::NodeKind parse_kind, Id::Kind id_kind) const -> void { CARBON_CHECK(NodeKindToIdKind(parse_kind) == id_kind) - << "Unexpected Id::Kind mapping for " << parse_kind; + << "Unexpected Id::Kind mapping for " << parse_kind << ": expected " + << static_cast(id_kind) << ", found " + << static_cast(NodeKindToIdKind(parse_kind)); } // Require an entry to have the given Parse::NodeKind. diff --git a/toolchain/check/operator.cpp b/toolchain/check/operator.cpp index 291fef60b9b7..1e33f24e41a5 100644 --- a/toolchain/check/operator.cpp +++ b/toolchain/check/operator.cpp @@ -12,65 +12,15 @@ namespace Carbon::Check { -// Returns the scope of the Core package, or Invalid if it's not found. -// -// TODO: Consider tracking the Core package in SemIR so we don't need to use -// name lookup to find it. -static auto GetCorePackage(Context& context, Parse::AnyExprId node_id) - -> SemIR::NameScopeId { - // TODO: If the current package is the `Core` package, return - // `SemIR::InstId::Package`. - - auto ident_id = context.identifiers().Lookup("Core"); - if (!ident_id.is_valid()) { - return SemIR::NameScopeId::Invalid; - } - auto name_id = SemIR::NameId::ForIdentifier(ident_id); - - // Look up `package.Core`. - auto package_id = context.LookupQualifiedName( - node_id, name_id, SemIR::NameScopeId::Package, /*required=*/false); - if (!package_id.is_valid()) { - return SemIR::NameScopeId::Invalid; - } - - // Look through import_refs and aliases. - package_id = context.constant_values().Get(package_id).inst_id(); - - // We expect it to be a package, and fail if not. - if (auto package_inst = - context.insts().TryGetAs(package_id)) { - auto& name_scope = context.name_scopes().Get(package_inst->name_scope_id); - // Check that this is really the `Core` package and not an alias. - if (name_scope.is_closed_import && name_scope.name_id == name_id && - name_scope.enclosing_scope_id == SemIR::NameScopeId::Package) { - return package_inst->name_scope_id; - } - } - return SemIR::NameScopeId::Invalid; -} - // Returns the name scope of the operator interface for the specified operator // from the Core package. static auto GetOperatorInterface(Context& context, Parse::AnyExprId node_id, Operator op) -> SemIR::NameScopeId { - auto carbon_package_id = GetCorePackage(context, node_id); - if (!carbon_package_id.is_valid()) { + auto interface_id = context.LookupNameInCore(node_id, op.interface_name); + if (interface_id == SemIR::InstId::BuiltinError) { return SemIR::NameScopeId::Invalid; } - // Lookup `Core.InterfaceName`. - auto interface_ident_id = context.identifiers().Add(op.interface_name); - auto interface_id = context.LookupQualifiedName( - node_id, SemIR::NameId::ForIdentifier(interface_ident_id), - carbon_package_id, /*required=*/false); - if (!interface_id.is_valid()) { - return SemIR::NameScopeId::Invalid; - } - - // Look through import_refs and aliases. - interface_id = context.constant_values().Get(interface_id).inst_id(); - // We expect it to be an interface. if (auto interface_inst = context.insts().TryGetAs(interface_id)) { @@ -110,7 +60,9 @@ auto BuildUnaryOperator(Context& context, Parse::AnyExprId node_id, Operator op, SemIR::InstId operand_id) -> SemIR::InstId { auto op_fn = GetOperatorOpFunction(context, node_id, op); if (!op_fn.is_valid()) { - context.TODO(node_id, "missing or invalid operator interface"); + context.TODO(node_id, + "missing or invalid operator interface, also avoid duplicate " + "diagnostic if prelude is unavailable"); return SemIR::InstId::BuiltinError; } diff --git a/toolchain/check/testdata/alias/alias_of_alias.carbon b/toolchain/check/testdata/alias/alias_of_alias.carbon index c8b98c53a870..e0689235b814 100644 --- a/toolchain/check/testdata/alias/alias_of_alias.carbon +++ b/toolchain/check/testdata/alias/alias_of_alias.carbon @@ -4,30 +4,57 @@ // // AUTOUPDATE -alias a = bool; +class C { var v: i32; } +alias a = C; alias b = a; alias c = b; -let d: c = false; +let d: c = {.v = 0}; // CHECK:STDOUT: --- alias_of_alias.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.1: bool = bool_literal false [template] +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = unbound_element_type C, i32 [template] +// CHECK:STDOUT: %.2: type = struct_type {.v: i32} [template] +// CHECK:STDOUT: %.3: type = ptr_type {.v: i32} [template] +// CHECK:STDOUT: %.4: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.5: C = struct_value (%.4) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } -// CHECK:STDOUT: %a: type = bind_alias a, bool [template = bool] -// CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = bool] -// CHECK:STDOUT: %b: type = bind_alias b, %a [template = bool] -// CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = bool] -// CHECK:STDOUT: %c: type = bind_alias c, %b [template = bool] -// CHECK:STDOUT: %c.ref: type = name_ref c, %c [template = bool] -// CHECK:STDOUT: %.loc10: bool = bool_literal false [template = constants.%.1] -// CHECK:STDOUT: %d: bool = bind_name d, %.loc10 +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a: type = bind_alias a, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = constants.%C] +// CHECK:STDOUT: %b: type = bind_alias b, %a [template = constants.%C] +// CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = constants.%C] +// CHECK:STDOUT: %c: type = bind_alias c, %b [template = constants.%C] +// CHECK:STDOUT: %c.ref: type = name_ref c, %c [template = constants.%C] +// CHECK:STDOUT: %.loc11_18: i32 = int_literal 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_19.1: {.v: i32} = struct_literal (%.loc11_18) +// CHECK:STDOUT: %.loc11_19.2: ref C = temporary_storage +// CHECK:STDOUT: %.loc11_19.3: ref i32 = class_element_access %.loc11_19.2, element0 +// CHECK:STDOUT: %.loc11_19.4: init i32 = initialize_from %.loc11_18 to %.loc11_19.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc11_19.5: init C = class_init (%.loc11_19.4), %.loc11_19.2 [template = constants.%.5] +// CHECK:STDOUT: %.loc11_19.6: ref C = temporary %.loc11_19.2, %.loc11_19.5 +// CHECK:STDOUT: %.loc11_19.7: ref C = converted %.loc11_19.1, %.loc11_19.6 +// CHECK:STDOUT: %.loc11_19.8: C = bind_value %.loc11_19.7 +// CHECK:STDOUT: %d: C = bind_name d, %.loc11_19.8 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc7: = field_decl v, element0 [template] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: .v = %.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/builtins.carbon b/toolchain/check/testdata/alias/builtins.carbon index 4f0b7861d755..d6188bddfa75 100644 --- a/toolchain/check/testdata/alias/builtins.carbon +++ b/toolchain/check/testdata/alias/builtins.carbon @@ -19,9 +19,11 @@ let b_test: b = false; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a: type = bind_alias a, i32 [template = i32] // CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = i32] // CHECK:STDOUT: %.loc8: i32 = int_literal 0 [template = constants.%.1] diff --git a/toolchain/check/testdata/alias/fail_aliased_name_in_diag.carbon b/toolchain/check/testdata/alias/fail_aliased_name_in_diag.carbon index ddf20949f795..f1c4d64fdf55 100644 --- a/toolchain/check/testdata/alias/fail_aliased_name_in_diag.carbon +++ b/toolchain/check/testdata/alias/fail_aliased_name_in_diag.carbon @@ -4,8 +4,9 @@ // // AUTOUPDATE -alias b = bool; -// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: ERROR: Cannot implicitly convert from `i32` to `bool`. +class C { var v: i32; } +alias b = C; +// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: ERROR: Cannot implicitly convert from `i32` to `C`. // CHECK:STDERR: let c: b = 2; // CHECK:STDERR: ^~~~~~~~~~~~~ let c: b = 2; @@ -13,16 +14,33 @@ let c: b = 2; // CHECK:STDOUT: --- fail_aliased_name_in_diag.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.1: i32 = int_literal 2 [template] +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = unbound_element_type C, i32 [template] +// CHECK:STDOUT: %.2: type = struct_type {.v: i32} [template] +// CHECK:STDOUT: %.3: type = ptr_type {.v: i32} [template] +// CHECK:STDOUT: %.4: i32 = int_literal 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %b: type = bind_alias b, bool [template = bool] -// CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = bool] -// CHECK:STDOUT: %.loc11: i32 = int_literal 2 [template = constants.%.1] -// CHECK:STDOUT: %c: bool = bind_name c, +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %b: type = bind_alias b, %C.decl [template = constants.%C] +// CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = constants.%C] +// CHECK:STDOUT: %.loc12: i32 = int_literal 2 [template = constants.%.4] +// CHECK:STDOUT: %c: C = bind_name c, +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc7: = field_decl v, element0 [template] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: .v = %.loc7 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/fail_bool_value.carbon b/toolchain/check/testdata/alias/fail_bool_value.carbon index f4843f5866e2..1255d44d9a61 100644 --- a/toolchain/check/testdata/alias/fail_bool_value.carbon +++ b/toolchain/check/testdata/alias/fail_bool_value.carbon @@ -18,8 +18,10 @@ let a_test: bool = a; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10: bool = bool_literal false [template = constants.%.1] // CHECK:STDOUT: %a: = bind_alias a, [template = ] // CHECK:STDOUT: %a.ref: = name_ref a, %a [template = ] diff --git a/toolchain/check/testdata/alias/fail_local_in_namespace.carbon b/toolchain/check/testdata/alias/fail_local_in_namespace.carbon index e9108ebe7f70..05580f18fdbf 100644 --- a/toolchain/check/testdata/alias/fail_local_in_namespace.carbon +++ b/toolchain/check/testdata/alias/fail_local_in_namespace.carbon @@ -30,9 +30,11 @@ fn F() -> bool { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref bool = var diff --git a/toolchain/check/testdata/alias/fail_modifiers.carbon b/toolchain/check/testdata/alias/fail_modifiers.carbon index 81af45d68e7e..e3c85d96b39f 100644 --- a/toolchain/check/testdata/alias/fail_modifiers.carbon +++ b/toolchain/check/testdata/alias/fail_modifiers.carbon @@ -4,54 +4,73 @@ // // AUTOUPDATE +class Class {} + // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:1: ERROR: `abstract` not allowed on `alias` declaration. -// CHECK:STDERR: abstract base default final alias A = i32; +// 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: abstract base default final alias A = i32; +// 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: abstract base default final alias A = i32; +// 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: abstract base default final alias A = i32; +// 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: abstract base default final alias A = i32; +// 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: abstract base default final alias A = i32; +// 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: abstract base default final alias A = i32; +// CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -abstract base default final alias A = i32; +abstract base default final alias A = Class; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: ERROR: `impl` not allowed on `alias` declaration. -// CHECK:STDERR: impl alias B = i32; +// CHECK:STDERR: impl alias B = Class; // CHECK:STDERR: ^~~~ // CHECK:STDERR: -impl alias B = i32; +impl alias B = Class; // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: ERROR: `extern` not allowed on `alias` declaration. -// CHECK:STDERR: extern alias C = i32; +// CHECK:STDERR: extern alias C = Class; // CHECK:STDERR: ^~~~~~ -extern alias C = i32; +extern alias C = Class; // CHECK:STDOUT: --- fail_modifiers.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Class: type = class_type @Class [template] +// CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } -// CHECK:STDOUT: %A: type = bind_alias A, i32 [template = i32] -// CHECK:STDOUT: %B: type = bind_alias B, i32 [template = i32] -// CHECK:STDOUT: %C: type = bind_alias C, i32 [template = i32] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} +// CHECK:STDOUT: %Class.ref.loc34: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %A: type = bind_alias A, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %Class.ref.loc40: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %B: type = bind_alias B, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %Class.ref.loc45: type = name_ref Class, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: %C: type = bind_alias C, %Class.decl [template = constants.%Class] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @Class { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%Class // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/fail_name_conflict.carbon b/toolchain/check/testdata/alias/fail_name_conflict.carbon index 580a56b248d1..1edafce65208 100644 --- a/toolchain/check/testdata/alias/fail_name_conflict.carbon +++ b/toolchain/check/testdata/alias/fail_name_conflict.carbon @@ -4,51 +4,66 @@ // // AUTOUPDATE -alias a = i32; +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: var a: i32 = 1; // CHECK:STDERR: ^ // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: Name is previously declared here. -// CHECK:STDERR: alias a = i32; +// CHECK:STDERR: alias a = C; // CHECK:STDERR: ^ // CHECK:STDERR: var a: i32 = 1; var b: i32 = 2; // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: ERROR: Duplicate name being declared in the same scope. -// CHECK:STDERR: alias b = i32; +// CHECK:STDERR: alias b = C; // CHECK:STDERR: ^ // CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: Name is previously declared here. // CHECK:STDERR: var b: i32 = 2; // CHECK:STDERR: ^ -alias b = i32; +alias b = C; // CHECK:STDOUT: --- fail_name_conflict.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.1: i32 = int_literal 1 [template] -// CHECK:STDOUT: %.2: i32 = int_literal 2 [template] +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %.2: i32 = int_literal 1 [template] +// CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a = %a.loc7 +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .a = %a.loc9 // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %a.loc7: type = bind_alias a, i32 [template = i32] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.ref.loc9: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.loc9: type = bind_alias a, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.var: ref i32 = var a -// CHECK:STDOUT: %a.loc15: ref i32 = bind_name a, %a.var +// CHECK:STDOUT: %a.loc17: ref i32 = bind_name a, %a.var // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %.loc24: type = bind_alias , i32 [template = i32] +// CHECK:STDOUT: %C.ref.loc26: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %.loc26: type = bind_alias , %C.decl [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc15: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: assign file.%a.var, %.loc15 -// CHECK:STDOUT: %.loc17: i32 = int_literal 2 [template = constants.%.2] -// CHECK:STDOUT: assign file.%b.var, %.loc17 +// CHECK:STDOUT: %.loc17: i32 = int_literal 1 [template = constants.%.2] +// CHECK:STDOUT: assign file.%a.var, %.loc17 +// CHECK:STDOUT: %.loc19: i32 = int_literal 2 [template = constants.%.3] +// CHECK:STDOUT: assign file.%b.var, %.loc19 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/fail_not_constant.carbon b/toolchain/check/testdata/alias/fail_not_constant.carbon index 92023389a8b1..50a4f0d925d3 100644 --- a/toolchain/check/testdata/alias/fail_not_constant.carbon +++ b/toolchain/check/testdata/alias/fail_not_constant.carbon @@ -22,8 +22,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/fail_todo_private.carbon b/toolchain/check/testdata/alias/fail_todo_private.carbon index f5b44e068fd3..215f46143cab 100644 --- a/toolchain/check/testdata/alias/fail_todo_private.carbon +++ b/toolchain/check/testdata/alias/fail_todo_private.carbon @@ -4,17 +4,33 @@ // // AUTOUPDATE +class C {} // CHECK:STDERR: fail_todo_private.carbon:[[@LINE+3]]:1: ERROR: Semantics TODO: `access modifier`. -// CHECK:STDERR: private alias A = i32; +// CHECK:STDERR: private alias A = C; // CHECK:STDERR: ^~~~~~~ -private alias A = i32; +private alias A = C; // CHECK:STDOUT: --- fail_todo_private.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %A: type = bind_alias A, i32 [template = i32] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %A: type = bind_alias A, %C.decl [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/import.carbon b/toolchain/check/testdata/alias/import.carbon index 87fc670f5b30..f1a9c36bc0f8 100644 --- a/toolchain/check/testdata/alias/import.carbon +++ b/toolchain/check/testdata/alias/import.carbon @@ -28,9 +28,11 @@ var c: i32 = b; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: %a.ref: ref i32 = name_ref a, %a @@ -50,10 +52,12 @@ var c: i32 = b; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a = %import_ref.1 // CHECK:STDOUT: .b = %import_ref.2 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.2: ref i32 = import_ref ir2, inst+7, loc_14 +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2: ref i32 = import_ref ir2, inst+8, loc_14 +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %c.var: ref i32 = var c // CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/import_order.carbon b/toolchain/check/testdata/alias/import_order.carbon index 056ad83bc010..9a813a01d6d2 100644 --- a/toolchain/check/testdata/alias/import_order.carbon +++ b/toolchain/check/testdata/alias/import_order.carbon @@ -8,7 +8,8 @@ library "a" api; -alias a = i32; +class C { var v: i32; } +alias a = C; alias b = a; alias c = b; alias d = c; @@ -20,84 +21,140 @@ library "b" api; import library "a"; // Access imports in reverse order of export. -var d_val: d = 1; -var c_val: c = d_val; -var b_val: b = c_val; -var a_val: a = b_val; -var i32_val: i32 = a_val; +var d_val: d = {.v = 0}; +var c_val: c = {.v = d_val.v}; +var b_val: b = {.v = c_val.v}; +var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: --- a.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = unbound_element_type C, i32 [template] +// CHECK:STDOUT: %.2: type = struct_type {.v: i32} [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } -// CHECK:STDOUT: %a: type = bind_alias a, i32 [template = i32] -// CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = i32] -// CHECK:STDOUT: %b: type = bind_alias b, %a [template = i32] -// CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = i32] -// CHECK:STDOUT: %c: type = bind_alias c, %b [template = i32] -// CHECK:STDOUT: %c.ref: type = name_ref c, %c [template = i32] -// CHECK:STDOUT: %d: type = bind_alias d, %c [template = i32] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a: type = bind_alias a, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a.ref: type = name_ref a, %a [template = constants.%C] +// CHECK:STDOUT: %b: type = bind_alias b, %a [template = constants.%C] +// CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = constants.%C] +// CHECK:STDOUT: %c: type = bind_alias c, %b [template = constants.%C] +// CHECK:STDOUT: %c.ref: type = name_ref c, %c [template = constants.%C] +// CHECK:STDOUT: %d: type = bind_alias d, %c [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc4: = field_decl v, element0 [template] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: .v = %.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.1: i32 = int_literal 1 [template] +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = struct_type {.v: i32} [template] +// CHECK:STDOUT: %.2: type = ptr_type {.v: i32} [template] +// CHECK:STDOUT: %.3: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.4: C = struct_value (%.3) [template] +// CHECK:STDOUT: %.5: type = unbound_element_type C, i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a = %import_ref.1 -// CHECK:STDOUT: .b = %import_ref.2 -// CHECK:STDOUT: .c = %import_ref.3 -// CHECK:STDOUT: .d = %import_ref.4 +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .a = %import_ref.2 +// CHECK:STDOUT: .b = %import_ref.3 +// CHECK:STDOUT: .c = %import_ref.4 +// CHECK:STDOUT: .d = %import_ref.5 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .d_val = %d_val // CHECK:STDOUT: .c_val = %c_val // CHECK:STDOUT: .b_val = %b_val // CHECK:STDOUT: .a_val = %a_val -// CHECK:STDOUT: .i32_val = %i32_val // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_32 [template = i32] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+3, loc_25 [template = i32] -// CHECK:STDOUT: %import_ref.3: type = import_ref ir2, inst+5, loc_18 [template = i32] -// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+7, loc_11 [template = i32] -// CHECK:STDOUT: %d.ref: type = name_ref d, %import_ref.4 [template = i32] -// CHECK:STDOUT: %d_val.var: ref i32 = var d_val -// CHECK:STDOUT: %d_val: ref i32 = bind_name d_val, %d_val.var -// CHECK:STDOUT: %c.ref: type = name_ref c, %import_ref.3 [template = i32] -// CHECK:STDOUT: %c_val.var: ref i32 = var c_val -// CHECK:STDOUT: %c_val: ref i32 = bind_name c_val, %c_val.var -// CHECK:STDOUT: %b.ref: type = name_ref b, %import_ref.2 [template = i32] -// CHECK:STDOUT: %b_val.var: ref i32 = var b_val -// CHECK:STDOUT: %b_val: ref i32 = bind_name b_val, %b_val.var -// CHECK:STDOUT: %a.ref: type = name_ref a, %import_ref.1 [template = i32] -// CHECK:STDOUT: %a_val.var: ref i32 = var a_val -// CHECK:STDOUT: %a_val: ref i32 = bind_name a_val, %a_val.var -// CHECK:STDOUT: %i32_val.var: ref i32 = var i32_val -// CHECK:STDOUT: %i32_val: ref i32 = bind_name i32_val, %i32_val.var +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+10, loc_51 [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: type = import_ref ir2, inst+12, loc_37 [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+14, loc_23 [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+16, loc_11 [template = constants.%C] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %C.decl: invalid = class_decl @C [template = constants.%C] {} +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+5, loc_31 [template = imports.%.1] +// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %d.ref: type = name_ref d, %import_ref.5 [template = constants.%C] +// CHECK:STDOUT: %d_val.var: ref C = var d_val +// CHECK:STDOUT: %d_val: ref C = bind_name d_val, %d_val.var +// CHECK:STDOUT: %c.ref: type = name_ref c, %import_ref.4 [template = constants.%C] +// 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: %b.ref: type = name_ref b, %import_ref.3 [template = constants.%C] +// 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: %a.ref: type = name_ref a, %import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %a_val.var: ref C = var a_val +// CHECK:STDOUT: %a_val: ref C = bind_name a_val, %a_val.var +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .v = file.%import_ref.6 +// CHECK:STDOUT: .Self = file.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: assign file.%d_val.var, %.loc7 -// CHECK:STDOUT: %d_val.ref: ref i32 = name_ref d_val, file.%d_val -// CHECK:STDOUT: %.loc8: i32 = bind_value %d_val.ref -// CHECK:STDOUT: assign file.%c_val.var, %.loc8 -// CHECK:STDOUT: %c_val.ref: ref i32 = name_ref c_val, file.%c_val -// CHECK:STDOUT: %.loc9: i32 = bind_value %c_val.ref -// CHECK:STDOUT: assign file.%b_val.var, %.loc9 -// CHECK:STDOUT: %b_val.ref: ref i32 = name_ref b_val, file.%b_val -// CHECK:STDOUT: %.loc10: i32 = bind_value %b_val.ref -// CHECK:STDOUT: assign file.%a_val.var, %.loc10 -// CHECK:STDOUT: %a_val.ref: ref i32 = name_ref a_val, file.%a_val -// CHECK:STDOUT: %.loc11: i32 = bind_value %a_val.ref -// CHECK:STDOUT: assign file.%i32_val.var, %.loc11 +// CHECK:STDOUT: %.loc7_22: i32 = int_literal 0 [template = constants.%.3] +// CHECK:STDOUT: %.loc7_23.1: {.v: i32} = struct_literal (%.loc7_22) +// CHECK:STDOUT: %.loc7_23.2: ref i32 = class_element_access file.%d_val.var, element0 +// CHECK:STDOUT: %.loc7_23.3: init i32 = initialize_from %.loc7_22 to %.loc7_23.2 [template = constants.%.3] +// CHECK:STDOUT: %.loc7_23.4: init C = class_init (%.loc7_23.3), file.%d_val.var [template = constants.%.4] +// CHECK:STDOUT: %.loc7_23.5: init C = converted %.loc7_23.1, %.loc7_23.4 [template = constants.%.4] +// CHECK:STDOUT: assign file.%d_val.var, %.loc7_23.5 +// CHECK:STDOUT: %d_val.ref: ref C = name_ref d_val, file.%d_val +// CHECK:STDOUT: %v.ref.loc8: = name_ref v, file.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %.loc8_27.1: ref i32 = class_element_access %d_val.ref, element0 +// CHECK:STDOUT: %.loc8_29.1: {.v: i32} = struct_literal (%.loc8_27.1) +// CHECK:STDOUT: %.loc8_27.2: i32 = bind_value %.loc8_27.1 +// CHECK:STDOUT: %.loc8_29.2: ref i32 = class_element_access file.%c_val.var, element0 +// CHECK:STDOUT: %.loc8_29.3: init i32 = initialize_from %.loc8_27.2 to %.loc8_29.2 +// CHECK:STDOUT: %.loc8_29.4: init C = class_init (%.loc8_29.3), file.%c_val.var +// CHECK:STDOUT: %.loc8_29.5: init C = converted %.loc8_29.1, %.loc8_29.4 +// CHECK:STDOUT: assign file.%c_val.var, %.loc8_29.5 +// CHECK:STDOUT: %c_val.ref: ref C = name_ref c_val, file.%c_val +// CHECK:STDOUT: %v.ref.loc9: = name_ref v, file.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %.loc9_27.1: ref i32 = class_element_access %c_val.ref, element0 +// CHECK:STDOUT: %.loc9_29.1: {.v: i32} = struct_literal (%.loc9_27.1) +// CHECK:STDOUT: %.loc9_27.2: i32 = bind_value %.loc9_27.1 +// CHECK:STDOUT: %.loc9_29.2: ref i32 = class_element_access file.%b_val.var, element0 +// CHECK:STDOUT: %.loc9_29.3: init i32 = initialize_from %.loc9_27.2 to %.loc9_29.2 +// CHECK:STDOUT: %.loc9_29.4: init C = class_init (%.loc9_29.3), file.%b_val.var +// CHECK:STDOUT: %.loc9_29.5: init C = converted %.loc9_29.1, %.loc9_29.4 +// CHECK:STDOUT: assign file.%b_val.var, %.loc9_29.5 +// CHECK:STDOUT: %b_val.ref: ref C = name_ref b_val, file.%b_val +// CHECK:STDOUT: %v.ref.loc10: = name_ref v, file.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %.loc10_27.1: ref i32 = class_element_access %b_val.ref, element0 +// CHECK:STDOUT: %.loc10_29.1: {.v: i32} = struct_literal (%.loc10_27.1) +// CHECK:STDOUT: %.loc10_27.2: i32 = bind_value %.loc10_27.1 +// CHECK:STDOUT: %.loc10_29.2: ref i32 = class_element_access file.%a_val.var, element0 +// CHECK:STDOUT: %.loc10_29.3: init i32 = initialize_from %.loc10_27.2 to %.loc10_29.2 +// CHECK:STDOUT: %.loc10_29.4: init C = class_init (%.loc10_29.3), file.%a_val.var +// CHECK:STDOUT: %.loc10_29.5: init C = converted %.loc10_29.1, %.loc10_29.4 +// CHECK:STDOUT: assign file.%a_val.var, %.loc10_29.5 // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/in_namespace.carbon b/toolchain/check/testdata/alias/in_namespace.carbon index 24d30ccfc88b..2b16e775b0c2 100644 --- a/toolchain/check/testdata/alias/in_namespace.carbon +++ b/toolchain/check/testdata/alias/in_namespace.carbon @@ -4,44 +4,77 @@ // // AUTOUPDATE -namespace NS; -alias NS.a = bool; +class C { var v: i32; } -let b: NS.a = false; +namespace NS; +alias NS.a = C; + +let b: NS.a = {.v = 0}; fn F() -> NS.a { - return false; + return {.v = 0}; } // CHECK:STDOUT: --- in_namespace.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.1: bool = bool_literal false [template] +// CHECK:STDOUT: %C: type = class_type @C [template] +// CHECK:STDOUT: %.1: type = unbound_element_type C, i32 [template] +// CHECK:STDOUT: %.2: type = struct_type {.v: i32} [template] +// CHECK:STDOUT: %.3: type = ptr_type {.v: i32} [template] +// CHECK:STDOUT: %.4: i32 = int_literal 0 [template] +// CHECK:STDOUT: %.5: C = struct_value (%.4) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %a: type = bind_alias a, bool [template = bool] -// CHECK:STDOUT: %NS.ref.loc10: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %a.ref.loc10: type = name_ref a, %a [template = bool] -// CHECK:STDOUT: %.loc10: bool = bool_literal false [template = constants.%.1] -// CHECK:STDOUT: %b: bool = bind_name b, %.loc10 +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] +// CHECK:STDOUT: %a: type = bind_alias a, %C.decl [template = constants.%C] +// CHECK:STDOUT: %NS.ref.loc12: = name_ref NS, %NS [template = %NS] +// CHECK:STDOUT: %a.ref.loc12: type = name_ref a, %a [template = constants.%C] +// CHECK:STDOUT: %.loc12_21: i32 = int_literal 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_22.1: {.v: i32} = struct_literal (%.loc12_21) +// CHECK:STDOUT: %.loc12_22.2: ref C = temporary_storage +// CHECK:STDOUT: %.loc12_22.3: ref i32 = class_element_access %.loc12_22.2, element0 +// CHECK:STDOUT: %.loc12_22.4: init i32 = initialize_from %.loc12_21 to %.loc12_22.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_22.5: init C = class_init (%.loc12_22.4), %.loc12_22.2 [template = constants.%.5] +// CHECK:STDOUT: %.loc12_22.6: ref C = temporary %.loc12_22.2, %.loc12_22.5 +// CHECK:STDOUT: %.loc12_22.7: ref C = converted %.loc12_22.1, %.loc12_22.6 +// CHECK:STDOUT: %.loc12_22.8: C = bind_value %.loc12_22.7 +// CHECK:STDOUT: %b: C = bind_name b, %.loc12_22.8 // CHECK:STDOUT: %F: = fn_decl @F [template] { -// CHECK:STDOUT: %NS.ref.loc12: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %a.ref.loc12: type = name_ref a, %a [template = bool] -// CHECK:STDOUT: %return.var: ref bool = var +// CHECK:STDOUT: %NS.ref.loc14: = name_ref NS, %NS [template = %NS] +// CHECK:STDOUT: %a.ref.loc14: type = name_ref a, %a [template = constants.%C] +// CHECK:STDOUT: @F.%return: ref C = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @F() -> bool { +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %.loc7: = field_decl v, element0 [template] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: .v = %.loc7 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %return: C { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc13: bool = bool_literal false [template = constants.%.1] -// CHECK:STDOUT: return %.loc13 +// CHECK:STDOUT: %.loc15_16: i32 = int_literal 0 [template = constants.%.4] +// CHECK:STDOUT: %.loc15_17.1: {.v: i32} = struct_literal (%.loc15_16) +// CHECK:STDOUT: %.loc15_17.2: ref i32 = class_element_access %return, element0 +// CHECK:STDOUT: %.loc15_17.3: init i32 = initialize_from %.loc15_16 to %.loc15_17.2 [template = constants.%.4] +// CHECK:STDOUT: %.loc15_17.4: init C = class_init (%.loc15_17.3), %return [template = constants.%.5] +// CHECK:STDOUT: %.loc15_17.5: init C = converted %.loc15_17.1, %.loc15_17.4 [template = constants.%.5] +// CHECK:STDOUT: return %.loc15_17.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/local.carbon b/toolchain/check/testdata/alias/local.carbon index e697edaff472..8dfc7bf3253c 100644 --- a/toolchain/check/testdata/alias/local.carbon +++ b/toolchain/check/testdata/alias/local.carbon @@ -18,8 +18,10 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index 3ee32a5135fd..88de03039e12 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -26,9 +26,11 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_25.1: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%.2 [template = constants.%.2] diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index 6281b5c3fe12..4ae6932ef98b 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -28,8 +28,10 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 9177e7aea509..8ead77f68904 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -24,9 +24,11 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_16.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_16.2: type = converted %.loc7_16.1, constants.%.2 [template = constants.%.2] diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index d0d979f3bb32..545f70d0e030 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -24,9 +24,11 @@ var b: [i32; 3] = a; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_22.1: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc7_22.2: type = converted %.loc7_22.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32, i32, i32) = var a diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 5e226c887058..f93fa0507688 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -37,10 +37,12 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 1] = var a diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 72d813567c37..8b1fd4e6fd14 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -24,9 +24,11 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Add = %Add // CHECK:STDOUT: .a = %a.loc9 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Add: = fn_decl @Add [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index e6b81bd08fb7..167b07b22c14 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -20,9 +20,11 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Negate: = fn_decl @Negate [template] { // CHECK:STDOUT: %n.loc7_11.1: i32 = param n // CHECK:STDOUT: @Negate.%n: i32 = bind_name n, %n.loc7_11.1 diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index dc501267425a..8dc7e0e28a3d 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -30,9 +30,11 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc14: type = array_type , i32 [template = ] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index 4dd338c770dd..d53e963287a4 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -28,10 +28,12 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Incomplete = %Incomplete.decl // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .p = %p // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: %Incomplete.ref.loc15: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc15_21: i32 = int_literal 1 [template = constants.%.1] diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 8e52be3e1ff5..9e90c28fd948 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -17,8 +17,10 @@ var a: [1; 1]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_9: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_12: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_13: type = array_type %.loc10_12, [template = ] diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 212a3c1b04e6..a68e377ae5a0 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -22,8 +22,10 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 1] = var a 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 e3d85dfd5f63..2f07208e41eb 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 @@ -27,9 +27,11 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_14: i32 = int_literal 3 [template = constants.%.1] // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 3] = var a diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 38d8021179d5..e9ec934e953a 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -52,6 +52,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .t1 = %t1 // CHECK:STDOUT: .b = %b @@ -59,6 +60,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: .t2 = %t2 // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc11_14: i32 = int_literal 3 [template = constants.%.1] // CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 3] = var a diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 52fefe016e38..26813a7f57f9 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -27,9 +27,11 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_17: i32 = int_literal 3 [template = constants.%.1] // CHECK:STDOUT: %.loc7_18: type = array_type %.loc7_17, i32 [template = constants.%.2] diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index a9f44380f3ed..feab3ec6bb0f 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -24,9 +24,11 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_14: i32 = int_literal 3 [template = constants.%.1] // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 3] = var a diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index 5171dd715b81..67bc0462070c 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -27,8 +27,10 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_14: i32 = int_literal 9 [template = constants.%.1] // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 9] = var a diff --git a/toolchain/check/testdata/as/as_type.carbon b/toolchain/check/testdata/as/as_type.carbon index 78a9fe1ae29e..24501c969cbc 100644 --- a/toolchain/check/testdata/as/as_type.carbon +++ b/toolchain/check/testdata/as/as_type.carbon @@ -14,7 +14,10 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_24.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_24.2: type = converted %.loc7_24.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %t: type = bind_name t, %.loc7_24.2 diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index 6c3b38e3327e..71bb5fa98b09 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -16,8 +16,10 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index ce0806615574..c2fe6c90c89c 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -19,7 +19,10 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %.loc10_21: i32 = int_literal 1 [template = constants.%.4] diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 3d581e1e8699..cd347402b6c0 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -17,7 +17,10 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_19: i32 = int_literal 2 [template = constants.%.2] // CHECK:STDOUT: %n: i32 = bind_name n, diff --git a/toolchain/check/testdata/as/identity.carbon b/toolchain/check/testdata/as/identity.carbon index aaf90aae633e..d53280e152e5 100644 --- a/toolchain/check/testdata/as/identity.carbon +++ b/toolchain/check/testdata/as/identity.carbon @@ -36,12 +36,14 @@ fn Initializing() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .X = %X.decl // CHECK:STDOUT: .Value = %Value // CHECK:STDOUT: .Reference = %Reference // CHECK:STDOUT: .Make = %Make // CHECK:STDOUT: .Initializing = %Initializing // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} // CHECK:STDOUT: %Value: = fn_decl @Value [template] { // CHECK:STDOUT: %X.ref.loc13: type = name_ref X, %X.decl [template = constants.%X] diff --git a/toolchain/check/testdata/as/tuple.carbon b/toolchain/check/testdata/as/tuple.carbon index 9208bad1039e..5146b5900ba0 100644 --- a/toolchain/check/testdata/as/tuple.carbon +++ b/toolchain/check/testdata/as/tuple.carbon @@ -35,11 +35,13 @@ fn Var() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .X = %X.decl // CHECK:STDOUT: .Make = %Make // CHECK:STDOUT: .Let = %Let // CHECK:STDOUT: .Var = %Var // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} // CHECK:STDOUT: %Make: = fn_decl @Make [template] { // CHECK:STDOUT: %X.ref: type = name_ref X, %X.decl [template = constants.%X] diff --git a/toolchain/check/testdata/basics/builtin_insts.carbon b/toolchain/check/testdata/basics/builtin_insts.carbon index e185f2814bd4..c72c85df21ce 100644 --- a/toolchain/check/testdata/basics/builtin_insts.carbon +++ b/toolchain/check/testdata/basics/builtin_insts.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --phase=check --dump-raw-sem-ir --builtin-sem-ir %s +// ARGS: compile --no-prelude-import --phase=check --dump-raw-sem-ir --builtin-sem-ir %s // // AUTOUPDATE diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index f0ff2e96db4a..6a593472d882 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -20,10 +20,12 @@ var test_type: type = i32; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .test_i32 = %test_i32 // CHECK:STDOUT: .test_f64 = %test_f64 // CHECK:STDOUT: .test_type = %test_type // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %test_i32.var: ref i32 = var test_i32 // CHECK:STDOUT: %test_i32: ref i32 = bind_name test_i32, %test_i32.var // CHECK:STDOUT: %test_f64.var: ref f64 = var test_f64 diff --git a/toolchain/check/testdata/basics/empty.carbon b/toolchain/check/testdata/basics/empty.carbon index 55039f0e3c12..79c1ab1e349b 100644 --- a/toolchain/check/testdata/basics/empty.carbon +++ b/toolchain/check/testdata/basics/empty.carbon @@ -7,6 +7,9 @@ // CHECK:STDOUT: --- empty.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/empty_decl.carbon b/toolchain/check/testdata/basics/empty_decl.carbon index 50110a1d6161..2ec2beecd465 100644 --- a/toolchain/check/testdata/basics/empty_decl.carbon +++ b/toolchain/check/testdata/basics/empty_decl.carbon @@ -9,6 +9,9 @@ // CHECK:STDOUT: --- empty_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/fail_bad_run.carbon b/toolchain/check/testdata/basics/fail_bad_run.carbon index fb9eace992d5..41cd4a63f223 100644 --- a/toolchain/check/testdata/basics/fail_bad_run.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run.carbon @@ -22,8 +22,10 @@ fn Run() -> String {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] { // CHECK:STDOUT: @Run.%return: ref String = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index 7554f0839b71..725c6215baa7 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -13,8 +13,10 @@ fn Run(n: i32) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] { // CHECK:STDOUT: %n.loc10_8.1: i32 = param n // CHECK:STDOUT: @Run.%n: i32 = bind_name n, %n.loc10_8.1 diff --git a/toolchain/check/testdata/basics/fail_name_lookup.carbon b/toolchain/check/testdata/basics/fail_name_lookup.carbon index 5b8ba49af880..ec2db270fadc 100644 --- a/toolchain/check/testdata/basics/fail_name_lookup.carbon +++ b/toolchain/check/testdata/basics/fail_name_lookup.carbon @@ -15,8 +15,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index d6ba851e6c83..e5f67ac5e8a0 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -17,8 +17,10 @@ var x: type = 42; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref type = var x // CHECK:STDOUT: %x: ref type = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 5ba8700f1aba..cf9735d1ef4c 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -24,7 +24,10 @@ let c: i32 = 0x8000_0000; // CHECK:STDOUT: --- fail_numeric_literal_overflow.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a: i32 = bind_name a, // CHECK:STDOUT: %b: i32 = bind_name b, // CHECK:STDOUT: %c: i32 = bind_name c, diff --git a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon index 7a3b3dae8d58..94847b6bfa65 100644 --- a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon +++ b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon @@ -14,9 +14,11 @@ var y: i32 = x.b; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %y.var: ref i32 = var y diff --git a/toolchain/check/testdata/basics/multifile.carbon b/toolchain/check/testdata/basics/multifile.carbon index 7e05aee48161..be8a182846d0 100644 --- a/toolchain/check/testdata/basics/multifile.carbon +++ b/toolchain/check/testdata/basics/multifile.carbon @@ -18,8 +18,10 @@ fn B() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -32,8 +34,10 @@ fn B() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B: = fn_decl @B [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon index f1898cf8ac2d..ce580f207969 100644 --- a/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --phase=check --dump-sem-ir --dump-raw-sem-ir %s +// ARGS: compile --no-prelude-import --phase=check --dump-sem-ir --dump-raw-sem-ir %s // // Check that we can combine textual IR and raw IR dumping in one compile. // diff --git a/toolchain/check/testdata/basics/multifile_raw_ir.carbon b/toolchain/check/testdata/basics/multifile_raw_ir.carbon index 701535463018..bf6068108e1b 100644 --- a/toolchain/check/testdata/basics/multifile_raw_ir.carbon +++ b/toolchain/check/testdata/basics/multifile_raw_ir.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --phase=check --dump-raw-sem-ir %s +// ARGS: compile --no-prelude-import --phase=check --dump-raw-sem-ir %s // // Check that raw IR dumping works as expected. // diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 282c2115a675..3ad97273d04b 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -59,8 +59,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 283a4e8a4bf9..cc1f5904b5f2 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -16,9 +16,11 @@ var b: i32 = ((2)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: %b.var: ref i32 = var b diff --git a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon index 4b9884469334..27d87bcedd67 100644 --- a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --phase=check --dump-sem-ir --dump-raw-sem-ir %s +// ARGS: compile --no-prelude-import --phase=check --dump-sem-ir --dump-raw-sem-ir %s // // Check that we can combine textual IR and raw IR dumping in one compile. // // AUTOUPDATE -fn Foo(n: i32) -> (i32, i32, f64) { - return (n, 2, 3.4); +fn Foo(n: ()) -> ((), ()) { + return (n, ()); } // CHECK:STDOUT: --- @@ -17,124 +17,145 @@ fn Foo(n: i32) -> (i32, i32, f64) { // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: import_irs_size: 2 // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, enclosing_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+9}} +// CHECK:STDOUT: name_scope0: {inst: inst+0, enclosing_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+15}} // CHECK:STDOUT: bind_names: // CHECK:STDOUT: bindName0: {name: name1, enclosing_scope: name_scope} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, enclosing_scope: name_scope0, param_refs: block3, return_type: type4, return_slot: inst+7, body: [block6]} +// CHECK:STDOUT: function0: {name: name0, enclosing_scope: name_scope0, param_refs: block3, return_type: type2, return_slot: inst+13, body: [block6]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {constant: template instNamespaceType, value_rep: {kind: copy, type: type0}} -// CHECK:STDOUT: type1: {constant: template instIntType, value_rep: {kind: copy, type: type1}} -// CHECK:STDOUT: type2: {constant: template inst+3, value_rep: {kind: unknown, type: type}} -// CHECK:STDOUT: type3: {constant: template instFloatType, value_rep: {kind: copy, type: type3}} -// CHECK:STDOUT: type4: {constant: template inst+5, value_rep: {kind: pointer, type: type5}} -// CHECK:STDOUT: type5: {constant: template inst+8, value_rep: {kind: copy, type: type5}} -// CHECK:STDOUT: type6: {constant: template instFunctionType, value_rep: {kind: copy, type: type6}} +// CHECK:STDOUT: type1: {constant: template inst+1, value_rep: {kind: none, type: type1}} +// CHECK:STDOUT: type2: {constant: template inst+8, value_rep: {kind: pointer, type: type3}} +// CHECK:STDOUT: type3: {constant: template inst+14, value_rep: {kind: copy, type: type3}} +// CHECK:STDOUT: type4: {constant: template instFunctionType, value_rep: {kind: copy, type: type4}} // CHECK:STDOUT: type_blocks: -// CHECK:STDOUT: typeBlock0: -// CHECK:STDOUT: 0: typeTypeType -// CHECK:STDOUT: 1: typeTypeType -// CHECK:STDOUT: 2: typeTypeType -// CHECK:STDOUT: typeBlock1: +// CHECK:STDOUT: typeBlock0: {} +// CHECK:STDOUT: typeBlock1: {} +// CHECK:STDOUT: typeBlock2: {} +// CHECK:STDOUT: typeBlock3: {} +// CHECK:STDOUT: typeBlock4: // CHECK:STDOUT: 0: type1 // CHECK:STDOUT: 1: type1 -// CHECK:STDOUT: 2: type3 -// CHECK:STDOUT: typeBlock2: +// CHECK:STDOUT: typeBlock5: {} +// CHECK:STDOUT: typeBlock6: {} +// CHECK:STDOUT: typeBlock7: +// CHECK:STDOUT: 0: type1 +// CHECK:STDOUT: 1: type1 +// CHECK:STDOUT: typeBlock8: {} +// CHECK:STDOUT: typeBlock9: {} +// CHECK:STDOUT: typeBlock10: // CHECK:STDOUT: 0: type1 // CHECK:STDOUT: 1: type1 -// CHECK:STDOUT: 2: type3 // CHECK:STDOUT: insts: // CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type0} -// CHECK:STDOUT: inst+1: {kind: Param, arg0: name1, type: type1} -// CHECK:STDOUT: inst+2: {kind: BindName, arg0: bindName0, arg1: inst+1, type: type1} -// CHECK:STDOUT: inst+3: {kind: TupleType, arg0: typeBlock0, type: typeTypeType} -// CHECK:STDOUT: inst+4: {kind: TupleLiteral, arg0: block4, type: type2} -// CHECK:STDOUT: inst+5: {kind: TupleType, arg0: typeBlock1, type: typeTypeType} -// CHECK:STDOUT: inst+6: {kind: Converted, arg0: inst+4, arg1: inst+5, type: typeTypeType} -// CHECK:STDOUT: inst+7: {kind: VarStorage, arg0: nameReturnSlot, type: type4} -// CHECK:STDOUT: inst+8: {kind: PointerType, arg0: type4, type: typeTypeType} -// CHECK:STDOUT: inst+9: {kind: FunctionDecl, arg0: function0, arg1: block5, type: type6} -// CHECK:STDOUT: inst+10: {kind: NameRef, arg0: name1, arg1: inst+2, type: type1} -// CHECK:STDOUT: inst+11: {kind: IntLiteral, arg0: int5, type: type1} -// CHECK:STDOUT: inst+12: {kind: IntLiteral, arg0: int5, type: type1} -// CHECK:STDOUT: inst+13: {kind: RealLiteral, arg0: real0, type: type3} -// CHECK:STDOUT: inst+14: {kind: RealLiteral, arg0: real0, type: type3} -// CHECK:STDOUT: inst+15: {kind: TupleLiteral, arg0: block7, type: type4} -// CHECK:STDOUT: inst+16: {kind: TupleAccess, arg0: inst+7, arg1: element0, type: type1} -// CHECK:STDOUT: inst+17: {kind: InitializeFrom, arg0: inst+10, arg1: inst+16, type: type1} -// CHECK:STDOUT: inst+18: {kind: TupleAccess, arg0: inst+7, arg1: element1, type: type1} -// CHECK:STDOUT: inst+19: {kind: InitializeFrom, arg0: inst+11, arg1: inst+18, type: type1} -// CHECK:STDOUT: inst+20: {kind: TupleAccess, arg0: inst+7, arg1: element2, type: type3} -// CHECK:STDOUT: inst+21: {kind: InitializeFrom, arg0: inst+13, arg1: inst+20, type: type3} -// CHECK:STDOUT: inst+22: {kind: TupleInit, arg0: block8, arg1: inst+7, type: type4} -// CHECK:STDOUT: inst+23: {kind: Converted, arg0: inst+15, arg1: inst+22, type: type4} -// CHECK:STDOUT: inst+24: {kind: ReturnExpr, arg0: inst+23} +// CHECK:STDOUT: inst+1: {kind: TupleType, arg0: typeBlock0, type: typeTypeType} +// CHECK:STDOUT: inst+2: {kind: TupleLiteral, arg0: empty, type: type1} +// CHECK:STDOUT: inst+3: {kind: Converted, arg0: inst+2, arg1: inst+1, type: typeTypeType} +// CHECK:STDOUT: inst+4: {kind: Param, arg0: name1, type: type1} +// CHECK:STDOUT: inst+5: {kind: BindName, arg0: bindName0, arg1: inst+4, type: type1} +// CHECK:STDOUT: inst+6: {kind: TupleLiteral, arg0: empty, type: type1} +// CHECK:STDOUT: inst+7: {kind: TupleLiteral, arg0: empty, type: type1} +// CHECK:STDOUT: inst+8: {kind: TupleType, arg0: typeBlock4, type: typeTypeType} +// CHECK:STDOUT: inst+9: {kind: TupleLiteral, arg0: block4, type: type2} +// CHECK:STDOUT: inst+10: {kind: Converted, arg0: inst+6, arg1: inst+1, type: typeTypeType} +// CHECK:STDOUT: inst+11: {kind: Converted, arg0: inst+7, arg1: inst+1, type: typeTypeType} +// CHECK:STDOUT: inst+12: {kind: Converted, arg0: inst+9, arg1: inst+8, type: typeTypeType} +// CHECK:STDOUT: inst+13: {kind: VarStorage, arg0: nameReturnSlot, type: type2} +// CHECK:STDOUT: inst+14: {kind: PointerType, arg0: type2, type: typeTypeType} +// CHECK:STDOUT: inst+15: {kind: FunctionDecl, arg0: function0, arg1: block5, type: type4} +// CHECK:STDOUT: inst+16: {kind: NameRef, arg0: name1, arg1: inst+5, type: type1} +// CHECK:STDOUT: inst+17: {kind: TupleLiteral, arg0: empty, type: type1} +// CHECK:STDOUT: inst+18: {kind: TupleLiteral, arg0: block7, type: type2} +// CHECK:STDOUT: inst+19: {kind: TupleAccess, arg0: inst+13, arg1: element0, type: type1} +// CHECK:STDOUT: inst+20: {kind: TupleInit, arg0: block8, arg1: inst+19, type: type1} +// CHECK:STDOUT: inst+21: {kind: TupleValue, arg0: block9, type: type1} +// CHECK:STDOUT: inst+22: {kind: Converted, arg0: inst+16, arg1: inst+20, type: type1} +// CHECK:STDOUT: inst+23: {kind: TupleAccess, arg0: inst+13, arg1: element1, type: type1} +// CHECK:STDOUT: inst+24: {kind: TupleInit, arg0: empty, arg1: inst+23, type: type1} +// CHECK:STDOUT: inst+25: {kind: Converted, arg0: inst+17, arg1: inst+24, type: type1} +// CHECK:STDOUT: inst+26: {kind: TupleInit, arg0: block10, arg1: inst+13, type: type2} +// CHECK:STDOUT: inst+27: {kind: TupleValue, arg0: block12, type: type2} +// CHECK:STDOUT: inst+28: {kind: Converted, arg0: inst+18, arg1: inst+26, type: type2} +// CHECK:STDOUT: inst+29: {kind: ReturnExpr, arg0: inst+28} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: inst+0: template inst+0 -// CHECK:STDOUT: inst+3: template inst+3 -// CHECK:STDOUT: inst+5: template inst+5 -// CHECK:STDOUT: inst+6: template inst+5 +// CHECK:STDOUT: inst+1: template inst+1 +// CHECK:STDOUT: inst+3: template inst+1 // CHECK:STDOUT: inst+8: template inst+8 -// CHECK:STDOUT: inst+9: template inst+9 -// CHECK:STDOUT: inst+11: template inst+12 -// CHECK:STDOUT: inst+12: template inst+12 -// CHECK:STDOUT: inst+13: template inst+14 +// CHECK:STDOUT: inst+10: template inst+1 +// CHECK:STDOUT: inst+11: template inst+1 +// CHECK:STDOUT: inst+12: template inst+8 // CHECK:STDOUT: inst+14: template inst+14 -// CHECK:STDOUT: inst+19: template inst+12 -// CHECK:STDOUT: inst+21: template inst+14 +// CHECK:STDOUT: inst+15: template inst+15 +// CHECK:STDOUT: inst+20: template inst+21 +// CHECK:STDOUT: inst+21: template inst+21 +// CHECK:STDOUT: inst+22: template inst+21 +// CHECK:STDOUT: inst+24: template inst+21 +// CHECK:STDOUT: inst+25: template inst+21 +// CHECK:STDOUT: inst+26: template inst+27 +// CHECK:STDOUT: inst+27: template inst+27 +// CHECK:STDOUT: inst+28: template inst+27 // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+9 +// CHECK:STDOUT: 0: inst+15 // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: block3: -// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: 0: inst+5 // CHECK:STDOUT: block4: -// CHECK:STDOUT: 0: instIntType -// CHECK:STDOUT: 1: instIntType -// CHECK:STDOUT: 2: instFloatType +// CHECK:STDOUT: 0: inst+6 +// CHECK:STDOUT: 1: inst+7 // CHECK:STDOUT: block5: -// CHECK:STDOUT: 0: inst+1 -// CHECK:STDOUT: 1: inst+2 +// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: 1: inst+3 // CHECK:STDOUT: 2: inst+4 -// CHECK:STDOUT: 3: inst+6 -// CHECK:STDOUT: 4: inst+7 +// CHECK:STDOUT: 3: inst+5 +// CHECK:STDOUT: 4: inst+6 +// CHECK:STDOUT: 5: inst+7 +// CHECK:STDOUT: 6: inst+9 +// CHECK:STDOUT: 7: inst+10 +// CHECK:STDOUT: 8: inst+11 +// CHECK:STDOUT: 9: inst+12 +// CHECK:STDOUT: 10: inst+13 // CHECK:STDOUT: block6: -// CHECK:STDOUT: 0: inst+10 -// CHECK:STDOUT: 1: inst+11 -// CHECK:STDOUT: 2: inst+13 -// CHECK:STDOUT: 3: inst+15 -// CHECK:STDOUT: 4: inst+16 -// CHECK:STDOUT: 5: inst+17 -// CHECK:STDOUT: 6: inst+18 -// CHECK:STDOUT: 7: inst+19 -// CHECK:STDOUT: 8: inst+20 -// CHECK:STDOUT: 9: inst+21 -// CHECK:STDOUT: 10: inst+22 -// CHECK:STDOUT: 11: inst+23 -// CHECK:STDOUT: 12: inst+24 +// CHECK:STDOUT: 0: inst+16 +// CHECK:STDOUT: 1: inst+17 +// CHECK:STDOUT: 2: inst+18 +// CHECK:STDOUT: 3: inst+19 +// CHECK:STDOUT: 4: inst+20 +// CHECK:STDOUT: 5: inst+22 +// CHECK:STDOUT: 6: inst+23 +// CHECK:STDOUT: 7: inst+24 +// CHECK:STDOUT: 8: inst+25 +// CHECK:STDOUT: 9: inst+26 +// CHECK:STDOUT: 10: inst+28 +// CHECK:STDOUT: 11: inst+29 // CHECK:STDOUT: block7: -// CHECK:STDOUT: 0: inst+10 -// CHECK:STDOUT: 1: inst+11 -// CHECK:STDOUT: 2: inst+13 -// CHECK:STDOUT: block8: -// CHECK:STDOUT: 0: inst+17 -// CHECK:STDOUT: 1: inst+19 -// CHECK:STDOUT: 2: inst+21 -// CHECK:STDOUT: block9: +// CHECK:STDOUT: 0: inst+16 +// CHECK:STDOUT: 1: inst+17 +// CHECK:STDOUT: block8: {} +// CHECK:STDOUT: block9: {} +// CHECK:STDOUT: block10: +// CHECK:STDOUT: 0: inst+22 +// CHECK:STDOUT: 1: inst+25 +// CHECK:STDOUT: block11: {} +// CHECK:STDOUT: block12: +// CHECK:STDOUT: 0: inst+21 +// CHECK:STDOUT: 1: inst+21 +// CHECK:STDOUT: block13: // CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+9 +// CHECK:STDOUT: 1: inst+15 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- raw_and_textual_ir.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.1: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %.2: type = tuple_type (i32, i32, f64) [template] -// CHECK:STDOUT: %.3: type = ptr_type (i32, i32, f64) [template] -// CHECK:STDOUT: %.4: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.5: f64 = real_literal 34e-1 [template] +// CHECK:STDOUT: %.1: type = tuple_type () [template] +// CHECK:STDOUT: %.2: type = tuple_type ((), ()) [template] +// CHECK:STDOUT: %.3: type = ptr_type ((), ()) [template] +// CHECK:STDOUT: %.4: () = tuple_value () [template] +// CHECK:STDOUT: %.5: ((), ()) = tuple_value (%.4, %.4) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -142,28 +163,33 @@ fn Foo(n: i32) -> (i32, i32, f64) { // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { -// CHECK:STDOUT: %n.loc11_8.1: i32 = param n -// CHECK:STDOUT: @Foo.%n: i32 = bind_name n, %n.loc11_8.1 -// CHECK:STDOUT: %.loc11_33.1: (type, type, type) = tuple_literal (i32, i32, f64) -// CHECK:STDOUT: %.loc11_33.2: type = converted %.loc11_33.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: @Foo.%return: ref (i32, i32, f64) = var +// CHECK:STDOUT: %.loc11_12.1: () = tuple_literal () +// CHECK:STDOUT: %.loc11_12.2: type = converted %.loc11_12.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %n.loc11_8.1: () = param n +// CHECK:STDOUT: @Foo.%n: () = bind_name n, %n.loc11_8.1 +// CHECK:STDOUT: %.loc11_20.1: () = tuple_literal () +// CHECK:STDOUT: %.loc11_24.1: () = tuple_literal () +// CHECK:STDOUT: %.loc11_25.1: ((), ()) = tuple_literal (%.loc11_20.1, %.loc11_24.1) +// CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_24.2: type = converted %.loc11_24.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%.2 [template = constants.%.2] +// CHECK:STDOUT: @Foo.%return: ref ((), ()) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%n: i32) -> %return: (i32, i32, f64) { +// CHECK:STDOUT: fn @Foo(%n: ()) -> %return: ((), ()) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n -// CHECK:STDOUT: %.loc12_14: i32 = int_literal 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_17: f64 = real_literal 34e-1 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_20.1: (i32, i32, f64) = tuple_literal (%n.ref, %.loc12_14, %.loc12_17) -// CHECK:STDOUT: %.loc12_20.2: ref i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc12_20.3: init i32 = initialize_from %n.ref to %.loc12_20.2 -// CHECK:STDOUT: %.loc12_20.4: ref i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc12_20.5: init i32 = initialize_from %.loc12_14 to %.loc12_20.4 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_20.6: ref f64 = tuple_access %return, element2 -// CHECK:STDOUT: %.loc12_20.7: init f64 = initialize_from %.loc12_17 to %.loc12_20.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_20.8: init (i32, i32, f64) = tuple_init (%.loc12_20.3, %.loc12_20.5, %.loc12_20.7) to %return -// CHECK:STDOUT: %.loc12_20.9: init (i32, i32, f64) = converted %.loc12_20.1, %.loc12_20.8 -// CHECK:STDOUT: return %.loc12_20.9 +// CHECK:STDOUT: %n.ref: () = name_ref n, %n +// CHECK:STDOUT: %.loc12_15.1: () = tuple_literal () +// CHECK:STDOUT: %.loc12_16.1: ((), ()) = tuple_literal (%n.ref, %.loc12_15.1) +// CHECK:STDOUT: %.loc12_16.2: ref () = tuple_access %return, element0 +// CHECK:STDOUT: %.loc12_11.1: init () = tuple_init () to %.loc12_16.2 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_11.2: init () = converted %n.ref, %.loc12_11.1 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_16.3: ref () = tuple_access %return, element1 +// CHECK:STDOUT: %.loc12_15.2: init () = tuple_init () to %.loc12_16.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_15.3: init () = converted %.loc12_15.1, %.loc12_15.2 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_16.4: init ((), ()) = tuple_init (%.loc12_11.2, %.loc12_15.3) to %return [template = constants.%.5] +// CHECK:STDOUT: %.loc12_16.5: init ((), ()) = converted %.loc12_16.1, %.loc12_16.4 [template = constants.%.5] +// CHECK:STDOUT: return %.loc12_16.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/raw_identifier.carbon b/toolchain/check/testdata/basics/raw_identifier.carbon index debf53f506cd..1c7a6ca6862b 100644 --- a/toolchain/check/testdata/basics/raw_identifier.carbon +++ b/toolchain/check/testdata/basics/raw_identifier.carbon @@ -2,26 +2,30 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --phase=check --dump-sem-ir %s +// ARGS: compile --no-prelude-import --phase=check --dump-sem-ir %s // // Check that the command-line flag to dump textual IR works. // // AUTOUPDATE -fn A(n: i32) -> i32 { +fn A(n: ()) -> () { return r#n; } -fn B(r#n: i32) -> i32 { +fn B(r#n: ()) -> () { return n; } -fn C(r#if: i32) -> i32 { +fn C(r#if: ()) -> () { return r#if; } // CHECK:STDOUT: --- raw_identifier.carbon // CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %.1: type = tuple_type () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A @@ -29,37 +33,49 @@ fn C(r#if: i32) -> i32 { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } // CHECK:STDOUT: %A: = fn_decl @A [template] { -// CHECK:STDOUT: %n.loc11_6.1: i32 = param n -// CHECK:STDOUT: @A.%n: i32 = bind_name n, %n.loc11_6.1 -// CHECK:STDOUT: %return.var.loc11: ref i32 = var +// CHECK:STDOUT: %.loc11_10.1: () = tuple_literal () +// CHECK:STDOUT: %.loc11_10.2: type = converted %.loc11_10.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %n.loc11_6.1: () = param n +// CHECK:STDOUT: @A.%n: () = bind_name n, %n.loc11_6.1 +// CHECK:STDOUT: %.loc11_17.1: () = tuple_literal () +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %return.var.loc11: ref () = var // CHECK:STDOUT: } // CHECK:STDOUT: %B: = fn_decl @B [template] { -// CHECK:STDOUT: %n.loc15_6.1: i32 = param n -// CHECK:STDOUT: @B.%n: i32 = bind_name n, %n.loc15_6.1 -// CHECK:STDOUT: %return.var.loc15: ref i32 = var +// CHECK:STDOUT: %.loc15_12.1: () = tuple_literal () +// CHECK:STDOUT: %.loc15_12.2: type = converted %.loc15_12.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %n.loc15_6.1: () = param n +// CHECK:STDOUT: @B.%n: () = bind_name n, %n.loc15_6.1 +// CHECK:STDOUT: %.loc15_19.1: () = tuple_literal () +// CHECK:STDOUT: %.loc15_19.2: type = converted %.loc15_19.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %return.var.loc15: ref () = var // CHECK:STDOUT: } // CHECK:STDOUT: %C: = fn_decl @C [template] { -// CHECK:STDOUT: %if.loc19_6.1: i32 = param r#if -// CHECK:STDOUT: @C.%if: i32 = bind_name r#if, %if.loc19_6.1 -// CHECK:STDOUT: %return.var.loc19: ref i32 = var +// CHECK:STDOUT: %.loc19_13.1: () = tuple_literal () +// CHECK:STDOUT: %.loc19_13.2: type = converted %.loc19_13.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %if.loc19_6.1: () = param r#if +// CHECK:STDOUT: @C.%if: () = bind_name r#if, %if.loc19_6.1 +// CHECK:STDOUT: %.loc19_20.1: () = tuple_literal () +// CHECK:STDOUT: %.loc19_20.2: type = converted %.loc19_20.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %return.var.loc19: ref () = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @A(%n: i32) -> i32 { +// CHECK:STDOUT: fn @A(%n: ()) -> () { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: () = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @B(%n: i32) -> i32 { +// CHECK:STDOUT: fn @B(%n: ()) -> () { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n +// CHECK:STDOUT: %n.ref: () = name_ref n, %n // CHECK:STDOUT: return %n.ref // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @C(%if: i32) -> i32 { +// CHECK:STDOUT: fn @C(%if: ()) -> () { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %if.ref: i32 = name_ref r#if, %if +// CHECK:STDOUT: %if.ref: () = name_ref r#if, %if // CHECK:STDOUT: return %if.ref // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/raw_ir.carbon b/toolchain/check/testdata/basics/raw_ir.carbon index c68929f77269..67c972c62a92 100644 --- a/toolchain/check/testdata/basics/raw_ir.carbon +++ b/toolchain/check/testdata/basics/raw_ir.carbon @@ -2,14 +2,14 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --phase=check --dump-raw-sem-ir %s +// ARGS: compile --no-prelude-import --phase=check --dump-raw-sem-ir %s // // Check that raw IR dumping works as expected. // // AUTOUPDATE -fn Foo(n: i32) -> (i32, i32, f64) { - return (n, 2, 3.4); +fn Foo(n: ()) -> ((), ()) { + return (n, ()); } // CHECK:STDOUT: --- @@ -17,112 +17,133 @@ fn Foo(n: i32) -> (i32, i32, f64) { // CHECK:STDOUT: sem_ir: // CHECK:STDOUT: import_irs_size: 2 // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: inst+0, enclosing_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+9}} +// CHECK:STDOUT: name_scope0: {inst: inst+0, enclosing_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+15}} // CHECK:STDOUT: bind_names: // CHECK:STDOUT: bindName0: {name: name1, enclosing_scope: name_scope} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, enclosing_scope: name_scope0, param_refs: block3, return_type: type4, return_slot: inst+7, body: [block6]} +// CHECK:STDOUT: function0: {name: name0, enclosing_scope: name_scope0, param_refs: block3, return_type: type2, return_slot: inst+13, body: [block6]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {constant: template instNamespaceType, value_rep: {kind: copy, type: type0}} -// CHECK:STDOUT: type1: {constant: template instIntType, value_rep: {kind: copy, type: type1}} -// CHECK:STDOUT: type2: {constant: template inst+3, value_rep: {kind: unknown, type: type}} -// CHECK:STDOUT: type3: {constant: template instFloatType, value_rep: {kind: copy, type: type3}} -// CHECK:STDOUT: type4: {constant: template inst+5, value_rep: {kind: pointer, type: type5}} -// CHECK:STDOUT: type5: {constant: template inst+8, value_rep: {kind: copy, type: type5}} -// CHECK:STDOUT: type6: {constant: template instFunctionType, value_rep: {kind: copy, type: type6}} +// CHECK:STDOUT: type1: {constant: template inst+1, value_rep: {kind: none, type: type1}} +// CHECK:STDOUT: type2: {constant: template inst+8, value_rep: {kind: pointer, type: type3}} +// CHECK:STDOUT: type3: {constant: template inst+14, value_rep: {kind: copy, type: type3}} +// CHECK:STDOUT: type4: {constant: template instFunctionType, value_rep: {kind: copy, type: type4}} // CHECK:STDOUT: type_blocks: -// CHECK:STDOUT: typeBlock0: -// CHECK:STDOUT: 0: typeTypeType -// CHECK:STDOUT: 1: typeTypeType -// CHECK:STDOUT: 2: typeTypeType -// CHECK:STDOUT: typeBlock1: +// CHECK:STDOUT: typeBlock0: {} +// CHECK:STDOUT: typeBlock1: {} +// CHECK:STDOUT: typeBlock2: {} +// CHECK:STDOUT: typeBlock3: {} +// CHECK:STDOUT: typeBlock4: // CHECK:STDOUT: 0: type1 // CHECK:STDOUT: 1: type1 -// CHECK:STDOUT: 2: type3 -// CHECK:STDOUT: typeBlock2: +// CHECK:STDOUT: typeBlock5: {} +// CHECK:STDOUT: typeBlock6: {} +// CHECK:STDOUT: typeBlock7: +// CHECK:STDOUT: 0: type1 +// CHECK:STDOUT: 1: type1 +// CHECK:STDOUT: typeBlock8: {} +// CHECK:STDOUT: typeBlock9: {} +// CHECK:STDOUT: typeBlock10: // CHECK:STDOUT: 0: type1 // CHECK:STDOUT: 1: type1 -// CHECK:STDOUT: 2: type3 // CHECK:STDOUT: insts: // CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, arg1: inst, type: type0} -// CHECK:STDOUT: inst+1: {kind: Param, arg0: name1, type: type1} -// CHECK:STDOUT: inst+2: {kind: BindName, arg0: bindName0, arg1: inst+1, type: type1} -// CHECK:STDOUT: inst+3: {kind: TupleType, arg0: typeBlock0, type: typeTypeType} -// CHECK:STDOUT: inst+4: {kind: TupleLiteral, arg0: block4, type: type2} -// CHECK:STDOUT: inst+5: {kind: TupleType, arg0: typeBlock1, type: typeTypeType} -// CHECK:STDOUT: inst+6: {kind: Converted, arg0: inst+4, arg1: inst+5, type: typeTypeType} -// CHECK:STDOUT: inst+7: {kind: VarStorage, arg0: nameReturnSlot, type: type4} -// CHECK:STDOUT: inst+8: {kind: PointerType, arg0: type4, type: typeTypeType} -// CHECK:STDOUT: inst+9: {kind: FunctionDecl, arg0: function0, arg1: block5, type: type6} -// CHECK:STDOUT: inst+10: {kind: NameRef, arg0: name1, arg1: inst+2, type: type1} -// CHECK:STDOUT: inst+11: {kind: IntLiteral, arg0: int5, type: type1} -// CHECK:STDOUT: inst+12: {kind: IntLiteral, arg0: int5, type: type1} -// CHECK:STDOUT: inst+13: {kind: RealLiteral, arg0: real0, type: type3} -// CHECK:STDOUT: inst+14: {kind: RealLiteral, arg0: real0, type: type3} -// CHECK:STDOUT: inst+15: {kind: TupleLiteral, arg0: block7, type: type4} -// CHECK:STDOUT: inst+16: {kind: TupleAccess, arg0: inst+7, arg1: element0, type: type1} -// CHECK:STDOUT: inst+17: {kind: InitializeFrom, arg0: inst+10, arg1: inst+16, type: type1} -// CHECK:STDOUT: inst+18: {kind: TupleAccess, arg0: inst+7, arg1: element1, type: type1} -// CHECK:STDOUT: inst+19: {kind: InitializeFrom, arg0: inst+11, arg1: inst+18, type: type1} -// CHECK:STDOUT: inst+20: {kind: TupleAccess, arg0: inst+7, arg1: element2, type: type3} -// CHECK:STDOUT: inst+21: {kind: InitializeFrom, arg0: inst+13, arg1: inst+20, type: type3} -// CHECK:STDOUT: inst+22: {kind: TupleInit, arg0: block8, arg1: inst+7, type: type4} -// CHECK:STDOUT: inst+23: {kind: Converted, arg0: inst+15, arg1: inst+22, type: type4} -// CHECK:STDOUT: inst+24: {kind: ReturnExpr, arg0: inst+23} +// CHECK:STDOUT: inst+1: {kind: TupleType, arg0: typeBlock0, type: typeTypeType} +// CHECK:STDOUT: inst+2: {kind: TupleLiteral, arg0: empty, type: type1} +// CHECK:STDOUT: inst+3: {kind: Converted, arg0: inst+2, arg1: inst+1, type: typeTypeType} +// CHECK:STDOUT: inst+4: {kind: Param, arg0: name1, type: type1} +// CHECK:STDOUT: inst+5: {kind: BindName, arg0: bindName0, arg1: inst+4, type: type1} +// CHECK:STDOUT: inst+6: {kind: TupleLiteral, arg0: empty, type: type1} +// CHECK:STDOUT: inst+7: {kind: TupleLiteral, arg0: empty, type: type1} +// CHECK:STDOUT: inst+8: {kind: TupleType, arg0: typeBlock4, type: typeTypeType} +// CHECK:STDOUT: inst+9: {kind: TupleLiteral, arg0: block4, type: type2} +// CHECK:STDOUT: inst+10: {kind: Converted, arg0: inst+6, arg1: inst+1, type: typeTypeType} +// CHECK:STDOUT: inst+11: {kind: Converted, arg0: inst+7, arg1: inst+1, type: typeTypeType} +// CHECK:STDOUT: inst+12: {kind: Converted, arg0: inst+9, arg1: inst+8, type: typeTypeType} +// CHECK:STDOUT: inst+13: {kind: VarStorage, arg0: nameReturnSlot, type: type2} +// CHECK:STDOUT: inst+14: {kind: PointerType, arg0: type2, type: typeTypeType} +// CHECK:STDOUT: inst+15: {kind: FunctionDecl, arg0: function0, arg1: block5, type: type4} +// CHECK:STDOUT: inst+16: {kind: NameRef, arg0: name1, arg1: inst+5, type: type1} +// CHECK:STDOUT: inst+17: {kind: TupleLiteral, arg0: empty, type: type1} +// CHECK:STDOUT: inst+18: {kind: TupleLiteral, arg0: block7, type: type2} +// CHECK:STDOUT: inst+19: {kind: TupleAccess, arg0: inst+13, arg1: element0, type: type1} +// CHECK:STDOUT: inst+20: {kind: TupleInit, arg0: block8, arg1: inst+19, type: type1} +// CHECK:STDOUT: inst+21: {kind: TupleValue, arg0: block9, type: type1} +// CHECK:STDOUT: inst+22: {kind: Converted, arg0: inst+16, arg1: inst+20, type: type1} +// CHECK:STDOUT: inst+23: {kind: TupleAccess, arg0: inst+13, arg1: element1, type: type1} +// CHECK:STDOUT: inst+24: {kind: TupleInit, arg0: empty, arg1: inst+23, type: type1} +// CHECK:STDOUT: inst+25: {kind: Converted, arg0: inst+17, arg1: inst+24, type: type1} +// CHECK:STDOUT: inst+26: {kind: TupleInit, arg0: block10, arg1: inst+13, type: type2} +// CHECK:STDOUT: inst+27: {kind: TupleValue, arg0: block12, type: type2} +// CHECK:STDOUT: inst+28: {kind: Converted, arg0: inst+18, arg1: inst+26, type: type2} +// CHECK:STDOUT: inst+29: {kind: ReturnExpr, arg0: inst+28} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: inst+0: template inst+0 -// CHECK:STDOUT: inst+3: template inst+3 -// CHECK:STDOUT: inst+5: template inst+5 -// CHECK:STDOUT: inst+6: template inst+5 +// CHECK:STDOUT: inst+1: template inst+1 +// CHECK:STDOUT: inst+3: template inst+1 // CHECK:STDOUT: inst+8: template inst+8 -// CHECK:STDOUT: inst+9: template inst+9 -// CHECK:STDOUT: inst+11: template inst+12 -// CHECK:STDOUT: inst+12: template inst+12 -// CHECK:STDOUT: inst+13: template inst+14 +// CHECK:STDOUT: inst+10: template inst+1 +// CHECK:STDOUT: inst+11: template inst+1 +// CHECK:STDOUT: inst+12: template inst+8 // CHECK:STDOUT: inst+14: template inst+14 -// CHECK:STDOUT: inst+19: template inst+12 -// CHECK:STDOUT: inst+21: template inst+14 +// CHECK:STDOUT: inst+15: template inst+15 +// CHECK:STDOUT: inst+20: template inst+21 +// CHECK:STDOUT: inst+21: template inst+21 +// CHECK:STDOUT: inst+22: template inst+21 +// CHECK:STDOUT: inst+24: template inst+21 +// CHECK:STDOUT: inst+25: template inst+21 +// CHECK:STDOUT: inst+26: template inst+27 +// CHECK:STDOUT: inst+27: template inst+27 +// CHECK:STDOUT: inst+28: template inst+27 // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst+9 +// CHECK:STDOUT: 0: inst+15 // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: block3: -// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: 0: inst+5 // CHECK:STDOUT: block4: -// CHECK:STDOUT: 0: instIntType -// CHECK:STDOUT: 1: instIntType -// CHECK:STDOUT: 2: instFloatType +// CHECK:STDOUT: 0: inst+6 +// CHECK:STDOUT: 1: inst+7 // CHECK:STDOUT: block5: -// CHECK:STDOUT: 0: inst+1 -// CHECK:STDOUT: 1: inst+2 +// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: 1: inst+3 // CHECK:STDOUT: 2: inst+4 -// CHECK:STDOUT: 3: inst+6 -// CHECK:STDOUT: 4: inst+7 +// CHECK:STDOUT: 3: inst+5 +// CHECK:STDOUT: 4: inst+6 +// CHECK:STDOUT: 5: inst+7 +// CHECK:STDOUT: 6: inst+9 +// CHECK:STDOUT: 7: inst+10 +// CHECK:STDOUT: 8: inst+11 +// CHECK:STDOUT: 9: inst+12 +// CHECK:STDOUT: 10: inst+13 // CHECK:STDOUT: block6: -// CHECK:STDOUT: 0: inst+10 -// CHECK:STDOUT: 1: inst+11 -// CHECK:STDOUT: 2: inst+13 -// CHECK:STDOUT: 3: inst+15 -// CHECK:STDOUT: 4: inst+16 -// CHECK:STDOUT: 5: inst+17 -// CHECK:STDOUT: 6: inst+18 -// CHECK:STDOUT: 7: inst+19 -// CHECK:STDOUT: 8: inst+20 -// CHECK:STDOUT: 9: inst+21 -// CHECK:STDOUT: 10: inst+22 -// CHECK:STDOUT: 11: inst+23 -// CHECK:STDOUT: 12: inst+24 +// CHECK:STDOUT: 0: inst+16 +// CHECK:STDOUT: 1: inst+17 +// CHECK:STDOUT: 2: inst+18 +// CHECK:STDOUT: 3: inst+19 +// CHECK:STDOUT: 4: inst+20 +// CHECK:STDOUT: 5: inst+22 +// CHECK:STDOUT: 6: inst+23 +// CHECK:STDOUT: 7: inst+24 +// CHECK:STDOUT: 8: inst+25 +// CHECK:STDOUT: 9: inst+26 +// CHECK:STDOUT: 10: inst+28 +// CHECK:STDOUT: 11: inst+29 // CHECK:STDOUT: block7: -// CHECK:STDOUT: 0: inst+10 -// CHECK:STDOUT: 1: inst+11 -// CHECK:STDOUT: 2: inst+13 -// CHECK:STDOUT: block8: -// CHECK:STDOUT: 0: inst+17 -// CHECK:STDOUT: 1: inst+19 -// CHECK:STDOUT: 2: inst+21 -// CHECK:STDOUT: block9: +// CHECK:STDOUT: 0: inst+16 +// CHECK:STDOUT: 1: inst+17 +// CHECK:STDOUT: block8: {} +// CHECK:STDOUT: block9: {} +// CHECK:STDOUT: block10: +// CHECK:STDOUT: 0: inst+22 +// CHECK:STDOUT: 1: inst+25 +// CHECK:STDOUT: block11: {} +// CHECK:STDOUT: block12: +// CHECK:STDOUT: 0: inst+21 +// CHECK:STDOUT: 1: inst+21 +// CHECK:STDOUT: block13: // CHECK:STDOUT: 0: inst+0 -// CHECK:STDOUT: 1: inst+9 +// CHECK:STDOUT: 1: inst+15 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/run.carbon b/toolchain/check/testdata/basics/run.carbon index 7de1bc5b4f69..c24a606a63a6 100644 --- a/toolchain/check/testdata/basics/run.carbon +++ b/toolchain/check/testdata/basics/run.carbon @@ -10,8 +10,10 @@ fn Run() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index f9ee6bd2e1b4..06a3ae3f3e4b 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -14,8 +14,10 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/textual_ir.carbon b/toolchain/check/testdata/basics/textual_ir.carbon index e28e133f9960..738491e12500 100644 --- a/toolchain/check/testdata/basics/textual_ir.carbon +++ b/toolchain/check/testdata/basics/textual_ir.carbon @@ -2,24 +2,24 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --phase=check --dump-sem-ir %s +// ARGS: compile --no-prelude-import --phase=check --dump-sem-ir %s // // Check that the command-line flag to dump textual IR works. // // AUTOUPDATE -fn Foo(n: i32) -> (i32, i32, f64) { - return (n, 2, 3.4); +fn Foo(n: ()) -> ((), ()) { + return (n, ()); } // CHECK:STDOUT: --- textual_ir.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %.1: type = tuple_type (type, type, type) [template] -// CHECK:STDOUT: %.2: type = tuple_type (i32, i32, f64) [template] -// CHECK:STDOUT: %.3: type = ptr_type (i32, i32, f64) [template] -// CHECK:STDOUT: %.4: i32 = int_literal 2 [template] -// CHECK:STDOUT: %.5: f64 = real_literal 34e-1 [template] +// CHECK:STDOUT: %.1: type = tuple_type () [template] +// CHECK:STDOUT: %.2: type = tuple_type ((), ()) [template] +// CHECK:STDOUT: %.3: type = ptr_type ((), ()) [template] +// CHECK:STDOUT: %.4: () = tuple_value () [template] +// CHECK:STDOUT: %.5: ((), ()) = tuple_value (%.4, %.4) [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -27,28 +27,33 @@ fn Foo(n: i32) -> (i32, i32, f64) { // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { -// CHECK:STDOUT: %n.loc11_8.1: i32 = param n -// CHECK:STDOUT: @Foo.%n: i32 = bind_name n, %n.loc11_8.1 -// CHECK:STDOUT: %.loc11_33.1: (type, type, type) = tuple_literal (i32, i32, f64) -// CHECK:STDOUT: %.loc11_33.2: type = converted %.loc11_33.1, constants.%.2 [template = constants.%.2] -// CHECK:STDOUT: @Foo.%return: ref (i32, i32, f64) = var +// CHECK:STDOUT: %.loc11_12.1: () = tuple_literal () +// CHECK:STDOUT: %.loc11_12.2: type = converted %.loc11_12.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %n.loc11_8.1: () = param n +// CHECK:STDOUT: @Foo.%n: () = bind_name n, %n.loc11_8.1 +// CHECK:STDOUT: %.loc11_20.1: () = tuple_literal () +// CHECK:STDOUT: %.loc11_24.1: () = tuple_literal () +// CHECK:STDOUT: %.loc11_25.1: ((), ()) = tuple_literal (%.loc11_20.1, %.loc11_24.1) +// CHECK:STDOUT: %.loc11_20.2: type = converted %.loc11_20.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_24.2: type = converted %.loc11_24.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %.loc11_25.2: type = converted %.loc11_25.1, constants.%.2 [template = constants.%.2] +// CHECK:STDOUT: @Foo.%return: ref ((), ()) = var // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Foo(%n: i32) -> %return: (i32, i32, f64) { +// CHECK:STDOUT: fn @Foo(%n: ()) -> %return: ((), ()) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n -// CHECK:STDOUT: %.loc12_14: i32 = int_literal 2 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_17: f64 = real_literal 34e-1 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_20.1: (i32, i32, f64) = tuple_literal (%n.ref, %.loc12_14, %.loc12_17) -// CHECK:STDOUT: %.loc12_20.2: ref i32 = tuple_access %return, element0 -// CHECK:STDOUT: %.loc12_20.3: init i32 = initialize_from %n.ref to %.loc12_20.2 -// CHECK:STDOUT: %.loc12_20.4: ref i32 = tuple_access %return, element1 -// CHECK:STDOUT: %.loc12_20.5: init i32 = initialize_from %.loc12_14 to %.loc12_20.4 [template = constants.%.4] -// CHECK:STDOUT: %.loc12_20.6: ref f64 = tuple_access %return, element2 -// CHECK:STDOUT: %.loc12_20.7: init f64 = initialize_from %.loc12_17 to %.loc12_20.6 [template = constants.%.5] -// CHECK:STDOUT: %.loc12_20.8: init (i32, i32, f64) = tuple_init (%.loc12_20.3, %.loc12_20.5, %.loc12_20.7) to %return -// CHECK:STDOUT: %.loc12_20.9: init (i32, i32, f64) = converted %.loc12_20.1, %.loc12_20.8 -// CHECK:STDOUT: return %.loc12_20.9 +// CHECK:STDOUT: %n.ref: () = name_ref n, %n +// CHECK:STDOUT: %.loc12_15.1: () = tuple_literal () +// CHECK:STDOUT: %.loc12_16.1: ((), ()) = tuple_literal (%n.ref, %.loc12_15.1) +// CHECK:STDOUT: %.loc12_16.2: ref () = tuple_access %return, element0 +// CHECK:STDOUT: %.loc12_11.1: init () = tuple_init () to %.loc12_16.2 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_11.2: init () = converted %n.ref, %.loc12_11.1 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_16.3: ref () = tuple_access %return, element1 +// CHECK:STDOUT: %.loc12_15.2: init () = tuple_init () to %.loc12_16.3 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_15.3: init () = converted %.loc12_15.1, %.loc12_15.2 [template = constants.%.4] +// CHECK:STDOUT: %.loc12_16.4: init ((), ()) = tuple_init (%.loc12_11.2, %.loc12_15.3) to %return [template = constants.%.5] +// CHECK:STDOUT: %.loc12_16.5: init ((), ()) = converted %.loc12_16.1, %.loc12_16.4 [template = constants.%.5] +// CHECK:STDOUT: return %.loc12_16.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/verbose.carbon b/toolchain/check/testdata/basics/verbose.carbon index c27b5ffed2df..fd5eb495e7a7 100644 --- a/toolchain/check/testdata/basics/verbose.carbon +++ b/toolchain/check/testdata/basics/verbose.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: -v compile --phase=check %s +// ARGS: -v compile --no-prelude-import --phase=check %s // // Only checks a couple statements in order to minimize manual update churn. // NOAUTOUPDATE diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index 7e27a4c8a904..05a6c4e71233 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -22,8 +22,10 @@ var b: Bool() = false; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Bool = %Bool // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Bool: = fn_decl @Bool [template] { // CHECK:STDOUT: %return.var: ref type = var // CHECK:STDOUT: } @@ -40,9 +42,11 @@ var b: Bool() = false; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Bool = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+2, loc_11 [template = imports.%Bool] +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+3, loc_11 [template = imports.%Bool] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Bool.ref: = name_ref Bool, %import_ref [template = imports.%Bool] // CHECK:STDOUT: %.loc6_12.1: init type = call %Bool.ref() [template = bool] // CHECK:STDOUT: %.loc6_13: type = value_of_initializer %.loc6_12.1 [template = bool] diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index e5c8dd488e5f..77935578b5ef 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -44,8 +44,10 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Float = %Float // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Float: = fn_decl @Float [template] { // CHECK:STDOUT: %size.loc4_10.1: i32 = param size // CHECK:STDOUT: @Float.%size: i32 = bind_name size, %size.loc4_10.1 @@ -65,10 +67,12 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Float = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .f = %f // CHECK:STDOUT: .GetFloat = %GetFloat // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+4, loc_11 [template = imports.%Float] +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+5, loc_11 [template = imports.%Float] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Float.ref: = name_ref Float, %import_ref [template = imports.%Float] // CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %.loc6_13.1: init type = call %Float.ref(%.loc6_14) [template = f64] @@ -112,11 +116,13 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Float = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .invalid_float = %invalid_float // CHECK:STDOUT: .dyn_size = %dyn_size // CHECK:STDOUT: .dyn = %dyn // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+4, loc_11 [template = imports.%Float] +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+5, loc_11 [template = imports.%Float] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Float.ref.loc10: = name_ref Float, %import_ref [template = imports.%Float] // CHECK:STDOUT: %.loc10_26: i32 = int_literal 32 [template = constants.%.1] // CHECK:STDOUT: %.loc10_25.1: init type = call %Float.ref.loc10(%.loc10_26) [template = ] diff --git a/toolchain/check/testdata/builtins/int/add.carbon b/toolchain/check/testdata/builtins/int/add.carbon index 01fa24033867..2c65c5917ac1 100644 --- a/toolchain/check/testdata/builtins/int/add.carbon +++ b/toolchain/check/testdata/builtins/int/add.carbon @@ -97,10 +97,12 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Add = %Add // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Add: = fn_decl @Add [template] { // CHECK:STDOUT: %a.loc2_8.1: i32 = param a // CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc2_8.1 @@ -153,6 +155,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .TooFew = %TooFew // CHECK:STDOUT: .TooMany = %TooMany // CHECK:STDOUT: .BadReturnType = %BadReturnType @@ -165,6 +168,7 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %TooFew: = fn_decl @TooFew [template] { // CHECK:STDOUT: %a.loc8_11.1: i32 = param a // CHECK:STDOUT: @TooFew.%a: i32 = bind_name a, %a.loc8_11.1 @@ -294,8 +298,10 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Add = %Add // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Add: = fn_decl @Add [template] { // CHECK:STDOUT: %a.loc4_8.1: i32 = param a // CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc4_8.1 diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 8e8c23bf26e5..81cc02f9938c 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -27,10 +27,12 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .And = %And // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %And: = fn_decl @And [template] { // CHECK:STDOUT: %a.loc2_8.1: i32 = param a // CHECK:STDOUT: @And.%a: i32 = bind_name a, %a.loc2_8.1 diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index 0562aaba991d..417de1dd5fe5 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -29,11 +29,13 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Complement = %Complement // CHECK:STDOUT: .And = %And // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Complement: = fn_decl @Complement [template] { // CHECK:STDOUT: %a.loc2_15.1: i32 = param a // CHECK:STDOUT: @Complement.%a: i32 = bind_name a, %a.loc2_15.1 diff --git a/toolchain/check/testdata/builtins/int/div.carbon b/toolchain/check/testdata/builtins/int/div.carbon index 5e09aad8e80e..2504c39c3b7f 100644 --- a/toolchain/check/testdata/builtins/int/div.carbon +++ b/toolchain/check/testdata/builtins/int/div.carbon @@ -65,10 +65,12 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Div = %Div // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Div: = fn_decl @Div [template] { // CHECK:STDOUT: %a.loc2_8.1: i32 = param a // CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc2_8.1 @@ -123,10 +125,12 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Div = %Div // CHECK:STDOUT: .Sub = %Sub // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Div: = fn_decl @Div [template] { // CHECK:STDOUT: %a.loc4_8.1: i32 = param a // CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc4_8.1 @@ -214,8 +218,10 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Div = %Div // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Div: = fn_decl @Div [template] { // CHECK:STDOUT: %a.loc4_8.1: i32 = param a // CHECK:STDOUT: @Div.%a: i32 = bind_name a, %a.loc4_8.1 diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 1f79fb48f7fd..9ad2b3d33dab 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -45,12 +45,14 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Eq = %Eq // CHECK:STDOUT: .True = %True.decl // CHECK:STDOUT: .False = %False.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Eq: = fn_decl @Eq [template] { // CHECK:STDOUT: %a.loc2_7.1: i32 = param a // CHECK:STDOUT: @Eq.%a: i32 = bind_name a, %a.loc2_7.1 @@ -147,8 +149,10 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .WrongResult = %WrongResult // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %WrongResult: = fn_decl @WrongResult [template] { // CHECK:STDOUT: %a.loc7_16.1: i32 = param a // CHECK:STDOUT: @WrongResult.%a: i32 = bind_name a, %a.loc7_16.1 diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 7ebd03b86745..f5989369059f 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -42,6 +42,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Greater = %Greater // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: .True = %True.decl @@ -49,6 +50,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Greater: = fn_decl @Greater [template] { // CHECK:STDOUT: %a.loc2_12.1: i32 = param a // CHECK:STDOUT: @Greater.%a: i32 = bind_name a, %a.loc2_12.1 diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index b33a3e6aafa1..f312be103af9 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -42,6 +42,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .GreaterEq = %GreaterEq // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: .True = %True.decl @@ -49,6 +50,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %GreaterEq: = fn_decl @GreaterEq [template] { // CHECK:STDOUT: %a.loc2_14.1: i32 = param a // CHECK:STDOUT: @GreaterEq.%a: i32 = bind_name a, %a.loc2_14.1 diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index 8da1c7e838e5..82dc896f0109 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -71,10 +71,12 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .LeftShift = %LeftShift // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %LeftShift: = fn_decl @LeftShift [template] { // CHECK:STDOUT: %a.loc2_14.1: i32 = param a // CHECK:STDOUT: @LeftShift.%a: i32 = bind_name a, %a.loc2_14.1 @@ -132,9 +134,11 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .LeftShift = %LeftShift // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %LeftShift: = fn_decl @LeftShift [template] { // CHECK:STDOUT: %a.loc4_14.1: i32 = param a // CHECK:STDOUT: @LeftShift.%a: i32 = bind_name a, %a.loc4_14.1 diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index fd65adb3488b..2ac43adf2c17 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -42,6 +42,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Less = %Less // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: .True = %True.decl @@ -49,6 +50,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Less: = fn_decl @Less [template] { // CHECK:STDOUT: %a.loc2_9.1: i32 = param a // CHECK:STDOUT: @Less.%a: i32 = bind_name a, %a.loc2_9.1 diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 9fd4d576a26d..6d07a58c359e 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -42,6 +42,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .LessEq = %LessEq // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: .True = %True.decl @@ -49,6 +50,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %LessEq: = fn_decl @LessEq [template] { // CHECK:STDOUT: %a.loc2_11.1: i32 = param a // CHECK:STDOUT: @LessEq.%a: i32 = bind_name a, %a.loc2_11.1 diff --git a/toolchain/check/testdata/builtins/int/make_type_32.carbon b/toolchain/check/testdata/builtins/int/make_type_32.carbon index af29da67ac79..bcd9928d87ec 100644 --- a/toolchain/check/testdata/builtins/int/make_type_32.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_32.carbon @@ -22,8 +22,10 @@ var i: Int() = 0; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Int = %Int // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Int: = fn_decl @Int [template] { // CHECK:STDOUT: %return.var: ref type = var // CHECK:STDOUT: } @@ -40,9 +42,11 @@ var i: Int() = 0; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .i = %i // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+2, loc_11 [template = imports.%Int] +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+3, loc_11 [template = imports.%Int] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Int.ref: = name_ref Int, %import_ref [template = imports.%Int] // CHECK:STDOUT: %.loc6_11.1: init type = call %Int.ref() [template = i32] // CHECK:STDOUT: %.loc6_12: type = value_of_initializer %.loc6_11.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/mod.carbon b/toolchain/check/testdata/builtins/int/mod.carbon index 359534f0853d..37d9ff9b8fe8 100644 --- a/toolchain/check/testdata/builtins/int/mod.carbon +++ b/toolchain/check/testdata/builtins/int/mod.carbon @@ -68,10 +68,12 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Mod = %Mod // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Mod: = fn_decl @Mod [template] { // CHECK:STDOUT: %a.loc2_8.1: i32 = param a // CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc2_8.1 @@ -127,10 +129,12 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Mod = %Mod // CHECK:STDOUT: .Sub = %Sub // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Mod: = fn_decl @Mod [template] { // CHECK:STDOUT: %a.loc4_8.1: i32 = param a // CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc4_8.1 @@ -218,8 +222,10 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Mod = %Mod // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Mod: = fn_decl @Mod [template] { // CHECK:STDOUT: %a.loc4_8.1: i32 = param a // CHECK:STDOUT: @Mod.%a: i32 = bind_name a, %a.loc4_8.1 diff --git a/toolchain/check/testdata/builtins/int/mul.carbon b/toolchain/check/testdata/builtins/int/mul.carbon index 5ce5713490f0..16f0b8cee42c 100644 --- a/toolchain/check/testdata/builtins/int/mul.carbon +++ b/toolchain/check/testdata/builtins/int/mul.carbon @@ -39,10 +39,12 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Mul = %Mul // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Mul: = fn_decl @Mul [template] { // CHECK:STDOUT: %a.loc2_8.1: i32 = param a // CHECK:STDOUT: @Mul.%a: i32 = bind_name a, %a.loc2_8.1 @@ -97,8 +99,10 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Mul = %Mul // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Mul: = fn_decl @Mul [template] { // CHECK:STDOUT: %a.loc4_8.1: i32 = param a // CHECK:STDOUT: @Mul.%a: i32 = bind_name a, %a.loc4_8.1 diff --git a/toolchain/check/testdata/builtins/int/negate.carbon b/toolchain/check/testdata/builtins/int/negate.carbon index baae674664bd..d1a96f9940a9 100644 --- a/toolchain/check/testdata/builtins/int/negate.carbon +++ b/toolchain/check/testdata/builtins/int/negate.carbon @@ -125,10 +125,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Negate: = fn_decl @Negate [template] { // CHECK:STDOUT: %a.loc2_11.1: i32 = param a // CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc2_11.1 @@ -186,6 +188,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .TooFew = %TooFew // CHECK:STDOUT: .TooMany = %TooMany // CHECK:STDOUT: .BadReturnType = %BadReturnType @@ -198,6 +201,7 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %TooFew: = fn_decl @TooFew [template] { // CHECK:STDOUT: %return.var.loc8: ref i32 = var // CHECK:STDOUT: } @@ -315,9 +319,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: .Sub = %Sub // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Negate: = fn_decl @Negate [template] { // CHECK:STDOUT: %a.loc4_11.1: i32 = param a // CHECK:STDOUT: @Negate.%a: i32 = bind_name a, %a.loc4_11.1 diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index e49c3cb05e7c..6594ff2ada31 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -36,12 +36,14 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Neq = %Neq // CHECK:STDOUT: .True = %True.decl // CHECK:STDOUT: .False = %False.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Neq: = fn_decl @Neq [template] { // CHECK:STDOUT: %a.loc2_8.1: i32 = param a // CHECK:STDOUT: @Neq.%a: i32 = bind_name a, %a.loc2_8.1 diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index bd5d1ec74eaf..16af2b368dd7 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -27,10 +27,12 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Or = %Or // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Or: = fn_decl @Or [template] { // CHECK:STDOUT: %a.loc2_7.1: i32 = param a // CHECK:STDOUT: @Or.%a: i32 = bind_name a, %a.loc2_7.1 diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 61c5de76b80e..6c7ffac3ebaf 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -72,10 +72,12 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .RightShift = %RightShift // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %RightShift: = fn_decl @RightShift [template] { // CHECK:STDOUT: %a.loc2_15.1: i32 = param a // CHECK:STDOUT: @RightShift.%a: i32 = bind_name a, %a.loc2_15.1 @@ -136,11 +138,13 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .RightShift = %RightShift // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: .arr1 = %arr1 // CHECK:STDOUT: .arr2 = %arr2 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %RightShift: = fn_decl @RightShift [template] { // CHECK:STDOUT: %a.loc6_15.1: i32 = param a // CHECK:STDOUT: @RightShift.%a: i32 = bind_name a, %a.loc6_15.1 @@ -214,9 +218,11 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .RightShift = %RightShift // CHECK:STDOUT: .Negate = %Negate // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %RightShift: = fn_decl @RightShift [template] { // CHECK:STDOUT: %a.loc4_15.1: i32 = param a // CHECK:STDOUT: @RightShift.%a: i32 = bind_name a, %a.loc4_15.1 diff --git a/toolchain/check/testdata/builtins/int/sub.carbon b/toolchain/check/testdata/builtins/int/sub.carbon index 0a1bfc5fb9cf..9fbbe0297c07 100644 --- a/toolchain/check/testdata/builtins/int/sub.carbon +++ b/toolchain/check/testdata/builtins/int/sub.carbon @@ -40,10 +40,12 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Sub = %Sub // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Sub: = fn_decl @Sub [template] { // CHECK:STDOUT: %a.loc2_8.1: i32 = param a // CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc2_8.1 @@ -99,8 +101,10 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Sub = %Sub // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Sub: = fn_decl @Sub [template] { // CHECK:STDOUT: %a.loc4_8.1: i32 = param a // CHECK:STDOUT: @Sub.%a: i32 = bind_name a, %a.loc4_8.1 diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index 65a7680c8d91..c7f9f86f533b 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -27,10 +27,12 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Xor = %Xor // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: .RuntimeCall = %RuntimeCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Xor: = fn_decl @Xor [template] { // CHECK:STDOUT: %a.loc2_8.1: i32 = param a // CHECK:STDOUT: @Xor.%a: i32 = bind_name a, %a.loc2_8.1 diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index d0563b914f5f..e780c1a28115 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -48,11 +48,13 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Derived = %Derived.decl // CHECK:STDOUT: .Make = %Make // CHECK:STDOUT: .Access = %Access // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Make: = fn_decl @Make [template] { @@ -86,7 +88,7 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc12 // CHECK:STDOUT: .d = %.loc14 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: Derived { diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index b748912e64e6..3868b6ecf880 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -41,10 +41,12 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Derived = %Derived.decl // CHECK:STDOUT: .Access = %Access // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Access: = fn_decl @Access [template] { @@ -80,7 +82,7 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: .base = %.loc14 // CHECK:STDOUT: .d = %.loc16 // CHECK:STDOUT: .e = %.loc17 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Access(%p: Derived*) -> i32* { diff --git a/toolchain/check/testdata/class/base_function_unqualified.carbon b/toolchain/check/testdata/class/base_function_unqualified.carbon index 757322d1bf64..2b5aa6bbb168 100644 --- a/toolchain/check/testdata/class/base_function_unqualified.carbon +++ b/toolchain/check/testdata/class/base_function_unqualified.carbon @@ -33,9 +33,11 @@ fn Derived.H() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Derived = %Derived.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %H: = fn_decl @H [template] {} @@ -60,7 +62,7 @@ fn Derived.H() { // CHECK:STDOUT: .base = %.loc12 // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .H = %H -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index 08488b9a34d0..c529a7a4ccfa 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -42,10 +42,12 @@ fn Call(p: Derived*) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Derived = %Derived.decl // CHECK:STDOUT: .Call = %Call // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Base.ref: type = name_ref Base, %Base.decl [template = constants.%Base] @@ -86,7 +88,7 @@ fn Call(p: Derived*) { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc18 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[addr %self: Base*]() { diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index c1ca4d336be2..452c9e8c80fb 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -51,6 +51,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Derived = %Derived.decl.loc7 // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Call = %Call @@ -58,6 +59,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: .PassDerivedToBase = %PassDerivedToBase // CHECK:STDOUT: .PassDerivedToBaseIndirect = %PassDerivedToBaseIndirect // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Derived.decl.loc7: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl.loc14: type = class_decl @Derived [template = constants.%Derived] {} @@ -108,7 +110,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: .base = %.loc15 // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { diff --git a/toolchain/check/testdata/class/base_method_shadow.carbon b/toolchain/check/testdata/class/base_method_shadow.carbon index a9c2fb28cad4..dbac2b260251 100644 --- a/toolchain/check/testdata/class/base_method_shadow.carbon +++ b/toolchain/check/testdata/class/base_method_shadow.carbon @@ -56,12 +56,14 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: .Call = %Call // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} @@ -115,7 +117,7 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: .base = %.loc12 // CHECK:STDOUT: .F = %F -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -133,7 +135,7 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .base = %.loc17 // CHECK:STDOUT: .F = %F -// CHECK:STDOUT: extend name_scope2 +// CHECK:STDOUT: extend name_scope3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -143,7 +145,7 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: .base = %.loc22 -// CHECK:STDOUT: extend name_scope2 +// CHECK:STDOUT: extend name_scope3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1[addr @A.%self.loc8_13.3: A*](); diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index b37e8d95b24a..1807bd695ab1 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -33,9 +33,11 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %n.loc17_12.1: i32 = param n diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index 32604df963dc..7a49d7709bba 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -21,8 +21,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index eeecf91325ca..80877564ca41 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -53,6 +53,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Derived = %Derived.decl // CHECK:STDOUT: .AccessDerived = %AccessDerived @@ -60,6 +61,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: .AccessDerivedIndirect = %AccessDerivedIndirect // CHECK:STDOUT: .AccessBaseIndirect = %AccessBaseIndirect // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %AccessDerived: = fn_decl @AccessDerived [template] { @@ -115,7 +117,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: .base = %.loc14 // CHECK:STDOUT: .d = %.loc16 // CHECK:STDOUT: .e = %.loc17 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AccessDerived(%d: Derived) -> i32 { diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 335e62122ebe..d48260b51860 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -109,8 +109,10 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -127,8 +129,10 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -138,8 +142,10 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C: = fn_decl @C [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -160,14 +166,16 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_14 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+2, loc_14 [template = constants.%C] // CHECK:STDOUT: %C.decl: invalid = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+3, unloaded // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref C = var c // CHECK:STDOUT: %c: ref C = bind_name c, %c.var @@ -196,12 +204,14 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref: type = import_ref ir2, inst+1, loc_14 [template = constants.%C] +// CHECK:STDOUT: %import_ref: type = import_ref ir3, inst+2, loc_14 [template = constants.%C] // CHECK:STDOUT: %C.decl: invalid = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref [template = constants.%C] // CHECK:STDOUT: %c.var: ref = var c @@ -230,15 +240,17 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_19 [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+2, loc_19 [template = constants.%C.1] // CHECK:STDOUT: %C.decl.1: invalid = class_decl @C.1 [template = constants.%C.1] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref ir3, inst+1, loaded [template = constants.%C.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref ir4, inst+2, loaded [template = constants.%C.2] // CHECK:STDOUT: %C.decl.2: invalid = class_decl @C.2 [template = constants.%C.2] {} // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C.1] // CHECK:STDOUT: %c.var: ref C = var c @@ -274,14 +286,16 @@ var c: Other.C = {}; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other: = namespace [template] {} +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_19 [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loc_19 [template = constants.%C] // CHECK:STDOUT: %C.decl: invalid = class_decl @C.2 [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref ir3, inst+1, loaded [template = imports.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref ir3, inst+2, loaded [template = imports.%C] // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref C = var c // CHECK:STDOUT: %c: ref C = bind_name c, %c.var diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index de986b88fade..4b643f44711f 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -70,6 +70,7 @@ fn ConvertInit() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .C = %C.decl @@ -80,6 +81,7 @@ fn ConvertInit() { // CHECK:STDOUT: .ConvertRef = %ConvertRef // CHECK:STDOUT: .ConvertInit = %ConvertInit // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} @@ -144,7 +146,7 @@ fn ConvertInit() { // CHECK:STDOUT: .Self = constants.%B // CHECK:STDOUT: .base = %.loc12 // CHECK:STDOUT: .b = %.loc13 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -156,7 +158,7 @@ fn ConvertInit() { // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .base = %.loc17 // CHECK:STDOUT: .c = %.loc18 -// CHECK:STDOUT: extend name_scope2 +// CHECK:STDOUT: extend name_scope3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ConvertCToB(%p: C*) -> B* { diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index e8dcf6092a5e..4996c4292052 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -50,11 +50,13 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Abstract = %Abstract.decl // CHECK:STDOUT: .Derived = %Derived.decl // CHECK:STDOUT: .Make = %Make // CHECK:STDOUT: .Access = %Access // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Make: = fn_decl @Make [template] { @@ -88,7 +90,7 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: .Self = constants.%Derived // CHECK:STDOUT: .base = %.loc12 // CHECK:STDOUT: .d = %.loc14 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Make() -> %return: Derived { diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index 1114b318320f..1debbec765b6 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -27,8 +27,10 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index c9d7e0462045..dbc219f72361 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -52,9 +52,11 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F.2 [template] { // CHECK:STDOUT: %Class.ref.loc12_9: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 5129f35eaeba..487c07b7b7f9 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -172,6 +172,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Final = %Final.decl // CHECK:STDOUT: .DeriveFromError = %DeriveFromError.decl @@ -196,6 +197,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: .AccessMemberWithInvalidBaseFinal_WithMember = %AccessMemberWithInvalidBaseFinal_WithMember // CHECK:STDOUT: .AccessMemberWithInvalidBaseFinal_NoMember = %AccessMemberWithInvalidBaseFinal_NoMember // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Final.decl: type = class_decl @Final [template = constants.%Final] {} // CHECK:STDOUT: %DeriveFromError.decl: type = class_decl @DeriveFromError [template = constants.%DeriveFromError] {} @@ -393,7 +395,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%DeriveFromFinal // CHECK:STDOUT: .base = %.loc112 -// CHECK:STDOUT: extend name_scope2 +// CHECK:STDOUT: extend name_scope3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseError(%p: DeriveFromError*) -> i32 { diff --git a/toolchain/check/testdata/class/fail_base_method_define.carbon b/toolchain/check/testdata/class/fail_base_method_define.carbon index be6ad71f2fc5..701f19e67cc4 100644 --- a/toolchain/check/testdata/class/fail_base_method_define.carbon +++ b/toolchain/check/testdata/class/fail_base_method_define.carbon @@ -42,9 +42,11 @@ fn D.C.F() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // 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: = fn_decl @F.3 [template] {} @@ -77,7 +79,7 @@ fn D.C.F() {} // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: .base = %.loc16 // CHECK:STDOUT: .F = file.%F -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1(); diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index ce5c859afe54..69fab97319ef 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -67,12 +67,14 @@ class C4 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .C1 = %C1.decl // CHECK:STDOUT: .C2 = %C2.decl // CHECK:STDOUT: .C3 = %C3.decl // CHECK:STDOUT: .C4 = %C4.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} @@ -92,7 +94,7 @@ class C4 { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C1 // CHECK:STDOUT: .base = %.loc14 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C2 { @@ -111,7 +113,7 @@ class C4 { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C3 // CHECK:STDOUT: .base = %.loc37 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C4 { @@ -121,6 +123,6 @@ class C4 { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C4 // CHECK:STDOUT: .base = %.loc47 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_no_extend.carbon b/toolchain/check/testdata/class/fail_base_no_extend.carbon index 0a93660edce3..6d15d5f87aba 100644 --- a/toolchain/check/testdata/class/fail_base_no_extend.carbon +++ b/toolchain/check/testdata/class/fail_base_no_extend.carbon @@ -27,9 +27,11 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index 0a68a736121e..341827546f94 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -48,11 +48,13 @@ class D { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B1 = %B1.decl // CHECK:STDOUT: .B2 = %B2.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B1.decl: type = class_decl @B1 [template = constants.%B1] {} // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} @@ -77,7 +79,7 @@ class D { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .base = %.loc11 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -88,6 +90,6 @@ class D { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D // CHECK:STDOUT: .base = %.loc24 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index b266049216b8..f517133fada6 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -29,9 +29,11 @@ let b: B = C.base; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] @@ -52,6 +54,6 @@ let b: B = C.base; // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C // CHECK:STDOUT: .base = %.loc10 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 84ab9b8de858..b10d4a39bd6c 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -34,10 +34,12 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .AccessBInA = %AccessBInA // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %AccessBInA: = fn_decl @AccessBInA [template] { diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index ac385b2a919e..a46e87c9e39c 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -25,9 +25,11 @@ fn Make() -> C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Make = %Make // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %Make: = fn_decl @Make [template] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = 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 e2d3120649c8..79b29a07172f 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -55,6 +55,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A1 = %A1.decl // CHECK:STDOUT: .A2 = %A2.decl // CHECK:STDOUT: .B2 = %B2.decl @@ -62,6 +63,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: .Incomplete = %Incomplete.decl // CHECK:STDOUT: .ConvertIncomplete = %ConvertIncomplete // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A1.decl: type = class_decl @A1 [template = constants.%A1] {} // CHECK:STDOUT: %A2.decl: type = class_decl @A2 [template = constants.%A2] {} // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} @@ -111,7 +113,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: .Self = constants.%B2 // CHECK:STDOUT: .base = %.loc16 // CHECK:STDOUT: .b = %.loc17 -// CHECK:STDOUT: extend name_scope2 +// CHECK:STDOUT: extend name_scope3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 77137d2256d9..0e26a9101cb0 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -42,8 +42,10 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index fa3107ffd986..c4f2ffb30376 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -53,9 +53,11 @@ var a: Incomplete; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .Incomplete = %Incomplete.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: } @@ -80,11 +82,13 @@ var a: Incomplete; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Empty = %import_ref.1 // CHECK:STDOUT: .Incomplete = %import_ref.2 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+4, loc_15 [template = constants.%Incomplete] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loaded [template = constants.%Empty] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+5, loc_15 [template = constants.%Incomplete] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %Empty.decl: invalid = class_decl @Empty [template = constants.%Empty] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index e4965d4ba48f..b50bbe46fd1c 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -141,6 +141,7 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .CallClassFunction = %CallClassFunction // CHECK:STDOUT: .global_var = %global_var @@ -154,6 +155,7 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: .CallTakeIncomplete = %CallTakeIncomplete // CHECK:STDOUT: .CallReturnIncomplete = %CallReturnIncomplete // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %.loc16: = fn_decl @.1 [template] {} // CHECK:STDOUT: %CallClassFunction: = fn_decl @CallClassFunction [template] {} diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index e70800dc15f1..5e5e042762a5 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -43,9 +43,11 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 7e69847aa87a..491ed0a90cc2 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -38,10 +38,12 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 21ddf049bb76..212cc3330287 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -51,10 +51,12 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %F: = fn_decl @F.2 [template] { diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 9b4aff592658..05cff612972b 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -27,8 +27,10 @@ fn T.F() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %T: type = bind_name T, %Class.ref diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index e1cdf4458795..078935032f71 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -53,10 +53,12 @@ fn F(c: Class) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Class.ref.loc12: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %WithSelf.ref: = name_ref WithSelf, @Class.%WithSelf [template = @Class.%WithSelf] diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index ec40ac3cfbc6..ad4cce84afa4 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -62,10 +62,12 @@ base class BaseClass { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .FinalClass = %FinalClass.decl // CHECK:STDOUT: .AbstractClass = %AbstractClass.decl // CHECK:STDOUT: .BaseClass = %BaseClass.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %FinalClass.decl: type = class_decl @FinalClass [template = constants.%FinalClass] {} // CHECK:STDOUT: %AbstractClass.decl: type = class_decl @AbstractClass [template = constants.%AbstractClass] {} // CHECK:STDOUT: %BaseClass.decl: type = class_decl @BaseClass [template = constants.%BaseClass] {} diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index f163572b534e..ce6cc0c141ff 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -24,8 +24,10 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index d12244560a8c..40159af8b702 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -94,6 +94,7 @@ extern class ExternDefined {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .DuplicatePrivate = %DuplicatePrivate.decl // CHECK:STDOUT: .TwoAccess = %TwoAccess.decl // CHECK:STDOUT: .TwoAbstract = %TwoAbstract.decl @@ -102,6 +103,7 @@ extern class ExternDefined {} // CHECK:STDOUT: .AbstractAndBase = %AbstractAndBase.decl // CHECK:STDOUT: .ExternDefined = %ExternDefined.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %DuplicatePrivate.decl: type = class_decl @DuplicatePrivate [template = constants.%DuplicatePrivate] {} // CHECK:STDOUT: %TwoAccess.decl: type = class_decl @TwoAccess [template = constants.%TwoAccess] {} // CHECK:STDOUT: %TwoAbstract.decl: type = class_decl @TwoAbstract [template = constants.%TwoAbstract] {} 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 6ea695c91394..92b1ea9a0f1f 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,10 @@ fn C.F() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon index a9c144d39e16..18d2962e7a37 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 G; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl.loc7 // CHECK:STDOUT: .B = %B.decl.loc17 // CHECK:STDOUT: .C = %C.decl.loc27 @@ -104,6 +105,7 @@ base class G; // CHECK:STDOUT: .F = %F.decl.loc57 // CHECK:STDOUT: .G = %G.decl.loc67 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl.loc7: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.decl.loc15: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl.loc17: type = class_decl @B [template = constants.%B] {} diff --git a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon index 46bcb51b261c..a09209d3cf6e 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon @@ -36,10 +36,12 @@ class Y { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl.loc7 // CHECK:STDOUT: .X = %X.decl // CHECK:STDOUT: .Y = %Y.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl.loc7: type = class_decl @A.1 [template = constants.%A.1] {} // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} // CHECK:STDOUT: %A.decl.loc15: type = class_decl @A.1 [template = constants.%A.1] {} diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index f53f96084622..a7655a434175 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -57,8 +57,10 @@ fn Class.I() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl.loc7 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl.loc7: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Class.decl.loc20: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} @@ -74,9 +76,9 @@ fn Class.I() {} // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Class -// CHECK:STDOUT: .F = -// CHECK:STDOUT: .H = -// CHECK:STDOUT: .I = +// CHECK:STDOUT: .F = +// CHECK:STDOUT: .H = +// CHECK:STDOUT: .I = // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 3a4f5e440547..cd077e568baf 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -27,9 +27,11 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %return.var: ref i32 = var diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index f7cf084d34b0..643dba006bea 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -67,10 +67,12 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .WrongSelf = %WrongSelf.decl // CHECK:STDOUT: .CallWrongSelf = %CallWrongSelf // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F.1 [template] { // CHECK:STDOUT: %Self.ref.loc28: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/fail_todo_generic.carbon b/toolchain/check/testdata/class/fail_todo_generic.carbon index 29b7af4a9de4..b3e7def3b47f 100644 --- a/toolchain/check/testdata/class/fail_todo_generic.carbon +++ b/toolchain/check/testdata/class/fail_todo_generic.carbon @@ -21,8 +21,10 @@ class C[](); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_todo_generic_method.carbon b/toolchain/check/testdata/class/fail_todo_generic_method.carbon index 353f6d6de50b..4ba2c4866a9c 100644 --- a/toolchain/check/testdata/class/fail_todo_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_todo_generic_method.carbon @@ -35,8 +35,10 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T, %T.loc11_13.1 [symbolic] diff --git a/toolchain/check/testdata/class/fail_todo_import_forward_decl.carbon b/toolchain/check/testdata/class/fail_todo_import_forward_decl.carbon index 784508c2ad54..eed4a44a614f 100644 --- a/toolchain/check/testdata/class/fail_todo_import_forward_decl.carbon +++ b/toolchain/check/testdata/class/fail_todo_import_forward_decl.carbon @@ -37,8 +37,10 @@ class ForwardDecl { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .ForwardDecl = %ForwardDecl.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %ForwardDecl.decl: type = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -55,8 +57,10 @@ class ForwardDecl { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .ForwardDecl = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: type = import_ref ir2, inst+1, loaded [template = constants.%ForwardDecl] +// CHECK:STDOUT: %import_ref: type = import_ref ir2, inst+2, loaded [template = constants.%ForwardDecl] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] { // CHECK:STDOUT: %ForwardDecl.decl: invalid = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_todo_modifiers.carbon b/toolchain/check/testdata/class/fail_todo_modifiers.carbon index f0209dd29ae6..e36d8aeb3c9b 100644 --- a/toolchain/check/testdata/class/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_todo_modifiers.carbon @@ -79,10 +79,12 @@ abstract class Abstract { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Access = %Access.decl // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Abstract = %Abstract.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Access.decl: type = class_decl @Access [template = constants.%Access] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 3570952e9044..1bf19d053442 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -32,9 +32,11 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %return.var: ref i32 = var diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index f06986d08b4c..c62cde096a13 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -27,9 +27,11 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 2c81f0414ff4..2e163fa23fa4 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -30,9 +30,11 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index 01138023bce7..8ab2e0dd2b2e 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -31,9 +31,11 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .Test = %Test // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Test: = fn_decl @Test [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/forward_declared.carbon b/toolchain/check/testdata/class/forward_declared.carbon index 08aff29815fb..49695784b6d0 100644 --- a/toolchain/check/testdata/class/forward_declared.carbon +++ b/toolchain/check/testdata/class/forward_declared.carbon @@ -17,9 +17,11 @@ fn F(p: Class*) -> Class* { return p; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Class.ref.loc9_9: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 9a64bc78e5ae..3cc29334d91c 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -60,11 +60,13 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .Field = %Field.decl // CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl.loc11 // CHECK:STDOUT: .Incomplete = %Incomplete.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} // CHECK:STDOUT: %Field.decl: type = class_decl @Field [template = constants.%Field] {} // CHECK:STDOUT: %ForwardDeclared.decl.loc11: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} @@ -140,22 +142,24 @@ fn Run() { // CHECK:STDOUT: .Field = %import_ref.2 // CHECK:STDOUT: .ForwardDeclared = %import_ref.3 // CHECK:STDOUT: .Incomplete = %import_ref.4 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_16 [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+4, loc_24 [template = constants.%Field] -// CHECK:STDOUT: %import_ref.3: type = import_ref ir2, inst+11, loc_42 [template = constants.%ForwardDeclared.1] -// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+25, loc_71 [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loc_16 [template = constants.%Empty] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+5, loc_24 [template = constants.%Field] +// CHECK:STDOUT: %import_ref.3: type = import_ref ir2, inst+12, loc_42 [template = constants.%ForwardDeclared.1] +// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+26, loc_71 [template = constants.%Incomplete] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} -// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+5, unloaded -// CHECK:STDOUT: %import_ref.7: = import_ref ir2, inst+7, loc_36 [template = imports.%.1] -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+12, unloaded -// CHECK:STDOUT: %import_ref.9: = import_ref ir2, inst+24, loc_56 [template = imports.%G] -// CHECK:STDOUT: %import_ref.10: = import_ref ir2, inst+17, loc_50 [template = imports.%F] -// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+12, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref ir2, inst+17, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+6, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref ir2, inst+8, loc_36 [template = imports.%.1] +// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+13, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref ir2, inst+25, loc_56 [template = imports.%G] +// CHECK:STDOUT: %import_ref.10: = import_ref ir2, inst+18, loc_50 [template = imports.%F] +// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+13, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+25, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref ir2, inst+18, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 644aa74643b4..8e5ec084331b 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -46,9 +46,11 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Child = %Child.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Child.decl: type = class_decl @Child [template = constants.%Child] {} // CHECK:STDOUT: } @@ -82,7 +84,7 @@ fn Run() { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%Child // CHECK:STDOUT: .base = %.loc13 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F[@Base.%self.loc5_8.2: Base](); @@ -114,25 +116,27 @@ fn Run() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Base = %import_ref.1 // CHECK:STDOUT: .Child = %import_ref.2 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+19, loc_16 [template = constants.%Child] +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+20, loc_16 [template = constants.%Child] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+6, loc_44 [template = imports.%F] -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+12, loc_38 [template = imports.%.1] -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+10, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+15, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+20, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+24, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+7, loc_44 [template = imports.%F] +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+13, loc_38 [template = imports.%.1] +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+11, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+16, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+21, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+25, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Child { // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = file.%import_ref.8 // CHECK:STDOUT: .base = file.%import_ref.9 -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index c011fe8c387d..581cf9bc910c 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -33,8 +33,10 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Cycle = %Cycle.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Cycle.decl: type = class_decl @Cycle [template = constants.%Cycle] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -59,12 +61,14 @@ fn Run() { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Cycle = %import_ref.1 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_16 [template = constants.%Cycle] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loc_16 [template = constants.%Cycle] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+8, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index a0201c45f962..8edf30990ce3 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -39,9 +39,11 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Cycle = %Cycle.decl.loc4 // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Cycle.decl.loc4: type = class_decl @Cycle [template = constants.%Cycle] {} // CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, %Cycle.decl.loc4 [template = constants.%Cycle] // CHECK:STDOUT: %.loc6_18: type = ptr_type Cycle [template = constants.%.1] @@ -77,13 +79,15 @@ fn Run() { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Cycle = %import_ref.1 // CHECK:STDOUT: .a = %import_ref.2 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: ref {.b: Cycle*} = import_ref ir2, inst+11, loc_14 +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: ref {.b: Cycle*} = import_ref ir2, inst+12, loc_14 +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_24 [template = imports.%.1] +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+19, loc_24 [template = imports.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 0446e3d90e1e..9af901cd860d 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -31,10 +31,12 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .Make = %Make // CHECK:STDOUT: .MakeReorder = %MakeReorder // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Make: = fn_decl @Make [template] { // CHECK:STDOUT: %n.loc12_9.1: i32 = param n diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 63f484c45ca9..e7e6bbb1a30d 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -27,9 +27,11 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref i32 = var diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index 7605a49d92b1..670e6f2e7802 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -37,11 +37,13 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Inner = %Inner.decl // CHECK:STDOUT: .MakeInner = %MakeInner // CHECK:STDOUT: .Outer = %Outer.decl // CHECK:STDOUT: .MakeOuter = %MakeOuter // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} // CHECK:STDOUT: %MakeInner: = fn_decl @MakeInner [template] { // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner.decl [template = constants.%Inner] diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index fe10d2d472d9..d7a936deb899 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -68,6 +68,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .Call = %Call // CHECK:STDOUT: .CallAlias = %CallAlias @@ -79,6 +80,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: .CallFOnInitializingExpr = %CallFOnInitializingExpr // CHECK:STDOUT: .CallGOnInitializingExpr = %CallGOnInitializingExpr // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index 9be1283cd692..57380e69b968 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -64,9 +64,11 @@ fn F(a: Outer*) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Outer = %Outer.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} // CHECK:STDOUT: %F: = fn_decl @F.2 [template] { // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, %Outer.decl [template = constants.%Outer] diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 1109d93d8ea7..e3eed5847d27 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -33,10 +33,12 @@ fn G(o: Outer) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Outer = %Outer.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Outer.ref.loc13: type = name_ref Outer, %Outer.decl [template = constants.%Outer] diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 0788f5151752..47d24a2ab853 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -33,8 +33,10 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/raw_self_type.carbon b/toolchain/check/testdata/class/raw_self_type.carbon index a9e493e591ec..f354f6ea9403 100644 --- a/toolchain/check/testdata/class/raw_self_type.carbon +++ b/toolchain/check/testdata/class/raw_self_type.carbon @@ -33,9 +33,11 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .MemberNamedSelf = %MemberNamedSelf.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %MemberNamedSelf.decl: type = class_decl @MemberNamedSelf [template = constants.%MemberNamedSelf] {} // CHECK:STDOUT: %F: = fn_decl @F.2 [template] { diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index 6dc7e09e0d9a..3a53e385f7b2 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -23,8 +23,10 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl.loc7 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl.loc7: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Class.decl.loc9: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { diff --git a/toolchain/check/testdata/class/redeclaration_introducer.carbon b/toolchain/check/testdata/class/redeclaration_introducer.carbon index 014c97db3cce..8f7c951da656 100644 --- a/toolchain/check/testdata/class/redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/redeclaration_introducer.carbon @@ -23,10 +23,12 @@ abstract class C {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl.loc7 // CHECK:STDOUT: .B = %B.decl.loc8 // CHECK:STDOUT: .C = %C.decl.loc9 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl.loc7: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl.loc8: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl.loc9: type = class_decl @C [template = constants.%C] {} diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index 847e00254fc5..561529898633 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -23,8 +23,10 @@ fn Class.F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref i32 = var diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index f5ac9f640d63..545d10256cf9 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -24,8 +24,10 @@ class Class { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 2476a6304284..626473a083b2 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -74,8 +74,10 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index d09f14e63cc3..f92df7fee878 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -34,10 +34,12 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F.2 [template] { // CHECK:STDOUT: %return.var: ref i32 = var diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index bbc16df191bb..9fb5c0d23d28 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -31,8 +31,10 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Self.ref.loc14: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index e7a6efc9ece6..1bfb278c7d76 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -48,10 +48,12 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Derived = %Derived.decl // CHECK:STDOUT: .Call = %Call // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %SelfBase: = fn_decl @SelfBase [template] { @@ -106,7 +108,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: .base = %.loc12 // CHECK:STDOUT: .SelfBase = %SelfBase // CHECK:STDOUT: .AddrSelfBase = %AddrSelfBase -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @SelfBase[%self: Base]() -> i32 { diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 42d6648aaf29..9cb64441c2e4 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -25,8 +25,10 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index 98cd169b211d..88c53a283e0f 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -24,9 +24,11 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] { // CHECK:STDOUT: %return.var: ref i32 = var diff --git a/toolchain/check/testdata/const/basic.carbon b/toolchain/check/testdata/const/basic.carbon index c3d915419863..081d48eadc6e 100644 --- a/toolchain/check/testdata/const/basic.carbon +++ b/toolchain/check/testdata/const/basic.carbon @@ -24,9 +24,11 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] { // CHECK:STDOUT: %.loc7_9: type = const_type i32 [template = constants.%.1] // CHECK:STDOUT: %.loc7_18: type = ptr_type const i32 [template = constants.%.2] diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 8be68db3e3f9..6311c918dd55 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -22,8 +22,10 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc11_9: type = const_type i32 [template = constants.%.1] // CHECK:STDOUT: %.loc11_18: type = ptr_type const i32 [template = constants.%.2] diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 12790c77a897..2391809c7f08 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -27,8 +27,10 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %.loc11_16: type = const_type i32 [template = constants.%.1] // CHECK:STDOUT: %.loc11_9: type = const_type const i32 [template = constants.%.1] diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index edef906e43fd..0f34fdbda3bf 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -31,10 +31,12 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: .a_ptr_ref = %a_ptr_ref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc4: type = const_type i32 [template = constants.%.1] // CHECK:STDOUT: %return.var: ref const i32 = var @@ -73,12 +75,14 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: .F = %import_ref.1 // CHECK:STDOUT: .a_ref = %import_ref.2 // CHECK:STDOUT: .a_ptr_ref = %import_ref.3 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .a_ptr = %a_ptr // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+4, unloaded -// CHECK:STDOUT: %import_ref.2: ref const i32 = import_ref ir1, inst+7, loc_12 -// CHECK:STDOUT: %import_ref.3: ref const i32* = import_ref ir1, inst+15, loc_22 +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+5, unloaded +// CHECK:STDOUT: %import_ref.2: ref const i32 = import_ref ir1, inst+8, loc_12 +// CHECK:STDOUT: %import_ref.3: ref const i32* = import_ref ir1, inst+16, loc_22 +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_8: type = const_type i32 [template = constants.%.1] // CHECK:STDOUT: %.loc6_17: type = ptr_type const i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref const i32* = var a diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index 4ad947b27d4f..48be9041cad9 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -47,11 +47,13 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .tuple_copy = %tuple_copy // CHECK:STDOUT: .struct_copy = %struct_copy // CHECK:STDOUT: .tuple_index = %tuple_index // CHECK:STDOUT: .struct_access = %struct_access // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_26.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_26.2: type = converted %.loc7_26.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %tuple_copy.var: ref (i32, i32) = var tuple_copy diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 09b6ba386e4c..f583a486f7ce 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -33,8 +33,10 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .array_index = %array_index // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc12_24: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc12_25: type = array_type %.loc12_24, i32 [template = constants.%.2] // CHECK:STDOUT: %array_index.var: ref [i32; 1] = var array_index diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 976b97ab67ca..8a8f356baa53 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -16,8 +16,10 @@ fn G(N:! i32) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %N.loc8_6.1: i32 = param N // CHECK:STDOUT: @G.%N: i32 = bind_symbolic_name N, %N.loc8_6.1 [symbolic] diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 719eeaace30e..763c09807813 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -28,8 +28,10 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %T.loc8_6.1: type = param T // CHECK:STDOUT: @F.%T: type = bind_symbolic_name T, %T.loc8_6.1 [symbolic] diff --git a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon index 0dba1bd70b03..005174a73c34 100644 --- a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon @@ -27,10 +27,12 @@ fn H() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .H = %H // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_20.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_20.2: type = converted %.loc7_20.1, constants.%.2 [template = constants.%.2] diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index f417505a5bfb..cf0a5ac94676 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -20,9 +20,11 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Add = %Add // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Add: = fn_decl @Add [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/builtin/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/call_from_operator.carbon index d78efea47254..520fd4ebedab 100644 --- a/toolchain/check/testdata/function/builtin/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/call_from_operator.carbon @@ -94,10 +94,10 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_9 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2: in Add> = import_ref ir2, inst+20, loc_36 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_10 [template = imports.%Op] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_9 [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2: in Add> = import_ref ir3, inst+20, loc_36 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_10 [template = imports.%Op] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Add.decl: invalid = interface_decl @Add [template = constants.%.1] {} @@ -105,15 +105,15 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: } // CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.3] // CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_36 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+1, loc_36 [template = constants.%.1] +// CHECK:STDOUT: %import_ref.6 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %.1: = interface_witness_access @impl.%.1, element0 [template = @impl.%Op] // CHECK:STDOUT: %.loc10_18.1: = bound_method %.loc10_16, %.1 [template = constants.%.7] // CHECK:STDOUT: %.loc10_18.2: init i32 = call %.loc10_18.1(%.loc10_16, %.loc10_20) [template = constants.%.8] // CHECK:STDOUT: %.loc10_21: type = array_type %.loc10_18.2, i32 [template = constants.%.9] // CHECK:STDOUT: %arr.var: ref [i32; 3] = var arr // CHECK:STDOUT: %arr: ref [i32; 3] = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_47 [template = constants.%.1] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir3, inst+1, loc_47 [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { diff --git a/toolchain/check/testdata/function/builtin/definition.carbon b/toolchain/check/testdata/function/builtin/definition.carbon index 2341d0f86f89..47166f95b199 100644 --- a/toolchain/check/testdata/function/builtin/definition.carbon +++ b/toolchain/check/testdata/function/builtin/definition.carbon @@ -10,8 +10,10 @@ fn Add(a: i32, b: i32) -> i32 = "int.add"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Add = %Add // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Add: = fn_decl @Add [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 4a5bfd73f09e..2c2f8fa1d7ed 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -37,10 +37,12 @@ fn C(n: i32, m: i32) -> i32 = "int.add"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.loc7 // CHECK:STDOUT: .B = %B.loc17 // CHECK:STDOUT: .C = %C.loc27 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.loc7: = fn_decl @A [template] { // CHECK:STDOUT: %n.loc7_6.1: i32 = param n // CHECK:STDOUT: %n.loc7_6.2: i32 = bind_name n, %n.loc7_6.1 diff --git a/toolchain/check/testdata/function/builtin/fail_unknown.carbon b/toolchain/check/testdata/function/builtin/fail_unknown.carbon index 360a1f67eb7f..c214d07aea56 100644 --- a/toolchain/check/testdata/function/builtin/fail_unknown.carbon +++ b/toolchain/check/testdata/function/builtin/fail_unknown.carbon @@ -13,8 +13,10 @@ fn UnknownBuiltin() = "unknown.builtin.name"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .UnknownBuiltin = %UnknownBuiltin // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %UnknownBuiltin: = fn_decl @UnknownBuiltin [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/import.carbon b/toolchain/check/testdata/function/builtin/import.carbon index e86724010b10..863d96d6c3e8 100644 --- a/toolchain/check/testdata/function/builtin/import.carbon +++ b/toolchain/check/testdata/function/builtin/import.carbon @@ -8,6 +8,8 @@ package Core api; +import library "prelude"; + fn Add(a: i32, b: i32) -> i32 = "int.add"; // --- use.carbon @@ -23,10 +25,10 @@ var arr: [i32; Core.Add(1, 2)] = (1, 2, 3); // CHECK:STDOUT: .Add = %Add // CHECK:STDOUT: } // CHECK:STDOUT: %Add: = fn_decl @Add [template] { -// CHECK:STDOUT: %a.loc4_8.1: i32 = param a -// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc4_8.1 -// CHECK:STDOUT: %b.loc4_16.1: i32 = param b -// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc4_16.1 +// CHECK:STDOUT: %a.loc6_8.1: i32 = param a +// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc6_8.1 +// CHECK:STDOUT: %b.loc6_16.1: i32 = param b +// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc6_16.1 // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -53,7 +55,7 @@ var arr: [i32; Core.Add(1, 2)] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+6, loc_11 [template = imports.%Add] +// CHECK:STDOUT: %import_ref: = import_ref ir3, inst+6, loc_11 [template = imports.%Add] // CHECK:STDOUT: %Add.ref: = name_ref Add, %import_ref [template = imports.%Add] // CHECK:STDOUT: %.loc4_25: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc4_28: i32 = int_literal 2 [template = constants.%.2] diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index e27f0fe2c724..2bad14174b48 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -31,9 +31,11 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref.loc11: type = name_ref I, %I.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/function/call/alias.carbon b/toolchain/check/testdata/function/call/alias.carbon index 8bc47b722998..b5d5e55d688d 100644 --- a/toolchain/check/testdata/function/call/alias.carbon +++ b/toolchain/check/testdata/function/call/alias.carbon @@ -20,10 +20,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/empty_struct.carbon b/toolchain/check/testdata/function/call/empty_struct.carbon index 8a04253a22c4..f8f2a4429110 100644 --- a/toolchain/check/testdata/function/call/empty_struct.carbon +++ b/toolchain/check/testdata/function/call/empty_struct.carbon @@ -22,9 +22,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Echo = %Echo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Echo: = fn_decl @Echo [template] { // CHECK:STDOUT: %.loc7_13.1: {} = struct_literal () // CHECK:STDOUT: %.loc7_13.2: type = converted %.loc7_13.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/function/call/empty_tuple.carbon b/toolchain/check/testdata/function/call/empty_tuple.carbon index 7319ca2cf32a..86fcf98e66d1 100644 --- a/toolchain/check/testdata/function/call/empty_tuple.carbon +++ b/toolchain/check/testdata/function/call/empty_tuple.carbon @@ -21,9 +21,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Echo = %Echo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Echo: = fn_decl @Echo [template] { // CHECK:STDOUT: %.loc7_13.1: () = tuple_literal () // CHECK:STDOUT: %.loc7_13.2: type = converted %.loc7_13.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index 923a108f92e7..2acf5dc9559d 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -20,8 +20,10 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 4475d2548781..a8695b7cb160 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -70,11 +70,13 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run0 = %Run0 // CHECK:STDOUT: .Run1 = %Run1 // CHECK:STDOUT: .Run2 = %Run2 // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Run0: = fn_decl @Run0 [template] {} // CHECK:STDOUT: %Run1: = fn_decl @Run1 [template] { // CHECK:STDOUT: %a.loc8_9.1: i32 = param a diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 923a373e6fd6..e3545feda1b2 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -25,9 +25,11 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %a.loc7_6.1: i32 = param a // CHECK:STDOUT: @G.%a: i32 = bind_name a, %a.loc7_6.1 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 c75491d007a9..9a06b12e8b08 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -21,9 +21,11 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %return.var: ref f64 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 432a0e1fc222..39282a10fad3 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -20,9 +20,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Echo = %Echo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Echo: = fn_decl @Echo [template] { // CHECK:STDOUT: %a.loc7_9.1: i32 = param a // CHECK:STDOUT: @Echo.%a: i32 = bind_name a, %a.loc7_9.1 diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 0db309c0f629..ff2571f06382 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -26,9 +26,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index a00be369aa66..898c7cf5b1fb 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -19,9 +19,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 81b0a1ed3286..bcac9aec7062 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -20,9 +20,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 248a16c85a8b..29ad701d6af4 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -20,9 +20,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index 5a1a804c93cd..3209026b53f6 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -21,9 +21,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/call/params_zero.carbon b/toolchain/check/testdata/function/call/params_zero.carbon index 3e8f0912e228..85da1efa4e85 100644 --- a/toolchain/check/testdata/function/call/params_zero.carbon +++ b/toolchain/check/testdata/function/call/params_zero.carbon @@ -18,9 +18,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/return_implicit.carbon b/toolchain/check/testdata/function/call/return_implicit.carbon index 0e54d5cc78ef..d7947b0adb0f 100644 --- a/toolchain/check/testdata/function/call/return_implicit.carbon +++ b/toolchain/check/testdata/function/call/return_implicit.carbon @@ -19,9 +19,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .MakeImplicitEmptyTuple = %MakeImplicitEmptyTuple // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %MakeImplicitEmptyTuple: = fn_decl @MakeImplicitEmptyTuple [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/extern.carbon b/toolchain/check/testdata/function/declaration/extern.carbon index e01cf251b481..b05bfee5227f 100644 --- a/toolchain/check/testdata/function/declaration/extern.carbon +++ b/toolchain/check/testdata/function/declaration/extern.carbon @@ -56,8 +56,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -67,8 +69,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F.loc4 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F.loc4: = fn_decl @F [template] {} // CHECK:STDOUT: %F.loc12: = fn_decl @F [template] {} // CHECK:STDOUT: } @@ -79,8 +83,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F.loc12 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F.loc4: = fn_decl @F [template] {} // CHECK:STDOUT: %F.loc12: = fn_decl @F [template] {} // CHECK:STDOUT: } @@ -96,8 +102,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/fail_modifiers.carbon b/toolchain/check/testdata/function/declaration/fail_modifiers.carbon index 13199a828878..006a566eab66 100644 --- a/toolchain/check/testdata/function/declaration/fail_modifiers.carbon +++ b/toolchain/check/testdata/function/declaration/fail_modifiers.carbon @@ -98,6 +98,7 @@ extern private fn ExternOrderAndConflict() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .WrongOrder = %WrongOrder // CHECK:STDOUT: .DuplicateVirtual = %DuplicateVirtual // CHECK:STDOUT: .TwoAccess = %TwoAccess @@ -106,6 +107,7 @@ extern private fn ExternOrderAndConflict() {} // CHECK:STDOUT: .ModifiersConflict2 = %ModifiersConflict2 // CHECK:STDOUT: .ExternOrderAndConflict = %ExternOrderAndConflict // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %WrongOrder: = fn_decl @WrongOrder [template] {} // CHECK:STDOUT: %DuplicateVirtual: = fn_decl @DuplicateVirtual [template] {} // CHECK:STDOUT: %TwoAccess: = fn_decl @TwoAccess [template] {} 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 e5c86ec5c135..c14e32c51191 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -13,8 +13,10 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %n.loc10_6.1: i32 = param n // CHECK:STDOUT: @F.%n: i32 = bind_name n, %n.loc10_6.1 diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index 3f1047c30110..f91953161f94 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -16,8 +16,10 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %n.loc13_6.1: i32 = param n // CHECK:STDOUT: @F.%n.loc13_6: i32 = bind_name n, %n.loc13_6.1 diff --git a/toolchain/check/testdata/function/declaration/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_redecl.carbon index dc03043204b3..92e78ea5bf65 100644 --- a/toolchain/check/testdata/function/declaration/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_redecl.carbon @@ -57,12 +57,14 @@ fn E() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.loc7 // CHECK:STDOUT: .B = %B.loc17 // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .D = %D.loc37 // CHECK:STDOUT: .E = %E.loc47 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.loc7: = fn_decl @A [template] {} // CHECK:STDOUT: %A.loc15: = fn_decl @A [template] {} // CHECK:STDOUT: %B.loc17: = fn_decl @B [template] { diff --git a/toolchain/check/testdata/function/declaration/fail_todo_modifiers.carbon b/toolchain/check/testdata/function/declaration/fail_todo_modifiers.carbon index 68bd6715c9a7..350059f98849 100644 --- a/toolchain/check/testdata/function/declaration/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/function/declaration/fail_todo_modifiers.carbon @@ -13,8 +13,10 @@ private fn F(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/implicit_import.carbon b/toolchain/check/testdata/function/declaration/implicit_import.carbon index cb53afb014ee..8152a17ae66b 100644 --- a/toolchain/check/testdata/function/declaration/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/implicit_import.carbon @@ -63,8 +63,10 @@ extern fn A(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -74,9 +76,11 @@ extern fn A(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -86,8 +90,10 @@ extern fn A(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -97,9 +103,11 @@ extern fn A(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -109,8 +117,10 @@ extern fn A(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -120,9 +130,11 @@ extern fn A(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 3a99c36eaba7..36d3058cf0ca 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -199,12 +199,14 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: %B: = fn_decl @B [template] { // CHECK:STDOUT: %b.loc5_6.1: i32 = param b @@ -246,12 +248,14 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: %B: = fn_decl @B [template] { // CHECK:STDOUT: %b.loc5_13.1: i32 = param b @@ -300,21 +304,23 @@ import library "extern_api"; // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_15 [template = imports.%A] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+5, loc_24 [template = imports.%B] -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+17, loc_39 [template = imports.%C] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_53 [template = imports.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loc_15 [template = imports.%A] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+6, loc_24 [template = imports.%B] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+18, loc_39 [template = imports.%C] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+19, loc_53 [template = imports.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+20, loc_65 [template = imports.%E] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+21, loc_65 [template = imports.%E] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a @@ -384,6 +390,7 @@ import library "extern_api"; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C @@ -394,15 +401,16 @@ import library "extern_api"; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded [template = imports.%A] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+5, loaded [template = imports.%B] -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+17, loaded [template = imports.%C] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loaded [template = imports.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+6, loaded [template = imports.%B] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+18, loaded [template = imports.%C] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+19, loaded [template = imports.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %E // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+20, loaded [template = imports.%E] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+21, loaded [template = imports.%E] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: %B: = fn_decl @B [template] { // CHECK:STDOUT: %b.loc7_13.1: i32 = param b @@ -488,6 +496,7 @@ import library "extern_api"; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C @@ -498,15 +507,16 @@ import library "extern_api"; // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded [template = imports.%A] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+5, loaded [template = imports.%B] -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+17, loaded [template = imports.%C] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loaded [template = imports.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+6, loaded [template = imports.%B] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+18, loaded [template = imports.%C] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+19, loaded [template = imports.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %E // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+20, loaded [template = imports.%E] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+21, loaded [template = imports.%E] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: %B: = fn_decl @B [template] { // CHECK:STDOUT: %b.loc7_13.1: i32 = param b @@ -595,26 +605,28 @@ import library "extern_api"; // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_19 [template = imports.%A.1] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+5, loc_28 [template = imports.%B.1] -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+17, loc_43 [template = imports.%C.1] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_57 [template = imports.%D.1] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loc_19 [template = imports.%A.1] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+6, loc_28 [template = imports.%B.1] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+18, loc_43 [template = imports.%C.1] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+19, loc_57 [template = imports.%D.1] +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+20, loc_69 [template = imports.%E.1] -// CHECK:STDOUT: %import_ref.7: = import_ref ir3, inst+1, loaded [template = imports.%A.2] -// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+5, loaded [template = imports.%B.2] -// CHECK:STDOUT: %import_ref.9: = import_ref ir3, inst+17, loaded [template = imports.%C.2] -// CHECK:STDOUT: %import_ref.10: = import_ref ir3, inst+18, loaded [template = imports.%D.2] -// CHECK:STDOUT: %import_ref.11: = import_ref ir3, inst+20, loaded [template = imports.%E.2] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+21, loc_69 [template = imports.%E.1] +// CHECK:STDOUT: %import_ref.7: = import_ref ir3, inst+2, loaded [template = imports.%A.2] +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+6, loaded [template = imports.%B.2] +// CHECK:STDOUT: %import_ref.9: = import_ref ir3, inst+18, loaded [template = imports.%C.2] +// CHECK:STDOUT: %import_ref.10: = import_ref ir3, inst+19, loaded [template = imports.%D.2] +// CHECK:STDOUT: %import_ref.11: = import_ref ir3, inst+21, loaded [template = imports.%E.2] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc7_9.2: type = converted %.loc7_9.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref () = var a @@ -697,26 +709,28 @@ import library "extern_api"; // CHECK:STDOUT: .A = imports.%A.2 // CHECK:STDOUT: .B = imports.%B.2 // CHECK:STDOUT: .C = imports.%C.2 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded [template = imports.%A.1] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+5, loaded [template = imports.%B.1] -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+17, loaded [template = imports.%C.1] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_57 [template = imports.%D.1] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded [template = imports.%A.1] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+6, loaded [template = imports.%B.1] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+18, loaded [template = imports.%C.1] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+19, loc_57 [template = imports.%D.1] +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = imports.%E.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+20, loaded [template = imports.%E.1] -// CHECK:STDOUT: %import_ref.7: = import_ref ir3, inst+1, loaded [template = imports.%A.2] -// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+5, loaded [template = imports.%B.2] -// CHECK:STDOUT: %import_ref.9: = import_ref ir3, inst+17, loaded [template = imports.%C.2] -// CHECK:STDOUT: %import_ref.10: = import_ref ir3, inst+18, loaded [template = imports.%D.2] -// CHECK:STDOUT: %import_ref.11: = import_ref ir3, inst+20, loaded [template = imports.%E.2] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+21, loaded [template = imports.%E.1] +// CHECK:STDOUT: %import_ref.7: = import_ref ir3, inst+2, loaded [template = imports.%A.2] +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+6, loaded [template = imports.%B.2] +// CHECK:STDOUT: %import_ref.9: = import_ref ir3, inst+18, loaded [template = imports.%C.2] +// CHECK:STDOUT: %import_ref.10: = import_ref ir3, inst+19, loaded [template = imports.%D.2] +// CHECK:STDOUT: %import_ref.11: = import_ref ir3, inst+21, loaded [template = imports.%E.2] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc7_9.2: type = converted %.loc7_9.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref () = var a @@ -794,18 +808,20 @@ import library "extern_api"; // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_15 [template = imports.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+17, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+18, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loc_15 [template = imports.%A] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+19, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+21, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a @@ -836,17 +852,19 @@ import library "extern_api"; // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_15 [template = imports.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+17, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+18, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loc_15 [template = imports.%A] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+19, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+21, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a @@ -880,18 +898,20 @@ import library "extern_api"; // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_15 [template = imports.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+17, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+18, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loc_15 [template = imports.%A] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+19, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+21, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a @@ -918,16 +938,18 @@ import library "extern_api"; // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+17, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+18, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+19, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+21, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- unloaded_extern.carbon @@ -939,16 +961,18 @@ import library "extern_api"; // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+17, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+18, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+19, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+21, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- loaded_merge.carbon @@ -965,21 +989,23 @@ import library "extern_api"; // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded [template = imports.%A.1] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+5, loaded [template = imports.%B.1] -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+17, loaded [template = imports.%C.1] -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loaded [template = imports.%D.1] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+19, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded [template = imports.%A.1] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+6, loaded [template = imports.%B.1] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+18, loaded [template = imports.%C.1] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+19, loaded [template = imports.%D.1] +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+20, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { // CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+20, loaded [template = imports.%E.1] -// CHECK:STDOUT: %import_ref.7: = import_ref ir3, inst+1, loaded [template = imports.%A.2] -// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+5, loaded [template = imports.%B.2] -// CHECK:STDOUT: %import_ref.9: = import_ref ir3, inst+17, loaded [template = imports.%C.2] -// CHECK:STDOUT: %import_ref.10: = import_ref ir3, inst+18, loaded [template = imports.%D.2] -// CHECK:STDOUT: %import_ref.11: = import_ref ir3, inst+20, loaded [template = imports.%E.2] +// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+21, loaded [template = imports.%E.1] +// CHECK:STDOUT: %import_ref.7: = import_ref ir3, inst+2, loaded [template = imports.%A.2] +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+6, loaded [template = imports.%B.2] +// CHECK:STDOUT: %import_ref.9: = import_ref ir3, inst+18, loaded [template = imports.%C.2] +// CHECK:STDOUT: %import_ref.10: = import_ref ir3, inst+19, loaded [template = imports.%D.2] +// CHECK:STDOUT: %import_ref.11: = import_ref ir3, inst+21, loaded [template = imports.%E.2] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: extern fn @A.1(); diff --git a/toolchain/check/testdata/function/declaration/param_same_name.carbon b/toolchain/check/testdata/function/declaration/param_same_name.carbon index cd7a81a01efa..b3e6b27c4c0b 100644 --- a/toolchain/check/testdata/function/declaration/param_same_name.carbon +++ b/toolchain/check/testdata/function/declaration/param_same_name.carbon @@ -12,9 +12,11 @@ fn G(a: i32); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %a.loc7_6.1: i32 = param a // CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc7_6.1 diff --git a/toolchain/check/testdata/function/declaration/simple.carbon b/toolchain/check/testdata/function/declaration/simple.carbon index 8ec293c75519..acac9aed1bff 100644 --- a/toolchain/check/testdata/function/declaration/simple.carbon +++ b/toolchain/check/testdata/function/declaration/simple.carbon @@ -16,9 +16,11 @@ fn G() { F(); } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/extern.carbon b/toolchain/check/testdata/function/definition/extern.carbon index b65dad2c8ede..3e9c8ad1e265 100644 --- a/toolchain/check/testdata/function/definition/extern.carbon +++ b/toolchain/check/testdata/function/definition/extern.carbon @@ -60,8 +60,10 @@ extern fn F(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -74,8 +76,10 @@ extern fn F(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F.loc12 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F.loc4: = fn_decl @F [template] {} // CHECK:STDOUT: %F.loc12: = fn_decl @F [template] {} // CHECK:STDOUT: } @@ -89,8 +93,10 @@ extern fn F(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F.loc12 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F.loc4: = fn_decl @F [template] {} // CHECK:STDOUT: %F.loc12: = fn_decl @F [template] {} // CHECK:STDOUT: %F.loc13: = fn_decl @F [template] {} @@ -105,8 +111,10 @@ extern fn F(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F.loc4 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F.loc4: = fn_decl @F [template] {} // CHECK:STDOUT: %F.loc11: = fn_decl @F [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon index b671766ff9e1..caf59a7833cc 100644 --- a/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon @@ -72,6 +72,7 @@ fn K() -> bool { return false; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .H = %H @@ -79,6 +80,7 @@ fn K() -> bool { return false; } // CHECK:STDOUT: .J = %J // CHECK:STDOUT: .K = %K // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: %.loc15: = fn_decl @.1 [template] { // CHECK:STDOUT: %x.loc15_6.1: i32 = param x diff --git a/toolchain/check/testdata/function/definition/fail_redef.carbon b/toolchain/check/testdata/function/definition/fail_redef.carbon index 57728cfa7af0..a3ec1c0d5ff3 100644 --- a/toolchain/check/testdata/function/definition/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/fail_redef.carbon @@ -17,8 +17,10 @@ fn F() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F.loc7 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F.loc7: = fn_decl @F [template] {} // CHECK:STDOUT: %F.loc14: = fn_decl @F [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/forward_decl.carbon b/toolchain/check/testdata/function/definition/forward_decl.carbon index 4cf961af1ac4..6f55fd1b2492 100644 --- a/toolchain/check/testdata/function/definition/forward_decl.carbon +++ b/toolchain/check/testdata/function/definition/forward_decl.carbon @@ -12,8 +12,10 @@ fn Foo() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo.loc7 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo.loc7: = fn_decl @Foo [template] {} // CHECK:STDOUT: %Foo.loc9: = fn_decl @Foo [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/implicit_import.carbon b/toolchain/check/testdata/function/definition/implicit_import.carbon index 7bfb2c00c874..c24ed6670d6f 100644 --- a/toolchain/check/testdata/function/definition/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/implicit_import.carbon @@ -101,8 +101,10 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -112,9 +114,11 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -127,8 +131,10 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -138,9 +144,11 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -153,8 +161,10 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -164,9 +174,11 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -179,8 +191,10 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -193,9 +207,11 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -205,8 +221,10 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -219,9 +237,11 @@ fn A() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 9e154a9f2304..eaf4fbd2e838 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -101,11 +101,13 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .D = %D // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: %B: = fn_decl @B [template] { // CHECK:STDOUT: %b.loc5_6.1: i32 = param b @@ -151,8 +153,10 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -174,14 +178,16 @@ fn D() {} // CHECK:STDOUT: .B = %import_ref.2 // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_15 [template = imports.%A] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+6, loc_24 [template = imports.%B] -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+20, loc_39 [template = imports.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+30, unloaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loc_15 [template = imports.%A] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+7, loc_24 [template = imports.%B] +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+21, loc_39 [template = imports.%C] +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+31, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a @@ -224,13 +230,15 @@ fn D() {} // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %import_ref.3 // CHECK:STDOUT: .D = %import_ref.4 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded [template = imports.%A] -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+6, loaded [template = imports.%B] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+20, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+30, unloaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+7, loaded [template = imports.%B] +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+21, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+31, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: %B: = fn_decl @B [template] { // CHECK:STDOUT: %b.loc27_6.1: i32 = param b @@ -250,9 +258,11 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.loc6 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+1, loaded [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+2, loaded [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.loc6: = fn_decl @A [template] {} // CHECK:STDOUT: %A.loc7: = fn_decl @A [template] {} // CHECK:STDOUT: } @@ -269,12 +279,14 @@ fn D() {} // CHECK:STDOUT: .A = %import_ref.1 // CHECK:STDOUT: .B = %import_ref.2 // CHECK:STDOUT: .C = %import_ref.3 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .D = %D.loc13 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+20, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+30, loaded [template = imports.%D] +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+7, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+21, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+31, loaded [template = imports.%D] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %D.loc6: = fn_decl @D [template] {} // CHECK:STDOUT: %D.loc13: = fn_decl @D [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/order.carbon b/toolchain/check/testdata/function/definition/order.carbon index 73c9ef5637a7..c0c5b8a255aa 100644 --- a/toolchain/check/testdata/function/definition/order.carbon +++ b/toolchain/check/testdata/function/definition/order.carbon @@ -12,10 +12,12 @@ fn Baz() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Bar = %Bar // CHECK:STDOUT: .Baz = %Baz // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] {} // CHECK:STDOUT: %Bar: = fn_decl @Bar [template] {} // CHECK:STDOUT: %Baz: = fn_decl @Baz [template] {} diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index d9fff746ee9f..26fd010d4410 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -10,8 +10,10 @@ fn Foo(a: i32) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/definition/params_one_comma.carbon b/toolchain/check/testdata/function/definition/params_one_comma.carbon index 23dfbcd3f54e..00452ccbb212 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -10,8 +10,10 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index 0f5b0f6eb9d1..fe868415bc05 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -10,8 +10,10 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/definition/params_two_comma.carbon b/toolchain/check/testdata/function/definition/params_two_comma.carbon index be3b3e796cbb..6718329f7e29 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -10,8 +10,10 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %a.loc7_8.1: i32 = param a // CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1 diff --git a/toolchain/check/testdata/function/definition/params_zero.carbon b/toolchain/check/testdata/function/definition/params_zero.carbon index 468306f0a8c2..d2c2beec4e70 100644 --- a/toolchain/check/testdata/function/definition/params_zero.carbon +++ b/toolchain/check/testdata/function/definition/params_zero.carbon @@ -10,8 +10,10 @@ fn Foo() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: 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 ba53c43fa8ec..17bba33502fe 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 @@ -13,8 +13,10 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %N.loc10_6.1: i32 = param N // CHECK:STDOUT: @F.%N: i32 = bind_symbolic_name N, %N.loc10_6.1 [symbolic] diff --git a/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon index 61feb8299792..59ddefe14eb8 100644 --- a/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/fail_type_param_mismatch.carbon @@ -20,8 +20,10 @@ fn F(T:! type, U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %T.loc7_6.1: type = param T // CHECK:STDOUT: @F.%T: type = bind_symbolic_name T, %T.loc7_6.1 [symbolic] diff --git a/toolchain/check/testdata/function/generic/type_param.carbon b/toolchain/check/testdata/function/generic/type_param.carbon index 850761067f84..a476da992b19 100644 --- a/toolchain/check/testdata/function/generic/type_param.carbon +++ b/toolchain/check/testdata/function/generic/type_param.carbon @@ -17,8 +17,10 @@ fn F(T:! type) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %T.loc7_6.1: type = param T // CHECK:STDOUT: @F.%T: type = bind_symbolic_name T, %T.loc7_6.1 [symbolic] diff --git a/toolchain/check/testdata/function/generic/type_param_scope.carbon b/toolchain/check/testdata/function/generic/type_param_scope.carbon index 5d1e5782fee1..e3dd4308445d 100644 --- a/toolchain/check/testdata/function/generic/type_param_scope.carbon +++ b/toolchain/check/testdata/function/generic/type_param_scope.carbon @@ -13,8 +13,10 @@ fn F(T:! type, n: T) -> T { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %T.loc7_6.1: type = param T // CHECK:STDOUT: @F.%T: type = bind_symbolic_name T, %T.loc7_6.1 [symbolic] diff --git a/toolchain/check/testdata/global/class_obj.carbon b/toolchain/check/testdata/global/class_obj.carbon index acc58a1d0423..1f81995f57e9 100644 --- a/toolchain/check/testdata/global/class_obj.carbon +++ b/toolchain/check/testdata/global/class_obj.carbon @@ -19,9 +19,11 @@ var a: A = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref A = var a diff --git a/toolchain/check/testdata/global/class_with_fun.carbon b/toolchain/check/testdata/global/class_with_fun.carbon index 452ddea5f757..513a58d53e24 100644 --- a/toolchain/check/testdata/global/class_with_fun.carbon +++ b/toolchain/check/testdata/global/class_with_fun.carbon @@ -23,10 +23,12 @@ var a: A = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .ret_a = %ret_a // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %ret_a: = fn_decl @ret_a [template] { // CHECK:STDOUT: %A.ref.loc8: type = name_ref A, %A.decl [template = constants.%A] diff --git a/toolchain/check/testdata/global/decl.carbon b/toolchain/check/testdata/global/decl.carbon index 6ce083240b58..0f33fd875bf6 100644 --- a/toolchain/check/testdata/global/decl.carbon +++ b/toolchain/check/testdata/global/decl.carbon @@ -9,8 +9,10 @@ var a: i32; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index 0acb56a57ced..96664a8ac354 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -13,8 +13,10 @@ var a: i32 = 0; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index 01ba0bea6b1a..1397ada77fd7 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -18,9 +18,11 @@ var a: i32 = test_a(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .test_a = %test_a // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %test_a: = fn_decl @test_a [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/else.carbon b/toolchain/check/testdata/if/else.carbon index 451b33aa1753..9ba822e1f266 100644 --- a/toolchain/check/testdata/if/else.carbon +++ b/toolchain/check/testdata/if/else.carbon @@ -25,11 +25,13 @@ fn If(b: bool) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .H = %H // CHECK:STDOUT: .If = %If // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] {} // CHECK:STDOUT: %H: = fn_decl @H [template] {} diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index b088be5015b4..8d8feaaec23d 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -44,10 +44,12 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .If1 = %If1 // CHECK:STDOUT: .If2 = %If2 // CHECK:STDOUT: .If3 = %If3 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %If1: = fn_decl @If1 [template] { // CHECK:STDOUT: %b.loc7_8.1: bool = param b // CHECK:STDOUT: @If1.%b: bool = bind_name b, %b.loc7_8.1 diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index f40b524fef0f..486f9c497a92 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -23,8 +23,10 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .VarScope = %VarScope // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %VarScope: = fn_decl @VarScope [template] { // CHECK:STDOUT: %b.loc7_13.1: bool = param b // CHECK:STDOUT: @VarScope.%b: bool = bind_name b, %b.loc7_13.1 diff --git a/toolchain/check/testdata/if/no_else.carbon b/toolchain/check/testdata/if/no_else.carbon index 3e9dd753865f..7c0f0d8ae711 100644 --- a/toolchain/check/testdata/if/no_else.carbon +++ b/toolchain/check/testdata/if/no_else.carbon @@ -22,10 +22,12 @@ fn If(b: bool) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .If = %If // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] {} // CHECK:STDOUT: %If: = fn_decl @If [template] { diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index da8efe48195d..a14c1221d9c4 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -22,8 +22,10 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .If = %If // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %If: = fn_decl @If [template] { // CHECK:STDOUT: %b.loc7_7.1: bool = param b // CHECK:STDOUT: @If.%b: bool = bind_name b, %b.loc7_7.1 diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 96b2b46d53d4..ea87c08d6bf8 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -22,8 +22,10 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %b.loc7_6.1: bool = param b // CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc7_6.1 diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index 31ae362a4b32..9a0dc84a50f5 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -39,6 +39,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .F = %F @@ -46,6 +47,7 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: .Constant = %Constant // CHECK:STDOUT: .PartiallyConstant = %PartiallyConstant // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] { // CHECK:STDOUT: %return.var.loc7: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index f0139e9af3fc..3b36c7478755 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -20,10 +20,12 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] { // CHECK:STDOUT: %return.var.loc7: ref i32 = var // 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 bd5c08fc7160..8d8c678cc783 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -56,6 +56,6 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = +// CHECK:STDOUT: .n = // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index e32a7c61e6f0..c807e24a62b7 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -43,8 +43,10 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .ConditionIsNonConstant = %ConditionIsNonConstant // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %ConditionIsNonConstant: = fn_decl @ConditionIsNonConstant [template] { // CHECK:STDOUT: %b.loc4_27.1: bool = param b // CHECK:STDOUT: @ConditionIsNonConstant.%b: bool = bind_name b, %b.loc4_27.1 @@ -81,8 +83,10 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .ChosenBranchIsNonConstant = %ChosenBranchIsNonConstant // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %ChosenBranchIsNonConstant: = fn_decl @ChosenBranchIsNonConstant [template] { // CHECK:STDOUT: %t.loc4_30.1: type = param t // CHECK:STDOUT: @ChosenBranchIsNonConstant.%t: type = bind_name t, %t.loc4_30.1 diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index 084d58d479a6..51f7d7ed1d46 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -19,8 +19,10 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %a.loc7_6.1: bool = param a // CHECK:STDOUT: @F.%a: bool = bind_name a, %a.loc7_6.1 diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 05b5c0eeb666..a934d50ccfdf 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -24,9 +24,11 @@ fn F(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %.loc7: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] // CHECK:STDOUT: %s.loc7_6.1: {.a: i32, .b: i32} = param s diff --git a/toolchain/check/testdata/impl/basic.carbon b/toolchain/check/testdata/impl/basic.carbon index 72776bc07eaf..dcf51fa64730 100644 --- a/toolchain/check/testdata/impl/basic.carbon +++ b/toolchain/check/testdata/impl/basic.carbon @@ -23,8 +23,10 @@ impl i32 as Simple { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index 5784ee0ec157..9ed96040ec61 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -44,12 +44,14 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: .NonInstanceCall = %NonInstanceCall // CHECK:STDOUT: .InstanceCall = %InstanceCall // CHECK:STDOUT: .NonInstanceCallIndirect = %NonInstanceCallIndirect // CHECK:STDOUT: .InstanceCallIndirect = %InstanceCallIndirect // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/impl/declaration.carbon b/toolchain/check/testdata/impl/declaration.carbon index da7d90100b4a..75e613ee0580 100644 --- a/toolchain/check/testdata/impl/declaration.carbon +++ b/toolchain/check/testdata/impl/declaration.carbon @@ -16,8 +16,10 @@ impl i32 as I; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/impl/empty.carbon b/toolchain/check/testdata/impl/empty.carbon index 4035e4422bcf..545ca515265f 100644 --- a/toolchain/check/testdata/impl/empty.carbon +++ b/toolchain/check/testdata/impl/empty.carbon @@ -19,8 +19,10 @@ impl i32 as Empty { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, %Empty.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index 24a094f9df09..a2be15c524e7 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -34,10 +34,12 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { @@ -74,7 +76,7 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1(); diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 6bda7c20c28f..44417056f71a 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -29,9 +29,11 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: .InstanceCall = %InstanceCall // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index 87523c16389c..841451de76dc 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -41,9 +41,11 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .GenericInterface = %GenericInterface.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %GenericInterface.decl: type = interface_decl @GenericInterface [template = constants.%.1] { // CHECK:STDOUT: %T.loc11_28.1: type = param T // CHECK:STDOUT: %T.loc11_28.2: type = bind_symbolic_name T, %T.loc11_28.1 [symbolic] diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index f01f9d89bd49..9f29a2e964fb 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -20,8 +20,10 @@ extend impl i32 as I {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] 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 1a0a96018f2d..e4cd81ccde10 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -48,11 +48,13 @@ class E { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: .E = %E.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} @@ -101,7 +103,7 @@ class E { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @E { @@ -112,6 +114,6 @@ class E { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%E -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index 48291afbae5c..8900ddd14b18 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -20,8 +20,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: 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 93f0083e5292..e8c6ef669e76 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -26,8 +26,10 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index 97cb59a0075a..59558b9afce4 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -26,9 +26,11 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index d15a4df7007c..a82c50c2023b 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -26,8 +26,10 @@ impl as Simple { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] 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 7b77d0c30137..3ff9e9353571 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon @@ -21,8 +21,10 @@ impl bool as I {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] 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 7a27832e9418..97c0bf7dd267 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -260,6 +260,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .NoF = %NoF.decl // CHECK:STDOUT: .FNotFunction = %FNotFunction.decl @@ -280,6 +281,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: .SelfNestedBadParam = %SelfNestedBadParam.decl // CHECK:STDOUT: .SelfNestedBadReturnType = %SelfNestedBadReturnType.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %NoF.decl: type = class_decl @NoF [template = constants.%NoF] {} // CHECK:STDOUT: %FNotFunction.decl: type = class_decl @FNotFunction [template = constants.%FNotFunction] {} diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index 7ba6873ff0df..6b86a0276053 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -20,7 +20,10 @@ impl i32 as false {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %.loc14: bool = bool_literal false [template = constants.%.1] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/fail_impl_bad_type.carbon index 4fd4c8b5653c..e8297660acc5 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_type.carbon @@ -21,8 +21,10 @@ impl true as I {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %.loc12: bool = bool_literal true [template = constants.%.2] diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index ced8f75d5a48..4365ab16d75f 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -25,8 +25,10 @@ impl i32 as I {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, %I.decl [template = constants.%.1] @@ -46,6 +48,6 @@ impl i32 as I {} // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = +// CHECK:STDOUT: witness = // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon index ffdcf26d9c88..e06b41f656fd 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -21,8 +21,10 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index 258bf5520bea..668a955dfc9b 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -33,9 +33,11 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/impl_forall.carbon b/toolchain/check/testdata/impl/impl_forall.carbon index 17201f991b12..3eac5a46aea3 100644 --- a/toolchain/check/testdata/impl/impl_forall.carbon +++ b/toolchain/check/testdata/impl/impl_forall.carbon @@ -23,8 +23,10 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Simple = %Simple.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %T.loc11_14.1: type = param T diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index 1169f3958ca8..834ef3f54ae5 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -36,10 +36,12 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { 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 672f8496649c..7cab372c6c47 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 @@ -38,10 +38,12 @@ fn F(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %F: = fn_decl @F.2 [template] { 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 62032245efc6..2ed4970fcc64 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -37,10 +37,12 @@ impl C as I { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %F: = fn_decl @F.2 [template] { @@ -79,7 +81,7 @@ impl C as I { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1(); diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index c211781f708e..2a11a0f2559b 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -39,9 +39,11 @@ fn G(c: Impl.C) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .HasF = %HasF.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { @@ -92,31 +94,33 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %.4: type = ptr_type {} [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @HasF, [template] // CHECK:STDOUT: %.6: in HasF> = assoc_entity element0, file.%import_ref.8 [template] -// CHECK:STDOUT: %.7: = interface_witness () [template] +// CHECK:STDOUT: %.7: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Impl = %Impl +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } // CHECK:STDOUT: %Impl: = namespace [template] {} +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: invalid = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+10, unloaded // CHECK:STDOUT: %HasF.decl: invalid = interface_decl @HasF [template = constants.%.2] {} -// CHECK:STDOUT: %import_ref.2: in HasF> = import_ref ir2, inst+6, loc_20 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+4, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+15, loc_22 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: type = import_ref ir2, inst+8, loc_10 [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: in HasF> = import_ref ir2, inst+7, loc_20 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+5, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+16, loc_22 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: type = import_ref ir2, inst+9, loc_10 [template = constants.%C] // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %Impl.ref: = name_ref Impl, %Impl [template = %Impl] // CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.6 [template = constants.%C] // CHECK:STDOUT: %c.loc4_6.1: C = param c // CHECK:STDOUT: @G.%c: C = bind_name c, %c.loc4_6.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+4, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+2, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+5, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { @@ -139,7 +143,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %Impl.ref: = name_ref Impl, file.%Impl [template = file.%Impl] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, file.%import_ref.7 [template = constants.%.2] // CHECK:STDOUT: %F.ref: in HasF> = name_ref F, file.%import_ref.2 [template = constants.%.6] -// CHECK:STDOUT: %.1: = interface_witness_access file.%import_ref.5, element0 [template = ] +// CHECK:STDOUT: %.1: = interface_witness_access file.%import_ref.5, element0 [template = ] // CHECK:STDOUT: %.loc5: init () = call %.1() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 2fa96a6de97b..ab96e69b28ca 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -35,10 +35,12 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl.loc7 // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl.loc7: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl.loc13: type = class_decl @C [template = constants.%C] {} @@ -89,7 +91,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: extend name_scope1 +// CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F.1[@I.%self.loc10_8.2: Self]() -> i32; diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index acce07898982..804912352fdb 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -25,9 +25,11 @@ impl i32 as I {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .X = %X.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %I.ref.loc9: type = name_ref I, %I.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/impl/self_in_class.carbon b/toolchain/check/testdata/impl/self_in_class.carbon index 17d812e43046..2774cef49002 100644 --- a/toolchain/check/testdata/impl/self_in_class.carbon +++ b/toolchain/check/testdata/impl/self_in_class.carbon @@ -30,9 +30,11 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .DefaultConstructible = %DefaultConstructible.decl // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %DefaultConstructible.decl: type = interface_decl @DefaultConstructible [template = constants.%.1] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/self_in_signature.carbon b/toolchain/check/testdata/impl/self_in_signature.carbon index 02724efc3b40..28d626e9e332 100644 --- a/toolchain/check/testdata/impl/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/self_in_signature.carbon @@ -66,11 +66,13 @@ impl D as SelfNested { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .UseSelf = %UseSelf.decl // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: .SelfNested = %SelfNested.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 272b57f1e244..2f44387fda63 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -25,11 +25,13 @@ var d: i32 = a[b]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_14: i32 = int_literal 2 [template = constants.%.1] // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 2] = var a diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 11cfc0f3ff19..21632dd49be4 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -41,10 +41,12 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .ValueBinding = %ValueBinding // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_17: i32 = int_literal 3 [template = constants.%.1] // CHECK:STDOUT: %.loc7_18: type = array_type %.loc7_17, i32 [template = constants.%.2] diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index fb46637c4e69..c6478187a5fb 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -32,10 +32,12 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 1] = var a 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 5db754a6eb96..ac436fa90fcd 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -25,9 +25,11 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 1] = var a 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 fcf6604c7fe6..66a47326f345 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 @@ -24,9 +24,11 @@ var b: i32 = a[1]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref [i32; 1] = var a diff --git a/toolchain/check/testdata/index/fail_empty_tuple_access.carbon b/toolchain/check/testdata/index/fail_empty_tuple_access.carbon index 2ea2debbbffd..e1f240e3082a 100644 --- a/toolchain/check/testdata/index/fail_empty_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_empty_tuple_access.carbon @@ -22,9 +22,11 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index bcef6a784f33..737e84bc4aeb 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -45,9 +45,11 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_17: i32 = int_literal 3 [template = constants.%.1] // CHECK:STDOUT: %.loc7_18: type = array_type %.loc7_17, i32 [template = constants.%.2] diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 703d57122aba..0dd6e504c3f6 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -42,6 +42,7 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .N = %N // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .F = %F @@ -49,6 +50,7 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %N: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index 99aafdd6c9e7..04b18eab1fb2 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -19,8 +19,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 4135c2334f8c..edd01cdd40af 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -5,7 +5,12 @@ // AUTOUPDATE var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: ERROR: Semantics TODO: `missing or invalid operator interface`. +// TODO: Only diagnose this once, and make the diagnostic clearer. +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+7]]:16: ERROR: Name `Negate` not found. +// CHECK:STDERR: var b: i32 = a[-10]; +// CHECK:STDERR: ^~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: ERROR: Semantics TODO: `missing or invalid operator interface, also avoid duplicate diagnostic if prelude is unavailable`. // CHECK:STDERR: var b: i32 = a[-10]; // CHECK:STDERR: ^~~ var b: i32 = a[-10]; @@ -24,9 +29,11 @@ var b: i32 = a[-10]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32, i32) = var a @@ -48,8 +55,8 @@ var b: i32 = a[-10]; // CHECK:STDOUT: %.loc7_27.7: init (i32, i32) = converted %.loc7_27.1, %.loc7_27.6 [template = constants.%.6] // CHECK:STDOUT: assign file.%a.var, %.loc7_27.7 // CHECK:STDOUT: %a.ref: ref (i32, i32) = name_ref a, file.%a -// CHECK:STDOUT: %.loc11_17: i32 = int_literal 10 [template = constants.%.7] -// CHECK:STDOUT: %.loc11_19: ref = tuple_index %a.ref, +// CHECK:STDOUT: %.loc16_17: i32 = int_literal 10 [template = constants.%.7] +// CHECK:STDOUT: %.loc16_19: ref = tuple_index %a.ref, // CHECK:STDOUT: assign file.%b.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon index 82ece99458b5..14160ae5fa94 100644 --- a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon @@ -25,10 +25,12 @@ var c: i32 = a[b]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32, i32) = var a diff --git a/toolchain/check/testdata/index/fail_non_tuple_access.carbon b/toolchain/check/testdata/index/fail_non_tuple_access.carbon index a59172fdc74c..627188eac010 100644 --- a/toolchain/check/testdata/index/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_non_tuple_access.carbon @@ -20,8 +20,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/index/fail_out_of_bound_not_literal.carbon index ac2124596f55..c1b5667fa155 100644 --- a/toolchain/check/testdata/index/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/index/fail_out_of_bound_not_literal.carbon @@ -26,9 +26,11 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32, i32) = var a diff --git a/toolchain/check/testdata/index/fail_tuple_index_error.carbon b/toolchain/check/testdata/index/fail_tuple_index_error.carbon index a4feb97aa914..3cdd471b3e01 100644 --- a/toolchain/check/testdata/index/fail_tuple_index_error.carbon +++ b/toolchain/check/testdata/index/fail_tuple_index_error.carbon @@ -23,9 +23,11 @@ var b: i32 = a[oops]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32, i32) = var a diff --git a/toolchain/check/testdata/index/fail_tuple_large_index.carbon b/toolchain/check/testdata/index/fail_tuple_large_index.carbon index 5a3cacc9f79d..97a3dcf7429d 100644 --- a/toolchain/check/testdata/index/fail_tuple_large_index.carbon +++ b/toolchain/check/testdata/index/fail_tuple_large_index.carbon @@ -29,11 +29,13 @@ var d: i32 = b[0x7FFF_FFFF]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_13.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_13.2: type = converted %.loc7_13.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32,) = var a diff --git a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon index a32bb7ac5abe..a4930172cb2b 100644 --- a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon @@ -24,9 +24,11 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32, i32) = var a diff --git a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon index eb425f95e938..9d53907159e0 100644 --- a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon @@ -24,9 +24,11 @@ var b: i32 = a[2]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32, i32) = var a diff --git a/toolchain/check/testdata/index/index_not_literal.carbon b/toolchain/check/testdata/index/index_not_literal.carbon index 15300c9ff41b..5e9d40fb8773 100644 --- a/toolchain/check/testdata/index/index_not_literal.carbon +++ b/toolchain/check/testdata/index/index_not_literal.carbon @@ -23,9 +23,11 @@ var b: i32 = a[{.index = 1}.index]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32, i32) = var a diff --git a/toolchain/check/testdata/index/tuple_element_access.carbon b/toolchain/check/testdata/index/tuple_element_access.carbon index 3a9096788fa1..14fda22a65da 100644 --- a/toolchain/check/testdata/index/tuple_element_access.carbon +++ b/toolchain/check/testdata/index/tuple_element_access.carbon @@ -20,10 +20,12 @@ var c: i32 = b[0]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_13.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_13.2: type = converted %.loc7_13.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32,) = var a diff --git a/toolchain/check/testdata/index/tuple_return_value_access.carbon b/toolchain/check/testdata/index/tuple_return_value_access.carbon index e7ace64e4e27..1c20097d61ab 100644 --- a/toolchain/check/testdata/index/tuple_return_value_access.carbon +++ b/toolchain/check/testdata/index/tuple_return_value_access.carbon @@ -21,9 +21,11 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_16.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_16.2: type = converted %.loc7_16.1, constants.%.2 [template = constants.%.2] diff --git a/toolchain/check/testdata/interface/as_type.carbon b/toolchain/check/testdata/interface/as_type.carbon index 61da77ef563a..2770043dea4e 100644 --- a/toolchain/check/testdata/interface/as_type.carbon +++ b/toolchain/check/testdata/interface/as_type.carbon @@ -17,9 +17,11 @@ fn F(e: Empty) {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, %Empty.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/interface/as_type_of_type.carbon b/toolchain/check/testdata/interface/as_type_of_type.carbon index 96b90ea21c2c..aa4a6827d2e8 100644 --- a/toolchain/check/testdata/interface/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/as_type_of_type.carbon @@ -19,9 +19,11 @@ fn F(T:! Empty) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, %Empty.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/interface/assoc_const.carbon b/toolchain/check/testdata/interface/assoc_const.carbon index 052fca98e22b..009f14919c92 100644 --- a/toolchain/check/testdata/interface/assoc_const.carbon +++ b/toolchain/check/testdata/interface/assoc_const.carbon @@ -21,8 +21,10 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/basic.carbon b/toolchain/check/testdata/interface/basic.carbon index 3122f7287e4f..5972928224fa 100644 --- a/toolchain/check/testdata/interface/basic.carbon +++ b/toolchain/check/testdata/interface/basic.carbon @@ -24,9 +24,11 @@ interface ForwardDeclared { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl.loc10 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} // CHECK:STDOUT: %ForwardDeclared.decl.loc10: type = interface_decl @ForwardDeclared [template = constants.%.2] {} // CHECK:STDOUT: %ForwardDeclared.decl.loc12: type = interface_decl @ForwardDeclared [template = constants.%.2] {} diff --git a/toolchain/check/testdata/interface/default_fn.carbon b/toolchain/check/testdata/interface/default_fn.carbon index 9c8660c37aa2..58ea8406a392 100644 --- a/toolchain/check/testdata/interface/default_fn.carbon +++ b/toolchain/check/testdata/interface/default_fn.carbon @@ -35,8 +35,10 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon b/toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon index 83269e21b492..b9a521f04437 100644 --- a/toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon +++ b/toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon @@ -37,9 +37,11 @@ interface Outer { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: .Outer = %Outer.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: %F: = fn_decl @F.1 [template] {} // CHECK:STDOUT: %Outer.decl: type = interface_decl @Outer [template = constants.%.2] {} 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 64e4988db90e..9f16ea4ddd68 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -22,8 +22,10 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon b/toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon index 550edcd25111..85324648ab59 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon @@ -21,7 +21,7 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = +// CHECK:STDOUT: .Self = // CHECK:STDOUT: witness = invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon b/toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon index 01571e9f7808..67544156bb0a 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon @@ -25,10 +25,12 @@ alias UseOther = I.other; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .UseA = %UseA // CHECK:STDOUT: .UseOther = %UseOther // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.1] // CHECK:STDOUT: %a.ref: = name_ref a, [template = ] diff --git a/toolchain/check/testdata/interface/fail_assoc_const_template.carbon b/toolchain/check/testdata/interface/fail_assoc_const_template.carbon index c159e180a490..4c8fd62a92f0 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_template.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_template.carbon @@ -21,7 +21,7 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = +// CHECK:STDOUT: .Self = // CHECK:STDOUT: witness = invalid // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_duplicate.carbon b/toolchain/check/testdata/interface/fail_duplicate.carbon index e422e21a28be..667ec7be98b5 100644 --- a/toolchain/check/testdata/interface/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/fail_duplicate.carbon @@ -49,10 +49,12 @@ interface Class { } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Interface = %Interface.decl.loc7 // CHECK:STDOUT: .Function = %Function // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Interface.decl.loc7: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: %Interface.decl.loc16: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: %Function: = fn_decl @Function [template] {} @@ -66,7 +68,7 @@ interface Class { } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .F = -// CHECK:STDOUT: .Self = +// CHECK:STDOUT: .Self = // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/fail_lookup_undefined.carbon index 024407be9a57..d72b150805de 100644 --- a/toolchain/check/testdata/interface/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/fail_lookup_undefined.carbon @@ -56,10 +56,12 @@ interface BeingDefined { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Undefined = %Undefined.decl // CHECK:STDOUT: .Test = %Test // CHECK:STDOUT: .BeingDefined = %BeingDefined.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Undefined.decl: type = interface_decl @Undefined [template = constants.%.1] {} // CHECK:STDOUT: %.loc16: = fn_decl @.1 [template] {} // CHECK:STDOUT: %Test: = fn_decl @Test [template] {} diff --git a/toolchain/check/testdata/interface/fail_member_lookup.carbon b/toolchain/check/testdata/interface/fail_member_lookup.carbon index 1b83ce087713..fe70af148546 100644 --- a/toolchain/check/testdata/interface/fail_member_lookup.carbon +++ b/toolchain/check/testdata/interface/fail_member_lookup.carbon @@ -35,9 +35,11 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: %F: = fn_decl @F.2 [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/fail_modifiers.carbon b/toolchain/check/testdata/interface/fail_modifiers.carbon index b6b9cab4b00e..95a9fb2bae13 100644 --- a/toolchain/check/testdata/interface/fail_modifiers.carbon +++ b/toolchain/check/testdata/interface/fail_modifiers.carbon @@ -40,11 +40,13 @@ protected interface Protected; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Abstract = %Abstract.decl // CHECK:STDOUT: .Default = %Default.decl // CHECK:STDOUT: .Virtual = %Virtual.decl // CHECK:STDOUT: .Protected = %Protected.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Abstract.decl: type = interface_decl @Abstract [template = constants.%.1] {} // CHECK:STDOUT: %Default.decl: type = interface_decl @Default [template = constants.%.2] {} // CHECK:STDOUT: %Virtual.decl: type = interface_decl @Virtual [template = constants.%.3] {} diff --git a/toolchain/check/testdata/interface/fail_redeclare_member.carbon b/toolchain/check/testdata/interface/fail_redeclare_member.carbon index 7ac8967bfb74..379196979f5d 100644 --- a/toolchain/check/testdata/interface/fail_redeclare_member.carbon +++ b/toolchain/check/testdata/interface/fail_redeclare_member.carbon @@ -25,8 +25,10 @@ interface Interface { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 181c5f40f7e6..9688bfbfd401 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -31,8 +31,10 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index bd7f6889cc5a..444e54cfaed4 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 @@ -28,8 +28,10 @@ interface Interface { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 15c0c80b7989..eb4a859743c2 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 @@ -46,8 +46,10 @@ fn Interface.G(a: i32, b: i32) -> i32 = "int.add"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: %.loc28: = fn_decl @.1 [template] {} // CHECK:STDOUT: %.loc36: = fn_decl @.2 [template] { diff --git a/toolchain/check/testdata/interface/fail_todo_facet_lookup.carbon b/toolchain/check/testdata/interface/fail_todo_facet_lookup.carbon index de03b23c0d7e..12d144098bbd 100644 --- a/toolchain/check/testdata/interface/fail_todo_facet_lookup.carbon +++ b/toolchain/check/testdata/interface/fail_todo_facet_lookup.carbon @@ -32,10 +32,12 @@ fn CallFacet(T:! Interface, x: T) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Interface = %Interface.decl // CHECK:STDOUT: .CallStatic = %CallStatic // CHECK:STDOUT: .CallFacet = %CallFacet // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: %CallStatic: = fn_decl @CallStatic [template] { // CHECK:STDOUT: %Interface.ref.loc9: type = name_ref Interface, %Interface.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/interface/fail_todo_generic.carbon b/toolchain/check/testdata/interface/fail_todo_generic.carbon index d27f11092277..5eb015689a50 100644 --- a/toolchain/check/testdata/interface/fail_todo_generic.carbon +++ b/toolchain/check/testdata/interface/fail_todo_generic.carbon @@ -21,8 +21,10 @@ interface I[](); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_modifiers.carbon b/toolchain/check/testdata/interface/fail_todo_modifiers.carbon index 9f440b41dee4..69baf0f4d264 100644 --- a/toolchain/check/testdata/interface/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/interface/fail_todo_modifiers.carbon @@ -35,9 +35,11 @@ private interface Private { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Modifiers = %Modifiers.decl // CHECK:STDOUT: .Private = %Private.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Modifiers.decl: type = interface_decl @Modifiers [template = constants.%.1] {} // CHECK:STDOUT: %Private.decl: type = interface_decl @Private [template = constants.%.5] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/import.carbon b/toolchain/check/testdata/interface/import.carbon index 0acc72499141..e9353446ffef 100644 --- a/toolchain/check/testdata/interface/import.carbon +++ b/toolchain/check/testdata/interface/import.carbon @@ -64,11 +64,13 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Empty = %Empty.decl // CHECK:STDOUT: .Basic = %Basic.decl // CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl.loc12 // CHECK:STDOUT: .f_ref = %f_ref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} // CHECK:STDOUT: %Basic.decl: type = interface_decl @Basic [template = constants.%.2] {} // CHECK:STDOUT: %ForwardDeclared.decl.loc12: type = interface_decl @ForwardDeclared [template = constants.%.7] {} @@ -145,6 +147,7 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: .Basic = %import_ref.2 // CHECK:STDOUT: .ForwardDeclared = %import_ref.3 // CHECK:STDOUT: .f_ref = %import_ref.4 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .UseEmpty = %UseEmpty // CHECK:STDOUT: .UseBasic = %UseBasic // CHECK:STDOUT: .UseForwardDeclared = %UseForwardDeclared @@ -154,33 +157,34 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: .UseForwardDeclaredF = %UseForwardDeclaredF // CHECK:STDOUT: .f = %f.loc16 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_13 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+4, loc_22 [template = constants.%.3] -// CHECK:STDOUT: %import_ref.3: type = import_ref ir2, inst+15, loc_31 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.4: ref {.f: ForwardDeclared} = import_ref ir2, inst+36, loc_70 -// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+2, loc_13 [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+5, loc_22 [template = constants.%.3] +// CHECK:STDOUT: %import_ref.3: type = import_ref ir2, inst+16, loc_31 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.4: ref {.f: ForwardDeclared} = import_ref ir2, inst+37, loc_70 +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+4, unloaded // CHECK:STDOUT: %UseEmpty: = fn_decl @UseEmpty [template] { // CHECK:STDOUT: %Empty.decl: invalid = interface_decl @Empty [template = constants.%.1] {} // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, %import_ref.1 [template = constants.%.1] // CHECK:STDOUT: %e.loc6_13.1: Empty = param e // CHECK:STDOUT: @UseEmpty.%e: Empty = bind_name e, %e.loc6_13.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+6, unloaded -// CHECK:STDOUT: %import_ref.7: in Basic> = import_ref ir2, inst+13, loc_48 [template = constants.%.8] -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+9, loc_41 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+11, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+7, unloaded +// CHECK:STDOUT: %import_ref.7: in Basic> = import_ref ir2, inst+14, loc_48 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+10, loc_41 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+8, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+12, unloaded // CHECK:STDOUT: %UseBasic: = fn_decl @UseBasic [template] { // CHECK:STDOUT: %Basic.decl: invalid = interface_decl @Basic [template = constants.%.3] {} // CHECK:STDOUT: %Basic.ref.loc7: type = name_ref Basic, %import_ref.2 [template = constants.%.3] // CHECK:STDOUT: %e.loc7_13.1: Basic = param e // CHECK:STDOUT: @UseBasic.%e: Basic = bind_name e, %e.loc7_13.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+18, unloaded -// CHECK:STDOUT: %import_ref.12: in ForwardDeclared> = import_ref ir2, inst+25, loc_62 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.13: = import_ref ir2, inst+21, loc_55 [template = constants.%.10] -// CHECK:STDOUT: %import_ref.14 = import_ref ir2, inst+19, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref ir2, inst+23, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+19, unloaded +// CHECK:STDOUT: %import_ref.12: in ForwardDeclared> = import_ref ir2, inst+26, loc_62 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.13: = import_ref ir2, inst+22, loc_55 [template = constants.%.10] +// CHECK:STDOUT: %import_ref.14 = import_ref ir2, inst+20, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref ir2, inst+24, unloaded // CHECK:STDOUT: %UseForwardDeclared: = fn_decl @UseForwardDeclared [template] { // CHECK:STDOUT: %ForwardDeclared.decl: invalid = interface_decl @ForwardDeclared [template = constants.%.4] {} // CHECK:STDOUT: %ForwardDeclared.ref.loc8: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4] @@ -188,19 +192,19 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: @UseForwardDeclared.%f: ForwardDeclared = bind_name f, %f.loc8_23.1 // CHECK:STDOUT: } // CHECK:STDOUT: %Basic.ref.loc10: type = name_ref Basic, %import_ref.2 [template = constants.%.3] -// CHECK:STDOUT: %import_ref.16 = import_ref ir2, inst+7, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref ir2, inst+8, unloaded // CHECK:STDOUT: %T.ref.loc10: = name_ref T, %import_ref.8 [template = constants.%.6] // CHECK:STDOUT: %UseBasicT: = bind_alias UseBasicT, %import_ref.8 [template = constants.%.6] // CHECK:STDOUT: %Basic.ref.loc11: type = name_ref Basic, %import_ref.2 [template = constants.%.3] -// CHECK:STDOUT: %import_ref.17 = import_ref ir2, inst+11, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref ir2, inst+12, unloaded // CHECK:STDOUT: %F.ref.loc11: in Basic> = name_ref F, %import_ref.7 [template = constants.%.8] // CHECK:STDOUT: %UseBasicF: in Basic> = bind_alias UseBasicF, %import_ref.7 [template = constants.%.8] // CHECK:STDOUT: %ForwardDeclared.ref.loc13: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.18 = import_ref ir2, inst+19, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref ir2, inst+20, unloaded // CHECK:STDOUT: %T.ref.loc13: = name_ref T, %import_ref.13 [template = constants.%.10] // CHECK:STDOUT: %UseForwardDeclaredT: = bind_alias UseForwardDeclaredT, %import_ref.13 [template = constants.%.10] // CHECK:STDOUT: %ForwardDeclared.ref.loc14: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.19 = import_ref ir2, inst+23, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref ir2, inst+24, unloaded // CHECK:STDOUT: %F.ref.loc14: in ForwardDeclared> = name_ref F, %import_ref.12 [template = constants.%.12] // CHECK:STDOUT: %UseForwardDeclaredF: in ForwardDeclared> = bind_alias UseForwardDeclaredF, %import_ref.12 [template = constants.%.12] // CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4] diff --git a/toolchain/check/testdata/interface/self.carbon b/toolchain/check/testdata/interface/self.carbon index 900d73519e03..eb0abec08342 100644 --- a/toolchain/check/testdata/interface/self.carbon +++ b/toolchain/check/testdata/interface/self.carbon @@ -18,8 +18,10 @@ interface UseSelf { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .UseSelf = %UseSelf.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %UseSelf.decl: type = interface_decl @UseSelf [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index 08f32b45bf44..e4f349327c0c 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -33,8 +33,10 @@ interface I { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 719d8a93dbdc..692d252ebb83 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -16,8 +16,10 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index d76ee608e1d3..3e6cadd79ce1 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -25,8 +25,10 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 6c85cb1ebde7..8d4b9093aa9d 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -24,8 +24,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 1cd61ab2c550..5dd61adedbe6 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -26,8 +26,10 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %a.loc8_6.1: i32 = param a // CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc8_6.1 diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 5b11f36875e4..e3dbb954a683 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -23,7 +23,10 @@ let a: T = 0; // CHECK:STDOUT: --- implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %T: type = bind_symbolic_name T, i32 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -36,9 +39,11 @@ let a: T = 0; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .T = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+1, loc_7 [symbolic = ] -// CHECK:STDOUT: %T.ref: type = name_ref T, %import_ref [symbolic = ] +// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+2, loc_7 [symbolic = ] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %T.ref: type = name_ref T, %import_ref [symbolic = ] // CHECK:STDOUT: %.loc8: i32 = int_literal 0 [template = constants.%.1] // CHECK:STDOUT: %a: T = bind_name a, // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index ac2800278142..7412fb94065c 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -21,8 +21,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %n: i32 = bind_name n, // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index b196d6a04e28..a836291fbefa 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -86,7 +86,10 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc11: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %b: i32 = bind_name b, %.loc11 // CHECK:STDOUT: %.loc17: i32 = int_literal 1 [template = constants.%.1] diff --git a/toolchain/check/testdata/let/fail_todo_modifiers.carbon b/toolchain/check/testdata/let/fail_todo_modifiers.carbon index 284bc41de180..1f510c804d99 100644 --- a/toolchain/check/testdata/let/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_todo_modifiers.carbon @@ -16,7 +16,10 @@ private let a: i32 = 1; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %a: i32 = bind_name a, %.loc10 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index bab22ffa354c..e4418e017f47 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -15,8 +15,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index a5774e5511d5..0dfd1685308e 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -18,8 +18,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index 5d85d33cd02b..5600ae3a5f64 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -20,7 +20,10 @@ var b: T = *a; // CHECK:STDOUT: --- implicit.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %T: type = bind_symbolic_name T, i32 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -33,15 +36,17 @@ var b: T = *a; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .T = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+1, loc_7 [symbolic = ] -// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %import_ref [symbolic = ] +// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+2, loc_7 [symbolic = ] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %import_ref [symbolic = ] // CHECK:STDOUT: %.loc4: type = ptr_type T [symbolic = constants.%.1] // CHECK:STDOUT: %a.var: ref T* = var a // CHECK:STDOUT: %a: ref T* = bind_name a, %a.var -// CHECK:STDOUT: %T.ref.loc5: type = name_ref T, %import_ref [symbolic = ] +// CHECK:STDOUT: %T.ref.loc5: type = name_ref T, %import_ref [symbolic = ] // CHECK:STDOUT: %b.var: ref T = var b // CHECK:STDOUT: %b: ref T = bind_name b, %b.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 05665750caab..88f9368d3b7e 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -16,8 +16,10 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %n: i32 = bind_name n, %.loc7 // CHECK:STDOUT: %F: = fn_decl @F [template] { diff --git a/toolchain/check/testdata/let/import.carbon b/toolchain/check/testdata/let/import.carbon index f3219da7a846..dd61c612ea8c 100644 --- a/toolchain/check/testdata/let/import.carbon +++ b/toolchain/check/testdata/let/import.carbon @@ -23,7 +23,10 @@ let b:! bool = a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4: bool = bool_literal true [template = constants.%.1] // CHECK:STDOUT: %a: bool = bind_symbolic_name a, %.loc4 [symbolic] // CHECK:STDOUT: } @@ -33,9 +36,11 @@ let b:! bool = a; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: bool = import_ref ir1, inst+1, loc_10 [symbolic = ] -// CHECK:STDOUT: %a.ref: bool = name_ref a, %import_ref [symbolic = ] +// CHECK:STDOUT: %import_ref: bool = import_ref ir1, inst+2, loc_10 [symbolic = ] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %a.ref: bool = name_ref a, %import_ref [symbolic = ] // CHECK:STDOUT: %b: bool = bind_symbolic_name b, %a.ref [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index 22df03cbf321..dcff86bbfc79 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -13,8 +13,10 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %a.loc7_6.1: i32 = param a // CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc7_6.1 diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index 4c281f4beb59..9cbac716b45f 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -18,8 +18,10 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %a.loc7_6.1: i32 = param a // CHECK:STDOUT: @F.%a.loc7: i32 = bind_name a, %a.loc7_6.1 diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index 40106e5846b1..ec08361704d1 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -22,8 +22,10 @@ var a: i32 = NS.A(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -36,12 +38,14 @@ var a: i32 = NS.A(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loaded // CHECK:STDOUT: %NS: = namespace %import_ref, [template] { // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index 95ed04319f2d..cfc6588f5954 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -24,12 +24,14 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .ns = %ns // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .D = %D // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index 6af5de042cf6..47df31d8692d 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -45,8 +45,10 @@ fn NS(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -55,9 +57,11 @@ fn NS(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+1, loaded +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+2, loaded // CHECK:STDOUT: %NS: = namespace %import_ref, [template] {} +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc8: = namespace [template] {} // CHECK:STDOUT: %.loc17: = fn_decl @.1 [template] {} // CHECK:STDOUT: %.loc21: = namespace [template] {} 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 0781d53dd116..02e86682ba0d 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -33,8 +33,10 @@ fn NS.Foo(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -43,11 +45,13 @@ fn NS.Foo(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+1, loaded +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+2, loaded // CHECK:STDOUT: %NS: = namespace %import_ref, [template] { // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc15: = fn_decl @.1 [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] {} // CHECK:STDOUT: } 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 905f37dbb88f..118693bddb8c 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -40,8 +40,10 @@ fn NS.Foo(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = fn_decl @NS [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -52,8 +54,10 @@ fn NS.Foo(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+1, loaded [template = imports.%NS] +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+2, loaded [template = imports.%NS] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc16: = namespace [template] {} // CHECK:STDOUT: %.loc24: = fn_decl @.1 [template] {} // CHECK:STDOUT: } 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 8a4a5c492605..3cbfdb28a2e2 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 @@ -42,8 +42,10 @@ fn NS.Bar() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } @@ -59,8 +61,10 @@ fn NS.Bar() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = fn_decl @NS [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -74,14 +78,16 @@ fn NS.Bar() {} // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .Foo = %import_ref.2 // CHECK:STDOUT: .Bar = %Bar // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref ir3, inst+1, loaded [template = imports.%NS] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref ir3, inst+2, loaded [template = imports.%NS] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Bar: = fn_decl @Bar [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: 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 7f0a6d7579de..05b2008af216 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 @@ -42,8 +42,10 @@ fn NS.Bar() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = fn_decl @NS [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -56,8 +58,10 @@ fn NS.Bar() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } @@ -74,14 +78,16 @@ fn NS.Bar() {} // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: = import_ref ir3, inst+1, loaded +// CHECK:STDOUT: %import_ref.1 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref ir3, inst+2, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .Foo = %import_ref.3 // CHECK:STDOUT: .Bar = %Bar // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Bar: = fn_decl @Bar [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 27fd55055e3d..a6578c366f12 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -25,9 +25,11 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .ns = %ns // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %ns: = bind_alias ns, %NS [template = %NS] diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index d2380eadfc4e..c383f0ef3477 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -22,8 +22,10 @@ fn Foo.Baz() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = namespace [template] { // CHECK:STDOUT: .Baz = %Baz.loc9 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_modifiers.carbon b/toolchain/check/testdata/namespace/fail_modifiers.carbon index 63cb27bbe3bf..d13652b01f45 100644 --- a/toolchain/check/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/check/testdata/namespace/fail_modifiers.carbon @@ -54,10 +54,12 @@ extern namespace C; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = namespace [template] {} // CHECK:STDOUT: %B: = namespace [template] {} // CHECK:STDOUT: %C: = namespace [template] {} diff --git a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon index d4998905bef2..de472de48088 100644 --- a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon +++ b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon @@ -13,7 +13,10 @@ fn Foo.Baz() { // CHECK:STDOUT: --- fail_unresolved_scope.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10: = fn_decl @.1 [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/function.carbon b/toolchain/check/testdata/namespace/function.carbon index 644456c312b4..5cd9b019806e 100644 --- a/toolchain/check/testdata/namespace/function.carbon +++ b/toolchain/check/testdata/namespace/function.carbon @@ -25,10 +25,12 @@ fn Bar() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: .Baz = %Baz.loc10 // CHECK:STDOUT: .Bar = %Bar // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = namespace [template] { // CHECK:STDOUT: .Baz = %Baz.loc13 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/imported.carbon b/toolchain/check/testdata/namespace/imported.carbon index 5c3ea32bbcfe..d415754c3a1d 100644 --- a/toolchain/check/testdata/namespace/imported.carbon +++ b/toolchain/check/testdata/namespace/imported.carbon @@ -28,8 +28,10 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .ChildNS = %ChildNS // CHECK:STDOUT: .A = %A @@ -54,22 +56,24 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .package_a = %package_a // CHECK:STDOUT: .package_b = %package_b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir1, inst+1, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir1, inst+2, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .ChildNS = %ChildNS // CHECK:STDOUT: .A = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+2, loaded +// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+3, loaded // CHECK:STDOUT: %ChildNS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .B = %import_ref.4 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref ir1, inst+3, loc_13 [template = imports.%A] -// CHECK:STDOUT: %import_ref.4: = import_ref ir1, inst+4, loc_27 [template = imports.%B] +// CHECK:STDOUT: %import_ref.3: = import_ref ir1, inst+4, loc_13 [template = imports.%A] +// CHECK:STDOUT: %import_ref.4: = import_ref ir1, inst+5, loc_27 [template = imports.%B] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index 190fa75fdf25..89a9b619e450 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -42,8 +42,10 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -52,11 +54,13 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+1, loaded +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+2, loaded // CHECK:STDOUT: %A: = namespace %import_ref, [template] { // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -65,23 +69,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A -// CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded -// CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { -// CHECK:STDOUT: .B = %B -// CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+3, loaded -// CHECK:STDOUT: %B: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .C = %C -// CHECK:STDOUT: } -// CHECK:STDOUT: %C: = namespace [template] {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- d.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded // CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { @@ -91,10 +79,30 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: %B: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+5, loaded +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %C: = namespace [template] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- d.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded +// CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .B = %B +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+4, loaded +// CHECK:STDOUT: %B: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .C = %C +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: = import_ref ir2, inst+6, loaded // CHECK:STDOUT: %C: = namespace %import_ref.3, [template] { // CHECK:STDOUT: .D = %D // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %D: = fn_decl @D [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -112,6 +120,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded @@ -126,7 +135,8 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: %C: = namespace %import_ref.3, [template] { // CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+7, loc_23 [template = imports.%D] +// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+8, loc_23 [template = imports.%D] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc5_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc5_9.2: type = converted %.loc5_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %e.var: ref () = var e diff --git a/toolchain/check/testdata/namespace/merging.carbon b/toolchain/check/testdata/namespace/merging.carbon index 15f2cc7e96e9..70396d65f6a1 100644 --- a/toolchain/check/testdata/namespace/merging.carbon +++ b/toolchain/check/testdata/namespace/merging.carbon @@ -46,8 +46,10 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } @@ -63,8 +65,10 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .B1 = %B1 // CHECK:STDOUT: .B2 = %B2 @@ -93,18 +97,20 @@ fn Run() { // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .A = %import_ref.2 // CHECK:STDOUT: .B1 = %import_ref.3 // CHECK:STDOUT: .B2 = %import_ref.4 // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+2, loc_33 [template = imports.%A] -// CHECK:STDOUT: %import_ref.3: = import_ref ir3, inst+2, loc_39 [template = imports.%B1] -// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+5, loc_45 [template = imports.%B2] +// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+3, loc_33 [template = imports.%A] +// CHECK:STDOUT: %import_ref.3: = import_ref ir3, inst+3, loc_39 [template = imports.%B1] +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+6, loc_45 [template = imports.%B2] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7: = namespace [template] {} // CHECK:STDOUT: %C: = fn_decl @C [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} diff --git a/toolchain/check/testdata/namespace/nested.carbon b/toolchain/check/testdata/namespace/nested.carbon index f958aab4092e..f37a9d3eec40 100644 --- a/toolchain/check/testdata/namespace/nested.carbon +++ b/toolchain/check/testdata/namespace/nested.carbon @@ -22,8 +22,10 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = namespace [template] { // CHECK:STDOUT: .Bar = %Bar // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 49057f8728b2..de358c87b49b 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -33,9 +33,11 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.loc7 // CHECK:STDOUT: .N = %N // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.loc7: = fn_decl @A.1 [template] {} // CHECK:STDOUT: %N: = namespace [template] { // CHECK:STDOUT: .A = %A.loc10 diff --git a/toolchain/check/testdata/namespace/unqualified_lookup.carbon b/toolchain/check/testdata/namespace/unqualified_lookup.carbon index c7fc935fd722..8177bb606f9d 100644 --- a/toolchain/check/testdata/namespace/unqualified_lookup.carbon +++ b/toolchain/check/testdata/namespace/unqualified_lookup.carbon @@ -34,10 +34,12 @@ fn OuterN.InnerN.CallABC() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .OuterN = %OuterN // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .CallA = %CallA // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %OuterN: = namespace [template] { // CHECK:STDOUT: .InnerN = %InnerN // CHECK:STDOUT: .B = %B diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index 499a89d5d894..41e49a3cffe4 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -33,12 +33,14 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .And = %And // CHECK:STDOUT: .Constant = %Constant // CHECK:STDOUT: .PartialConstant = %PartialConstant // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var.loc7: ref bool = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index a9a01d94fd7f..79124cfd08db 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -47,8 +47,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: 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 62bc515e677e..bb4361260dc1 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 @@ -46,7 +46,7 @@ var or_: F(true or true); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %.loc38_17: bool = block_arg [template = constants.%.1] -// CHECK:STDOUT: %.loc38_11.1: init type = call (%.loc38_17) +// CHECK:STDOUT: %.loc38_11.1: init type = call (%.loc38_17) // CHECK:STDOUT: %.loc38_24: type = value_of_initializer %.loc38_11.1 // CHECK:STDOUT: %.loc38_11.2: type = converted %.loc38_11.1, %.loc38_24 // CHECK:STDOUT: %or_.var: ref = var or_ 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 9b1291da4965..4647824fe2a8 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 @@ -49,8 +49,10 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .PartialConstant = %PartialConstant // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %PartialConstant: = fn_decl @PartialConstant [template] { // CHECK:STDOUT: %x.loc4_20.1: bool = param x // CHECK:STDOUT: @PartialConstant.%x: bool = bind_name x, %x.loc4_20.1 @@ -121,8 +123,10 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .KnownValueButNonConstantCondition = %KnownValueButNonConstantCondition // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %KnownValueButNonConstantCondition: = fn_decl @KnownValueButNonConstantCondition [template] { // CHECK:STDOUT: %x.loc4_38.1: bool = param x // CHECK:STDOUT: @KnownValueButNonConstantCondition.%x: bool = bind_name x, %x.loc4_38.1 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 e820767e44a2..2f7b08e41db6 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon @@ -24,8 +24,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: 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 433338d32b4a..34d716ff09ba 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 @@ -75,9 +75,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } 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 aced37284d47..0084fac9ac70 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -28,9 +28,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index eebaff149dde..0560341b6106 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -19,8 +19,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index 9c97c6d4bb6e..06ab78c0178d 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -21,8 +21,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: 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 22a27cc04b37..f733c77995e7 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -7,10 +7,18 @@ 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: Semantics TODO: `missing or invalid operator interface`. + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+15]]:10: ERROR: Name `Add` not found. // CHECK:STDERR: return 12 + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+11]]:10: ERROR: Semantics TODO: `missing or invalid operator interface`. + // CHECK:STDERR: return 12 + 3.4 + 12; + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+7]]:10: ERROR: Name `Add` not found. + // CHECK:STDERR: return 12 + 3.4 + 12; + // CHECK:STDERR: ^~~~~~~~~~~~~ + // CHECK:STDERR: // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:10: ERROR: Semantics TODO: `missing or invalid operator interface`. // CHECK:STDERR: return 12 + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~~~~~~ @@ -26,8 +34,10 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } @@ -35,9 +45,9 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc17_10: i32 = int_literal 12 [template = constants.%.1] -// CHECK:STDOUT: %.loc17_15: f64 = real_literal 34e-1 [template = constants.%.2] -// CHECK:STDOUT: %.loc17_21: i32 = int_literal 12 [template = constants.%.1] +// CHECK:STDOUT: %.loc25_10: i32 = int_literal 12 [template = constants.%.1] +// CHECK:STDOUT: %.loc25_15: f64 = real_literal 34e-1 [template = constants.%.2] +// CHECK:STDOUT: %.loc25_21: i32 = int_literal 12 [template = constants.%.1] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index 6236d5b6e311..b0afb3333740 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -5,6 +5,10 @@ // AUTOUPDATE fn Main() -> i32 { + // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+7]]:10: ERROR: Name `Add` not found. + // CHECK:STDERR: return 12 + 34; + // CHECK:STDERR: ^~~~~~~ + // CHECK:STDERR: // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+3]]:10: ERROR: Semantics TODO: `missing or invalid operator interface`. // CHECK:STDERR: return 12 + 34; // CHECK:STDERR: ^~~~~~~ @@ -20,8 +24,10 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } @@ -29,8 +35,8 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc11_10: i32 = int_literal 12 [template = constants.%.1] -// CHECK:STDOUT: %.loc11_15: i32 = int_literal 34 [template = constants.%.2] +// CHECK:STDOUT: %.loc15_10: i32 = int_literal 12 [template = constants.%.1] +// CHECK:STDOUT: %.loc15_15: i32 = int_literal 34 [template = constants.%.2] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index e5c0c7bcc436..1e21d2548f07 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -33,12 +33,14 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .Or = %Or // CHECK:STDOUT: .Constant = %Constant // CHECK:STDOUT: .PartialConstant = %PartialConstant // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var.loc7: ref bool = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index 76cf800a04c5..70f62308ddc4 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -27,9 +27,11 @@ fn Constant() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Not = %Not // CHECK:STDOUT: .Constant = %Constant // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Not: = fn_decl @Not [template] { // CHECK:STDOUT: %b.loc7_8.1: bool = param b // CHECK:STDOUT: @Not.%b: bool = bind_name b, %b.loc7_8.1 diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index 0c3512dcc46c..322d149d63fd 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Add> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Add> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Add.decl: invalid = interface_decl @Add [template = constants.%.2] {} // CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in AddAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in AddAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 9fe1a3bbbc11..b701a1d4a5f5 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in BitAnd> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in BitAnd> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %BitAnd.decl: invalid = interface_decl @BitAnd [template = constants.%.2] {} // CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in BitAndAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in BitAndAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitAnd { diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index 764b95495518..e04cbbd27ddf 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -92,10 +92,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in BitComplement> = import_ref ir2, inst+15, loc_50 [template = constants.%.8] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+13, loc_19 [template = imports.%Op] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in BitComplement> = import_ref ir3, inst+15, loc_50 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+13, loc_19 [template = imports.%Op] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -109,8 +109,8 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C.ref.loc14_20: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_50 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+1, loc_50 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref ir3, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitComplement { diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index c57ac459e8bf..f898480b689f 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in BitOr> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in BitOr> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %BitOr.decl: invalid = interface_decl @BitOr [template = constants.%.2] {} // CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in BitOrAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in BitOrAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitOr { diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 667076c0db2b..9d508f5b11f0 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in BitXor> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in BitXor> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %BitXor.decl: invalid = interface_decl @BitXor [template = constants.%.2] {} // CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in BitXorAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in BitXorAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitXor { diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index 43b0d3f90aab..63235b5645e1 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -92,10 +92,10 @@ fn TestOp() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Dec> = import_ref ir2, inst+14, loc_47 [template = constants.%.10] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+12, loc_19 [template = imports.%Op] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Dec> = import_ref ir3, inst+14, loc_47 [template = constants.%.10] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+12, loc_19 [template = imports.%Op] // 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, %Core [template = %Core] @@ -103,8 +103,8 @@ fn TestOp() { // CHECK:STDOUT: %Dec.ref: type = name_ref Dec, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp: = fn_decl @TestOp [template] {} -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_47 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+12, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+1, loc_47 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref ir3, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Dec { diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index 93a62cb17bf2..0e3e19681a1d 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Div> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Div> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Div.decl: invalid = interface_decl @Div [template = constants.%.2] {} // CHECK:STDOUT: %Div.ref: type = name_ref Div, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in DivAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in DivAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Div { diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 906e03604366..eb595f2c160f 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -8,6 +8,8 @@ package Core api; +import library "prelude"; + interface Eq { fn Equal[self: Self](other: Self) -> bool; fn NotEqual[self: Self](other: Self) -> bool; @@ -109,44 +111,44 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: interface @Eq { // CHECK:STDOUT: %Self: Eq = bind_symbolic_name Self [symbolic] // CHECK:STDOUT: %Equal: = fn_decl @Equal [template] { -// CHECK:STDOUT: %Self.ref.loc5_18: Eq = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc5_18.1: type = facet_type_access %Self.ref.loc5_18 [symbolic = %Self] -// CHECK:STDOUT: %.loc5_18.2: type = converted %Self.ref.loc5_18, %.loc5_18.1 [symbolic = %Self] -// CHECK:STDOUT: %self.loc5_12.1: Self = param self -// CHECK:STDOUT: %self.loc5_12.2: Self = bind_name self, %self.loc5_12.1 -// CHECK:STDOUT: %Self.ref.loc5_31: Eq = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc5_31.1: type = facet_type_access %Self.ref.loc5_31 [symbolic = %Self] -// CHECK:STDOUT: %.loc5_31.2: type = converted %Self.ref.loc5_31, %.loc5_31.1 [symbolic = %Self] -// CHECK:STDOUT: %other.loc5_24.1: Self = param other -// CHECK:STDOUT: %other.loc5_24.2: Self = bind_name other, %other.loc5_24.1 -// CHECK:STDOUT: %return.var.loc5: ref bool = var +// CHECK:STDOUT: %Self.ref.loc7_18: Eq = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc7_18.1: type = facet_type_access %Self.ref.loc7_18 [symbolic = %Self] +// CHECK:STDOUT: %.loc7_18.2: type = converted %Self.ref.loc7_18, %.loc7_18.1 [symbolic = %Self] +// CHECK:STDOUT: %self.loc7_12.1: Self = param self +// CHECK:STDOUT: %self.loc7_12.2: Self = bind_name self, %self.loc7_12.1 +// CHECK:STDOUT: %Self.ref.loc7_31: Eq = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc7_31.1: type = facet_type_access %Self.ref.loc7_31 [symbolic = %Self] +// CHECK:STDOUT: %.loc7_31.2: type = converted %Self.ref.loc7_31, %.loc7_31.1 [symbolic = %Self] +// CHECK:STDOUT: %other.loc7_24.1: Self = param other +// CHECK:STDOUT: %other.loc7_24.2: Self = bind_name other, %other.loc7_24.1 +// CHECK:STDOUT: %return.var.loc7: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc5_44: in Eq> = assoc_entity element0, %Equal [template = constants.%.3] +// CHECK:STDOUT: %.loc7_44: in Eq> = assoc_entity element0, %Equal [template = constants.%.3] // CHECK:STDOUT: %NotEqual: = fn_decl @NotEqual [template] { -// CHECK:STDOUT: %Self.ref.loc6_21: Eq = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc6_21.1: type = facet_type_access %Self.ref.loc6_21 [symbolic = %Self] -// CHECK:STDOUT: %.loc6_21.2: type = converted %Self.ref.loc6_21, %.loc6_21.1 [symbolic = %Self] -// CHECK:STDOUT: %self.loc6_15.1: Self = param self -// CHECK:STDOUT: %self.loc6_15.2: Self = bind_name self, %self.loc6_15.1 -// CHECK:STDOUT: %Self.ref.loc6_34: Eq = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc6_34.1: type = facet_type_access %Self.ref.loc6_34 [symbolic = %Self] -// CHECK:STDOUT: %.loc6_34.2: type = converted %Self.ref.loc6_34, %.loc6_34.1 [symbolic = %Self] -// CHECK:STDOUT: %other.loc6_27.1: Self = param other -// CHECK:STDOUT: %other.loc6_27.2: Self = bind_name other, %other.loc6_27.1 -// CHECK:STDOUT: %return.var.loc6: ref bool = var +// CHECK:STDOUT: %Self.ref.loc8_21: Eq = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc8_21.1: type = facet_type_access %Self.ref.loc8_21 [symbolic = %Self] +// CHECK:STDOUT: %.loc8_21.2: type = converted %Self.ref.loc8_21, %.loc8_21.1 [symbolic = %Self] +// CHECK:STDOUT: %self.loc8_15.1: Self = param self +// CHECK:STDOUT: %self.loc8_15.2: Self = bind_name self, %self.loc8_15.1 +// CHECK:STDOUT: %Self.ref.loc8_34: Eq = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc8_34.1: type = facet_type_access %Self.ref.loc8_34 [symbolic = %Self] +// CHECK:STDOUT: %.loc8_34.2: type = converted %Self.ref.loc8_34, %.loc8_34.1 [symbolic = %Self] +// CHECK:STDOUT: %other.loc8_27.1: Self = param other +// CHECK:STDOUT: %other.loc8_27.2: Self = bind_name other, %other.loc8_27.1 +// CHECK:STDOUT: %return.var.loc8: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_47: in Eq> = assoc_entity element1, %NotEqual [template = constants.%.4] +// CHECK:STDOUT: %.loc8_47: in Eq> = assoc_entity element1, %NotEqual [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .Equal = %.loc5_44 -// CHECK:STDOUT: .NotEqual = %.loc6_47 +// CHECK:STDOUT: .Equal = %.loc7_44 +// CHECK:STDOUT: .NotEqual = %.loc8_47 // CHECK:STDOUT: witness = (%Equal, %NotEqual) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Equal[@Eq.%self.loc5_12.2: Self](@Eq.%other.loc5_24.2: Self) -> bool; +// CHECK:STDOUT: fn @Equal[@Eq.%self.loc7_12.2: Self](@Eq.%other.loc7_24.2: Self) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @NotEqual[@Eq.%self.loc6_15.2: Self](@Eq.%other.loc6_27.2: Self) -> bool; +// CHECK:STDOUT: fn @NotEqual[@Eq.%self.loc8_15.2: Self](@Eq.%other.loc8_27.2: Self) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: --- user.carbon // CHECK:STDOUT: @@ -171,12 +173,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Eq> = import_ref ir2, inst+17, loc_68 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: in Eq> = import_ref ir2, inst+31, loc_88 [template = constants.%.8] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+15, loc_19 [template = imports.%Equal] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+30, loc_19 [template = imports.%NotEqual] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: in Eq> = import_ref ir3, inst+17, loc_68 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: in Eq> = import_ref ir3, inst+31, loc_88 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.5: = import_ref ir3, inst+15, loc_19 [template = imports.%Equal] +// CHECK:STDOUT: %import_ref.6: = import_ref ir3, inst+30, loc_19 [template = imports.%NotEqual] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -192,8 +194,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestEqual.%b: C = bind_name b, %b.loc13_20.1 // CHECK:STDOUT: %return.var.loc13: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_68 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+15, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref ir3, inst+1, loc_68 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.8 = import_ref ir3, inst+15, unloaded // CHECK:STDOUT: %TestNotEqual: = fn_decl @TestNotEqual [template] { // CHECK:STDOUT: %C.ref.loc17_20: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc17_17.1: C = param a @@ -203,14 +205,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestNotEqual.%b: C = bind_name b, %b.loc17_23.1 // CHECK:STDOUT: %return.var.loc17: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_88 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+30, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_88 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+30, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Eq { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Equal = file.%import_ref.2 -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Equal = file.%import_ref.3 // CHECK:STDOUT: .NotEqual = file.%import_ref.4 // CHECK:STDOUT: witness = (file.%import_ref.5, file.%import_ref.6) // CHECK:STDOUT: } @@ -310,13 +312,13 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestEqual.%b: D = bind_name b, %b.loc8_20.1 // CHECK:STDOUT: %return.var.loc8: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_30 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: in Eq> = import_ref ir2, inst+17, loc_30 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: in Eq> = import_ref ir2, inst+31, loc_50 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+30, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+15, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_30 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: in Eq> = import_ref ir3, inst+17, loc_30 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.4: in Eq> = import_ref ir3, inst+31, loc_50 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5 = import_ref ir3, inst+15, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir3, inst+30, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+15, unloaded // CHECK:STDOUT: %TestNotEqual: = fn_decl @TestNotEqual [template] { // CHECK:STDOUT: %D.ref.loc16_20: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc16_17.1: D = param a @@ -326,14 +328,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestNotEqual.%b: D = bind_name b, %b.loc16_23.1 // CHECK:STDOUT: %return.var.loc16: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.8: type = import_ref ir2, inst+1, loc_50 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+30, unloaded +// CHECK:STDOUT: %import_ref.8: type = import_ref ir3, inst+1, loc_50 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.9 = import_ref ir3, inst+30, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Eq { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Equal = file.%import_ref.2 -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Equal = file.%import_ref.3 // CHECK:STDOUT: .NotEqual = file.%import_ref.4 // CHECK:STDOUT: witness = (file.%import_ref.5, file.%import_ref.6) // CHECK:STDOUT: } @@ -384,12 +386,12 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_23 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Eq> = import_ref ir2, inst+17, loc_73 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: in Eq> = import_ref ir2, inst+31, loc_93 [template = constants.%.8] -// CHECK:STDOUT: %import_ref.5: = import_ref ir2, inst+15, loc_24 [template = imports.%Equal] -// CHECK:STDOUT: %import_ref.6: = import_ref ir2, inst+30, loc_24 [template = imports.%NotEqual] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_23 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: in Eq> = import_ref ir3, inst+17, loc_73 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: in Eq> = import_ref ir3, inst+31, loc_93 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.5: = import_ref ir3, inst+15, loc_24 [template = imports.%Equal] +// CHECK:STDOUT: %import_ref.6: = import_ref ir3, inst+30, loc_24 [template = imports.%NotEqual] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -405,8 +407,8 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestRhsBad.%b: D = bind_name b, %b.loc14_21.1 // CHECK:STDOUT: %return.var.loc14: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: type = import_ref ir2, inst+1, loc_73 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+15, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref ir3, inst+1, loc_73 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.8 = import_ref ir3, inst+15, unloaded // CHECK:STDOUT: %TestLhsBad: = fn_decl @TestLhsBad [template] { // CHECK:STDOUT: %D.ref.loc25: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc25_15.1: D = param a @@ -416,14 +418,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: @TestLhsBad.%b: C = bind_name b, %b.loc25_21.1 // CHECK:STDOUT: %return.var.loc25: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_93 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+30, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_93 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+30, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Eq { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Equal = file.%import_ref.2 -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Equal = file.%import_ref.3 // CHECK:STDOUT: .NotEqual = file.%import_ref.4 // CHECK:STDOUT: witness = (file.%import_ref.5, file.%import_ref.6) // 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 5877b2597588..e7587c055e50 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -149,20 +149,20 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Inc> = import_ref ir2, inst+14, loc_65 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+12, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Inc> = import_ref ir3, inst+14, loc_65 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+12, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Inc.decl: invalid = interface_decl @Inc [template = constants.%.2] {} // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+16, loc_38 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: in AddAssign> = import_ref ir2, inst+34, loc_82 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+18, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+32, loc_39 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+16, loc_38 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: in AddAssign> = import_ref ir3, inst+34, loc_82 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+18, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+32, loc_39 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc11: = name_ref Core, %Core [template = %Core] @@ -174,8 +174,8 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %a.loc15_18.1: C = param a // CHECK:STDOUT: @TestIncNonRef.%a: C = bind_name a, %a.loc15_18.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_65 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+12, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_65 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+12, unloaded // CHECK:STDOUT: %TestAddAssignNonRef: = fn_decl @TestAddAssignNonRef [template] { // CHECK:STDOUT: %C.ref.loc26_27: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc26_24.1: C = param a @@ -184,8 +184,8 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %b.loc26_30.1: C = param b // CHECK:STDOUT: @TestAddAssignNonRef.%b: C = bind_name b, %b.loc26_30.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+16, loc_82 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+32, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+16, loc_82 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+32, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Inc { diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index c73eaa657eb1..cd52f6b36ad3 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -223,11 +223,11 @@ fn TestRef(b: C) { // CHECK:STDOUT: %C.ref.loc8_23: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestUnary.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_25 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: in Negate> = import_ref ir2, inst+11, loc_25 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+9, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_25 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.2: in Negate> = import_ref ir3, inst+11, loc_25 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir3, inst+9, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir3, inst+9, unloaded // CHECK:STDOUT: %TestBinary: = fn_decl @TestBinary [template] { // CHECK:STDOUT: %C.ref.loc16_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc16_15.1: C = param a @@ -238,26 +238,26 @@ fn TestRef(b: C) { // CHECK:STDOUT: %C.ref.loc16_30: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestBinary.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: type = import_ref ir2, inst+13, loc_45 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.7: in Add> = import_ref ir2, inst+32, loc_45 [template = constants.%.9] -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+15, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+30, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+30, unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref ir3, inst+13, loc_45 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.7: in Add> = import_ref ir3, inst+32, loc_45 [template = constants.%.9] +// CHECK:STDOUT: %import_ref.8 = import_ref ir3, inst+15, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref ir3, inst+30, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+30, unloaded // CHECK:STDOUT: %TestRef: = fn_decl @TestRef [template] { // CHECK:STDOUT: %C.ref.loc24: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc24_12.1: C = param b // CHECK:STDOUT: @TestRef.%b: C = bind_name b, %b.loc24_12.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+34, loc_66 [template = constants.%.11] -// CHECK:STDOUT: %import_ref.12: in AddAssign> = import_ref ir2, inst+52, loc_66 [template = constants.%.13] -// CHECK:STDOUT: %import_ref.13 = import_ref ir2, inst+36, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref ir2, inst+50, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref ir2, inst+50, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+54, loc_69 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.17: in Inc> = import_ref ir2, inst+67, loc_69 [template = constants.%.16] -// CHECK:STDOUT: %import_ref.18 = import_ref ir2, inst+56, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref ir2, inst+65, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref ir2, inst+65, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+34, loc_66 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.12: in AddAssign> = import_ref ir3, inst+52, loc_66 [template = constants.%.13] +// CHECK:STDOUT: %import_ref.13 = import_ref ir3, inst+36, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref ir3, inst+50, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref ir3, inst+50, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref ir3, inst+54, loc_69 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.17: in Inc> = import_ref ir3, inst+67, loc_69 [template = constants.%.16] +// CHECK:STDOUT: %import_ref.18 = import_ref ir3, inst+56, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref ir3, inst+65, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref ir3, inst+65, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Negate { 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 fa398a612bb1..9ba54ce5a4bc 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 @@ -160,20 +160,20 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_23 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Add> = import_ref ir2, inst+20, loc_81 [template = constants.%.11] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_24 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_23 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Add> = import_ref ir3, inst+20, loc_81 [template = constants.%.11] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_24 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc9: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Add.decl: invalid = interface_decl @Add [template = constants.%.2] {} // CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: in AddAssign> = import_ref ir2, inst+40, loc_102 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: in AddAssign> = import_ref ir3, inst+40, loc_102 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc12: = name_ref Core, %Core [template = %Core] @@ -190,15 +190,15 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %C.ref.loc16_24: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @Test.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_81 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_81 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %D.ref.loc27: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %b.loc27_15.1: D = param b // CHECK:STDOUT: @TestAssign.%b: D = bind_name b, %b.loc27_15.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_102 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_102 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 9be8c4ebd88d..d33a3c219689 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -92,10 +92,10 @@ fn TestOp() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Inc> = import_ref ir2, inst+14, loc_47 [template = constants.%.10] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+12, loc_19 [template = imports.%Op] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Inc> = import_ref ir3, inst+14, loc_47 [template = constants.%.10] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+12, loc_19 [template = imports.%Op] // 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, %Core [template = %Core] @@ -103,8 +103,8 @@ fn TestOp() { // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp: = fn_decl @TestOp [template] {} -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_47 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+12, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+1, loc_47 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref ir3, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Inc { diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index 2b278e8cb276..9bbca6ed802b 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in LeftShift> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in LeftShift> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %LeftShift.decl: invalid = interface_decl @LeftShift [template = constants.%.2] {} // CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in LeftShiftAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in LeftShiftAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @LeftShift { diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 4f3c01f9d7fc..df77e205481f 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Mod> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Mod> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Mod.decl: invalid = interface_decl @Mod [template = constants.%.2] {} // CHECK:STDOUT: %Mod.ref: type = name_ref Mod, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in ModAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in ModAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Mod { diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index 8e3c1e510be4..6664cf8f839e 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Mul> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Mul> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Mul.decl: invalid = interface_decl @Mul [template = constants.%.2] {} // CHECK:STDOUT: %Mul.ref: type = name_ref Mul, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in MulAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in MulAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Mul { diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index b4f65791f706..f417ae373ae0 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -92,10 +92,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Negate> = import_ref ir2, inst+15, loc_50 [template = constants.%.8] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+13, loc_19 [template = imports.%Op] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Negate> = import_ref ir3, inst+15, loc_50 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+13, loc_19 [template = imports.%Op] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -109,8 +109,8 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C.ref.loc14_20: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+1, loc_50 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+1, loc_50 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref ir3, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Negate { diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 6f350474fc0c..af155e1d114f 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -8,6 +8,8 @@ package Core api; +import library "prelude"; + interface Ordered { // TODO: fn Compare fn Less[self: Self](other: Self) -> bool; @@ -107,78 +109,78 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: interface @Ordered { // CHECK:STDOUT: %Self: Ordered = bind_symbolic_name Self [symbolic] // CHECK:STDOUT: %Less: = fn_decl @Less [template] { -// CHECK:STDOUT: %Self.ref.loc6_17: Ordered = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc6_17.1: type = facet_type_access %Self.ref.loc6_17 [symbolic = %Self] -// CHECK:STDOUT: %.loc6_17.2: type = converted %Self.ref.loc6_17, %.loc6_17.1 [symbolic = %Self] -// CHECK:STDOUT: %self.loc6_11.1: Self = param self -// CHECK:STDOUT: %self.loc6_11.2: Self = bind_name self, %self.loc6_11.1 -// CHECK:STDOUT: %Self.ref.loc6_30: Ordered = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc6_30.1: type = facet_type_access %Self.ref.loc6_30 [symbolic = %Self] -// CHECK:STDOUT: %.loc6_30.2: type = converted %Self.ref.loc6_30, %.loc6_30.1 [symbolic = %Self] -// CHECK:STDOUT: %other.loc6_23.1: Self = param other -// CHECK:STDOUT: %other.loc6_23.2: Self = bind_name other, %other.loc6_23.1 -// CHECK:STDOUT: %return.var.loc6: ref bool = var -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_43: in Ordered> = assoc_entity element0, %Less [template = constants.%.3] -// CHECK:STDOUT: %LessOrEquivalent: = fn_decl @LessOrEquivalent [template] { -// CHECK:STDOUT: %Self.ref.loc7_29: Ordered = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc7_29.1: type = facet_type_access %Self.ref.loc7_29 [symbolic = %Self] -// CHECK:STDOUT: %.loc7_29.2: type = converted %Self.ref.loc7_29, %.loc7_29.1 [symbolic = %Self] -// CHECK:STDOUT: %self.loc7_23.1: Self = param self -// CHECK:STDOUT: %self.loc7_23.2: Self = bind_name self, %self.loc7_23.1 -// CHECK:STDOUT: %Self.ref.loc7_42: Ordered = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc7_42.1: type = facet_type_access %Self.ref.loc7_42 [symbolic = %Self] -// CHECK:STDOUT: %.loc7_42.2: type = converted %Self.ref.loc7_42, %.loc7_42.1 [symbolic = %Self] -// CHECK:STDOUT: %other.loc7_35.1: Self = param other -// CHECK:STDOUT: %other.loc7_35.2: Self = bind_name other, %other.loc7_35.1 -// CHECK:STDOUT: %return.var.loc7: ref bool = var -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_55: in Ordered> = assoc_entity element1, %LessOrEquivalent [template = constants.%.4] -// CHECK:STDOUT: %Greater: = fn_decl @Greater [template] { -// CHECK:STDOUT: %Self.ref.loc8_20: Ordered = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc8_20.1: type = facet_type_access %Self.ref.loc8_20 [symbolic = %Self] -// CHECK:STDOUT: %.loc8_20.2: type = converted %Self.ref.loc8_20, %.loc8_20.1 [symbolic = %Self] -// CHECK:STDOUT: %self.loc8_14.1: Self = param self -// CHECK:STDOUT: %self.loc8_14.2: Self = bind_name self, %self.loc8_14.1 -// CHECK:STDOUT: %Self.ref.loc8_33: Ordered = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc8_33.1: type = facet_type_access %Self.ref.loc8_33 [symbolic = %Self] -// CHECK:STDOUT: %.loc8_33.2: type = converted %Self.ref.loc8_33, %.loc8_33.1 [symbolic = %Self] -// CHECK:STDOUT: %other.loc8_26.1: Self = param other -// CHECK:STDOUT: %other.loc8_26.2: Self = bind_name other, %other.loc8_26.1 +// CHECK:STDOUT: %Self.ref.loc8_17: Ordered = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc8_17.1: type = facet_type_access %Self.ref.loc8_17 [symbolic = %Self] +// CHECK:STDOUT: %.loc8_17.2: type = converted %Self.ref.loc8_17, %.loc8_17.1 [symbolic = %Self] +// CHECK:STDOUT: %self.loc8_11.1: Self = param self +// CHECK:STDOUT: %self.loc8_11.2: Self = bind_name self, %self.loc8_11.1 +// CHECK:STDOUT: %Self.ref.loc8_30: Ordered = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc8_30.1: type = facet_type_access %Self.ref.loc8_30 [symbolic = %Self] +// CHECK:STDOUT: %.loc8_30.2: type = converted %Self.ref.loc8_30, %.loc8_30.1 [symbolic = %Self] +// CHECK:STDOUT: %other.loc8_23.1: Self = param other +// CHECK:STDOUT: %other.loc8_23.2: Self = bind_name other, %other.loc8_23.1 // CHECK:STDOUT: %return.var.loc8: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_46: in Ordered> = assoc_entity element2, %Greater [template = constants.%.5] -// CHECK:STDOUT: %GreaterOrEquivalent: = fn_decl @GreaterOrEquivalent [template] { -// CHECK:STDOUT: %Self.ref.loc9_32: Ordered = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc9_32.1: type = facet_type_access %Self.ref.loc9_32 [symbolic = %Self] -// CHECK:STDOUT: %.loc9_32.2: type = converted %Self.ref.loc9_32, %.loc9_32.1 [symbolic = %Self] -// CHECK:STDOUT: %self.loc9_26.1: Self = param self -// CHECK:STDOUT: %self.loc9_26.2: Self = bind_name self, %self.loc9_26.1 -// CHECK:STDOUT: %Self.ref.loc9_45: Ordered = name_ref Self, %Self [symbolic = %Self] -// CHECK:STDOUT: %.loc9_45.1: type = facet_type_access %Self.ref.loc9_45 [symbolic = %Self] -// CHECK:STDOUT: %.loc9_45.2: type = converted %Self.ref.loc9_45, %.loc9_45.1 [symbolic = %Self] -// CHECK:STDOUT: %other.loc9_38.1: Self = param other -// CHECK:STDOUT: %other.loc9_38.2: Self = bind_name other, %other.loc9_38.1 +// CHECK:STDOUT: %.loc8_43: in Ordered> = assoc_entity element0, %Less [template = constants.%.3] +// CHECK:STDOUT: %LessOrEquivalent: = fn_decl @LessOrEquivalent [template] { +// CHECK:STDOUT: %Self.ref.loc9_29: Ordered = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc9_29.1: type = facet_type_access %Self.ref.loc9_29 [symbolic = %Self] +// CHECK:STDOUT: %.loc9_29.2: type = converted %Self.ref.loc9_29, %.loc9_29.1 [symbolic = %Self] +// CHECK:STDOUT: %self.loc9_23.1: Self = param self +// CHECK:STDOUT: %self.loc9_23.2: Self = bind_name self, %self.loc9_23.1 +// CHECK:STDOUT: %Self.ref.loc9_42: Ordered = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc9_42.1: type = facet_type_access %Self.ref.loc9_42 [symbolic = %Self] +// CHECK:STDOUT: %.loc9_42.2: type = converted %Self.ref.loc9_42, %.loc9_42.1 [symbolic = %Self] +// CHECK:STDOUT: %other.loc9_35.1: Self = param other +// CHECK:STDOUT: %other.loc9_35.2: Self = bind_name other, %other.loc9_35.1 // CHECK:STDOUT: %return.var.loc9: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_58: in Ordered> = assoc_entity element3, %GreaterOrEquivalent [template = constants.%.6] +// CHECK:STDOUT: %.loc9_55: in Ordered> = assoc_entity element1, %LessOrEquivalent [template = constants.%.4] +// CHECK:STDOUT: %Greater: = fn_decl @Greater [template] { +// CHECK:STDOUT: %Self.ref.loc10_20: Ordered = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc10_20.1: type = facet_type_access %Self.ref.loc10_20 [symbolic = %Self] +// CHECK:STDOUT: %.loc10_20.2: type = converted %Self.ref.loc10_20, %.loc10_20.1 [symbolic = %Self] +// CHECK:STDOUT: %self.loc10_14.1: Self = param self +// CHECK:STDOUT: %self.loc10_14.2: Self = bind_name self, %self.loc10_14.1 +// CHECK:STDOUT: %Self.ref.loc10_33: Ordered = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc10_33.1: type = facet_type_access %Self.ref.loc10_33 [symbolic = %Self] +// CHECK:STDOUT: %.loc10_33.2: type = converted %Self.ref.loc10_33, %.loc10_33.1 [symbolic = %Self] +// CHECK:STDOUT: %other.loc10_26.1: Self = param other +// CHECK:STDOUT: %other.loc10_26.2: Self = bind_name other, %other.loc10_26.1 +// CHECK:STDOUT: %return.var.loc10: ref bool = var +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc10_46: in Ordered> = assoc_entity element2, %Greater [template = constants.%.5] +// CHECK:STDOUT: %GreaterOrEquivalent: = fn_decl @GreaterOrEquivalent [template] { +// CHECK:STDOUT: %Self.ref.loc11_32: Ordered = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc11_32.1: type = facet_type_access %Self.ref.loc11_32 [symbolic = %Self] +// CHECK:STDOUT: %.loc11_32.2: type = converted %Self.ref.loc11_32, %.loc11_32.1 [symbolic = %Self] +// CHECK:STDOUT: %self.loc11_26.1: Self = param self +// CHECK:STDOUT: %self.loc11_26.2: Self = bind_name self, %self.loc11_26.1 +// CHECK:STDOUT: %Self.ref.loc11_45: Ordered = name_ref Self, %Self [symbolic = %Self] +// CHECK:STDOUT: %.loc11_45.1: type = facet_type_access %Self.ref.loc11_45 [symbolic = %Self] +// CHECK:STDOUT: %.loc11_45.2: type = converted %Self.ref.loc11_45, %.loc11_45.1 [symbolic = %Self] +// CHECK:STDOUT: %other.loc11_38.1: Self = param other +// CHECK:STDOUT: %other.loc11_38.2: Self = bind_name other, %other.loc11_38.1 +// CHECK:STDOUT: %return.var.loc11: ref bool = var +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc11_58: in Ordered> = assoc_entity element3, %GreaterOrEquivalent [template = constants.%.6] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .Less = %.loc6_43 -// CHECK:STDOUT: .LessOrEquivalent = %.loc7_55 -// CHECK:STDOUT: .Greater = %.loc8_46 -// CHECK:STDOUT: .GreaterOrEquivalent = %.loc9_58 +// CHECK:STDOUT: .Less = %.loc8_43 +// CHECK:STDOUT: .LessOrEquivalent = %.loc9_55 +// CHECK:STDOUT: .Greater = %.loc10_46 +// CHECK:STDOUT: .GreaterOrEquivalent = %.loc11_58 // CHECK:STDOUT: witness = (%Less, %LessOrEquivalent, %Greater, %GreaterOrEquivalent) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Less[@Ordered.%self.loc6_11.2: Self](@Ordered.%other.loc6_23.2: Self) -> bool; +// CHECK:STDOUT: fn @Less[@Ordered.%self.loc8_11.2: Self](@Ordered.%other.loc8_23.2: Self) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @LessOrEquivalent[@Ordered.%self.loc7_23.2: Self](@Ordered.%other.loc7_35.2: Self) -> bool; +// CHECK:STDOUT: fn @LessOrEquivalent[@Ordered.%self.loc9_23.2: Self](@Ordered.%other.loc9_35.2: Self) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater[@Ordered.%self.loc8_14.2: Self](@Ordered.%other.loc8_26.2: Self) -> bool; +// CHECK:STDOUT: fn @Greater[@Ordered.%self.loc10_14.2: Self](@Ordered.%other.loc10_26.2: Self) -> bool; // CHECK:STDOUT: -// CHECK:STDOUT: fn @GreaterOrEquivalent[@Ordered.%self.loc9_26.2: Self](@Ordered.%other.loc9_38.2: Self) -> bool; +// CHECK:STDOUT: fn @GreaterOrEquivalent[@Ordered.%self.loc11_26.2: Self](@Ordered.%other.loc11_38.2: Self) -> bool; // CHECK:STDOUT: // CHECK:STDOUT: --- user.carbon // CHECK:STDOUT: @@ -207,16 +209,16 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Ordered> = import_ref ir2, inst+17, loc_98 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: in Ordered> = import_ref ir2, inst+31, loc_118 [template = constants.%.8] -// CHECK:STDOUT: %import_ref.5: in Ordered> = import_ref ir2, inst+59, loc_158 [template = constants.%.10] -// CHECK:STDOUT: %import_ref.6: in Ordered> = import_ref ir2, inst+45, loc_138 [template = constants.%.9] -// CHECK:STDOUT: %import_ref.7: = import_ref ir2, inst+15, loc_19 [template = imports.%Less] -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+30, loc_19 [template = imports.%LessOrEquivalent] -// CHECK:STDOUT: %import_ref.9: = import_ref ir2, inst+44, loc_19 [template = imports.%Greater] -// CHECK:STDOUT: %import_ref.10: = import_ref ir2, inst+58, loc_19 [template = imports.%GreaterOrEquivalent] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Ordered> = import_ref ir3, inst+59, loc_158 [template = constants.%.10] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: in Ordered> = import_ref ir3, inst+45, loc_138 [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: in Ordered> = import_ref ir3, inst+17, loc_98 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in Ordered> = import_ref ir3, inst+31, loc_118 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.7: = import_ref ir3, inst+15, loc_19 [template = imports.%Less] +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+30, loc_19 [template = imports.%LessOrEquivalent] +// CHECK:STDOUT: %import_ref.9: = import_ref ir3, inst+44, loc_19 [template = imports.%Greater] +// CHECK:STDOUT: %import_ref.10: = import_ref ir3, inst+58, loc_19 [template = imports.%GreaterOrEquivalent] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] @@ -232,8 +234,8 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestLess.%b: C = bind_name b, %b.loc15_19.1 // CHECK:STDOUT: %return.var.loc15: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+1, loc_98 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+15, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+1, loc_98 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+15, unloaded // CHECK:STDOUT: %TestLessEqual: = fn_decl @TestLessEqual [template] { // CHECK:STDOUT: %C.ref.loc19_21: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc19_18.1: C = param a @@ -243,8 +245,8 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestLessEqual.%b: C = bind_name b, %b.loc19_24.1 // CHECK:STDOUT: %return.var.loc19: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: type = import_ref ir2, inst+1, loc_118 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.14 = import_ref ir2, inst+30, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref ir3, inst+1, loc_118 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.14 = import_ref ir3, inst+30, unloaded // CHECK:STDOUT: %TestGreater: = fn_decl @TestGreater [template] { // CHECK:STDOUT: %C.ref.loc23_19: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc23_16.1: C = param a @@ -254,8 +256,8 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestGreater.%b: C = bind_name b, %b.loc23_22.1 // CHECK:STDOUT: %return.var.loc23: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: type = import_ref ir2, inst+1, loc_138 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.16 = import_ref ir2, inst+44, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref ir3, inst+1, loc_138 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.16 = import_ref ir3, inst+44, unloaded // CHECK:STDOUT: %TestGreaterEqual: = fn_decl @TestGreaterEqual [template] { // CHECK:STDOUT: %C.ref.loc27_24: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc27_21.1: C = param a @@ -265,17 +267,17 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestGreaterEqual.%b: C = bind_name b, %b.loc27_27.1 // CHECK:STDOUT: %return.var.loc27: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.17: type = import_ref ir2, inst+1, loc_158 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.18 = import_ref ir2, inst+58, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref ir3, inst+1, loc_158 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.18 = import_ref ir3, inst+58, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Ordered { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Less = file.%import_ref.2 +// CHECK:STDOUT: .GreaterOrEquivalent = file.%import_ref.2 // CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .LessOrEquivalent = file.%import_ref.4 -// CHECK:STDOUT: .GreaterOrEquivalent = file.%import_ref.5 -// CHECK:STDOUT: .Greater = file.%import_ref.6 +// CHECK:STDOUT: .Greater = file.%import_ref.4 +// CHECK:STDOUT: .Less = file.%import_ref.5 +// CHECK:STDOUT: .LessOrEquivalent = file.%import_ref.6 // CHECK:STDOUT: witness = (file.%import_ref.7, file.%import_ref.8, file.%import_ref.9, file.%import_ref.10) // CHECK:STDOUT: } // CHECK:STDOUT: @@ -430,17 +432,17 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestLess.%b: D = bind_name b, %b.loc8_19.1 // CHECK:STDOUT: %return.var.loc8: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_30 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: in Ordered> = import_ref ir2, inst+17, loc_30 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: in Ordered> = import_ref ir2, inst+31, loc_50 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.5: in Ordered> = import_ref ir2, inst+59, loc_90 [template = constants.%.9] -// CHECK:STDOUT: %import_ref.6: in Ordered> = import_ref ir2, inst+45, loc_70 [template = constants.%.8] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+15, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+30, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+44, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+58, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+15, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_30 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.2: in Ordered> = import_ref ir3, inst+59, loc_90 [template = constants.%.9] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: in Ordered> = import_ref ir3, inst+45, loc_70 [template = constants.%.8] +// CHECK:STDOUT: %import_ref.5: in Ordered> = import_ref ir3, inst+17, loc_30 [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6: in Ordered> = import_ref ir3, inst+31, loc_50 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+15, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref ir3, inst+30, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref ir3, inst+44, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+58, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref ir3, inst+15, unloaded // CHECK:STDOUT: %TestLessEqual: = fn_decl @TestLessEqual [template] { // CHECK:STDOUT: %D.ref.loc16_21: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc16_18.1: D = param a @@ -450,8 +452,8 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestLessEqual.%b: D = bind_name b, %b.loc16_24.1 // CHECK:STDOUT: %return.var.loc16: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.12: type = import_ref ir2, inst+1, loc_50 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.13 = import_ref ir2, inst+30, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref ir3, inst+1, loc_50 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.13 = import_ref ir3, inst+30, unloaded // CHECK:STDOUT: %TestGreater: = fn_decl @TestGreater [template] { // CHECK:STDOUT: %D.ref.loc24_19: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc24_16.1: D = param a @@ -461,8 +463,8 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestGreater.%b: D = bind_name b, %b.loc24_22.1 // CHECK:STDOUT: %return.var.loc24: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.14: type = import_ref ir2, inst+1, loc_70 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.15 = import_ref ir2, inst+44, unloaded +// CHECK:STDOUT: %import_ref.14: type = import_ref ir3, inst+1, loc_70 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.15 = import_ref ir3, inst+44, unloaded // CHECK:STDOUT: %TestGreaterEqual: = fn_decl @TestGreaterEqual [template] { // CHECK:STDOUT: %D.ref.loc32_24: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc32_21.1: D = param a @@ -472,17 +474,17 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: @TestGreaterEqual.%b: D = bind_name b, %b.loc32_27.1 // CHECK:STDOUT: %return.var.loc32: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.16: type = import_ref ir2, inst+1, loc_90 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.17 = import_ref ir2, inst+58, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref ir3, inst+1, loc_90 [template = constants.%.4] +// CHECK:STDOUT: %import_ref.17 = import_ref ir3, inst+58, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Ordered { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Less = file.%import_ref.2 +// CHECK:STDOUT: .GreaterOrEquivalent = file.%import_ref.2 // CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .LessOrEquivalent = file.%import_ref.4 -// CHECK:STDOUT: .GreaterOrEquivalent = file.%import_ref.5 -// CHECK:STDOUT: .Greater = file.%import_ref.6 +// CHECK:STDOUT: .Greater = file.%import_ref.4 +// CHECK:STDOUT: .Less = file.%import_ref.5 +// CHECK:STDOUT: .LessOrEquivalent = file.%import_ref.6 // CHECK:STDOUT: witness = (file.%import_ref.7, file.%import_ref.8, file.%import_ref.9, file.%import_ref.10) // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index bcee2740dc44..be7804a1b3e5 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in RightShift> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in RightShift> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %RightShift.decl: invalid = interface_decl @RightShift [template = constants.%.2] {} // CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in RightShiftAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in RightShiftAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @RightShift { diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index b3ba42d4637b..f94a656a8f61 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -146,20 +146,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_18 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2: in Sub> = import_ref ir2, inst+20, loc_82 [template = constants.%.12] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: = import_ref ir2, inst+18, loc_19 [template = imports.%Op.1] +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loc_18 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2: in Sub> = import_ref ir3, inst+20, loc_82 [template = constants.%.12] +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref ir3, inst+18, loc_19 [template = imports.%Op.1] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc8: = name_ref Core, %Core [template = %Core] // CHECK:STDOUT: %Sub.decl: invalid = interface_decl @Sub [template = constants.%.2] {} // CHECK:STDOUT: %Sub.ref: type = name_ref Sub, %import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir2, inst+22, loc_46 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: in SubAssign> = import_ref ir2, inst+40, loc_101 [template = constants.%.14] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+24, unloaded -// CHECK:STDOUT: %import_ref.8: = import_ref ir2, inst+38, loc_47 [template = imports.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir3, inst+22, loc_46 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: in SubAssign> = import_ref ir3, inst+40, loc_101 [template = constants.%.14] +// CHECK:STDOUT: %import_ref.7 = import_ref ir3, inst+24, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref ir3, inst+38, loc_47 [template = imports.%Op.2] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc13: = name_ref Core, %Core [template = %Core] @@ -176,8 +176,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc17_26: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @TestOp.%return: ref C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir2, inst+1, loc_82 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+18, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir3, inst+1, loc_82 [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir3, inst+18, unloaded // CHECK:STDOUT: %TestAssign: = fn_decl @TestAssign [template] { // CHECK:STDOUT: %C.ref.loc21_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc21: type = ptr_type C [template = constants.%.8] @@ -187,8 +187,8 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc21_22.1: C = param b // CHECK:STDOUT: @TestAssign.%b: C = bind_name b, %b.loc21_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir2, inst+22, loc_101 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir2, inst+38, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir3, inst+22, loc_101 [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir3, inst+38, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Sub { diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index f6627c070d0c..e14290125048 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -15,8 +15,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 600a740ef0e8..58564e4fc6e7 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -45,9 +45,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %y.var: ref i32 = var y @@ -74,9 +76,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} @@ -114,9 +118,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/cross_package_import.carbon b/toolchain/check/testdata/packages/cross_package_import.carbon index 751af87a7ee6..293a072b6441 100644 --- a/toolchain/check/testdata/packages/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/cross_package_import.carbon @@ -164,8 +164,10 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -178,8 +180,10 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -189,8 +193,10 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %x.loc4_6.1: i32 = param x // CHECK:STDOUT: @F.%x: i32 = bind_name x, %x.loc4_6.1 @@ -206,8 +212,10 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F2 = %F2 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F2: = fn_decl @F2 [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -220,8 +228,10 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -233,13 +243,15 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_22 [template = imports.%F] -// CHECK:STDOUT: %import_ref.2: = import_ref ir3, inst+1, loc_28 [template = imports.%F2] +// CHECK:STDOUT: %import_ref.1: = import_ref ir3, inst+2, loc_22 [template = imports.%F] +// CHECK:STDOUT: %import_ref.2: = import_ref ir4, inst+2, loc_28 [template = imports.%F2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -265,13 +277,15 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_22 [template = imports.%F.1] -// CHECK:STDOUT: %import_ref.2: = import_ref ir3, inst+1, loaded [template = imports.%F.2] +// CHECK:STDOUT: %import_ref.1: = import_ref ir3, inst+2, loc_22 [template = imports.%F.1] +// CHECK:STDOUT: %import_ref.2: = import_ref ir4, inst+2, loaded [template = imports.%F.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -290,8 +304,10 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -303,13 +319,15 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: .Run = %Run // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] {} // CHECK:STDOUT: %Run: = fn_decl @Run [template] {} -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loc_22 [template = imports.%F.1] -// CHECK:STDOUT: %import_ref.2: = import_ref ir3, inst+3, loaded [template = imports.%F.2] +// CHECK:STDOUT: %import_ref.1: = import_ref ir3, inst+2, loc_22 [template = imports.%F.1] +// CHECK:STDOUT: %import_ref.2: = import_ref ir4, inst+4, loaded [template = imports.%F.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -329,10 +347,12 @@ fn Other.G() {} // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded // CHECK:STDOUT: %Other: = namespace %import_ref.1, [template] {} -// CHECK:STDOUT: %import_ref.2: = import_ref ir3, inst+1, loaded [template = imports.%F] +// CHECK:STDOUT: %Core: = namespace [template] {} +// CHECK:STDOUT: %import_ref.2: = import_ref ir3, inst+2, loaded [template = imports.%F] // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -345,8 +365,10 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] { // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } @@ -363,8 +385,10 @@ fn Other.G() {} // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Other: = namespace [template] { // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/explicit_imports.carbon b/toolchain/check/testdata/packages/explicit_imports.carbon index 4a30147813bb..845bcff4efb7 100644 --- a/toolchain/check/testdata/packages/explicit_imports.carbon +++ b/toolchain/check/testdata/packages/explicit_imports.carbon @@ -37,19 +37,28 @@ import library "lib"; // CHECK:STDOUT: --- api.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- api_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- same_package.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- different_package.carbon @@ -57,19 +66,27 @@ import library "lib"; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Api = %Api +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Api: = namespace [template] {} +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- main_lib_api.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- main_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_api_not_found.carbon b/toolchain/check/testdata/packages/fail_api_not_found.carbon index 56f19ec3d0f5..4693eac0aca1 100644 --- a/toolchain/check/testdata/packages/fail_api_not_found.carbon +++ b/toolchain/check/testdata/packages/fail_api_not_found.carbon @@ -31,23 +31,29 @@ library "Bar" impl; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: has_error // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_api_lib.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: has_error // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_api_main_lib.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: has_error // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index eb5fc0bd8415..771c83a32249 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -39,8 +39,10 @@ import library "var"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -50,8 +52,10 @@ import library "var"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Foo.var: ref i32 = var Foo // CHECK:STDOUT: %Foo: ref i32 = bind_name Foo, %Foo.var // CHECK:STDOUT: } @@ -61,9 +65,11 @@ import library "var"; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Foo = %import_ref.1 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+1, loaded [template = imports.%Foo] -// CHECK:STDOUT: %import_ref.2: ref i32 = import_ref ir3, inst+2, loaded +// CHECK:STDOUT: %import_ref.1: = import_ref ir2, inst+2, loaded [template = imports.%Foo] +// CHECK:STDOUT: %import_ref.2: ref i32 = import_ref ir3, inst+3, loaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo(); diff --git a/toolchain/check/testdata/packages/fail_cycle.carbon b/toolchain/check/testdata/packages/fail_cycle.carbon index 29773cfef146..f12712c4bac0 100644 --- a/toolchain/check/testdata/packages/fail_cycle.carbon +++ b/toolchain/check/testdata/packages/fail_cycle.carbon @@ -55,8 +55,10 @@ import B; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B: = namespace [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } @@ -66,8 +68,10 @@ import B; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C: = namespace [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } @@ -77,8 +81,10 @@ import B; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = namespace [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } @@ -88,16 +94,20 @@ import B; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: has_error // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_cycle_child.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B: = namespace [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/fail_duplicate_api.carbon b/toolchain/check/testdata/packages/fail_duplicate_api.carbon index b4dfb06a2a69..59506ef83243 100644 --- a/toolchain/check/testdata/packages/fail_duplicate_api.carbon +++ b/toolchain/check/testdata/packages/fail_duplicate_api.carbon @@ -48,48 +48,72 @@ package Package library "lib" api; // CHECK:STDOUT: --- main1.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main2.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- main_lib1.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib2.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- package1.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_package2.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- package_lib1.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_package_lib2.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_extension.carbon b/toolchain/check/testdata/packages/fail_extension.carbon index 1620e4f60a56..84285968e4d0 100644 --- a/toolchain/check/testdata/packages/fail_extension.carbon +++ b/toolchain/check/testdata/packages/fail_extension.carbon @@ -83,60 +83,90 @@ package SwappedExt impl; // CHECK:STDOUT: --- fail_main.incorrect // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_redundant_with_swapped_ext.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib.incorrect // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib_impl.incorrect // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_package.incorrect // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_package_impl.incorrect // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_package_lib.incorrect // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_package_lib_impl.incorrect // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_swapped_ext.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_swapped_ext.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_import_default.carbon b/toolchain/check/testdata/packages/fail_import_default.carbon index 6718bcf5f619..e22f434a3e26 100644 --- a/toolchain/check/testdata/packages/fail_import_default.carbon +++ b/toolchain/check/testdata/packages/fail_import_default.carbon @@ -44,24 +44,36 @@ import library default; // CHECK:STDOUT: --- fail_default_api.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_default.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_import_default.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib_import_default.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_import_invalid.carbon b/toolchain/check/testdata/packages/fail_import_invalid.carbon index d90a19ddf189..b146d3d940a6 100644 --- a/toolchain/check/testdata/packages/fail_import_invalid.carbon +++ b/toolchain/check/testdata/packages/fail_import_invalid.carbon @@ -93,57 +93,83 @@ import ImportNotFound; // CHECK:STDOUT: --- fail_main.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_not_main.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_this.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_this_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- implicit_api.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_implicit.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- implicit_lib_api.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_implicit_lib.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_not_found.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .ImportNotFound = %ImportNotFound // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %ImportNotFound: = namespace [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/fail_import_repeat.carbon b/toolchain/check/testdata/packages/fail_import_repeat.carbon index ea1b155a7316..a6d209ae7c1d 100644 --- a/toolchain/check/testdata/packages/fail_import_repeat.carbon +++ b/toolchain/check/testdata/packages/fail_import_repeat.carbon @@ -64,19 +64,28 @@ import library default; // CHECK:STDOUT: --- api.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- api_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- main_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import.carbon @@ -84,13 +93,18 @@ import library default; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Api = %Api +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Api: = namespace [template] {} +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_default_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index ba31c13ba06b..f37c5a1a32ef 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -43,11 +43,13 @@ var d: i32 = d_ref; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: .b_ref = %b_ref // CHECK:STDOUT: .c_ref = %c_ref // CHECK:STDOUT: .d_ref = %d_ref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.ref.loc8: = name_ref x, [template = ] // CHECK:STDOUT: %a_ref.var: ref = var a_ref // CHECK:STDOUT: %a_ref: ref = bind_name a_ref, %a_ref.var @@ -73,15 +75,17 @@ var d: i32 = d_ref; // CHECK:STDOUT: .b_ref = %import_ref.2 // CHECK:STDOUT: .c_ref = %import_ref.3 // CHECK:STDOUT: .d_ref = %import_ref.4 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: ref = import_ref ir1, inst+3, loc_10 -// CHECK:STDOUT: %import_ref.2: ref = import_ref ir1, inst+8, loc_17 -// CHECK:STDOUT: %import_ref.3: ref = import_ref ir1, inst+12, loc_24 -// CHECK:STDOUT: %import_ref.4: ref = import_ref ir1, inst+16, loc_31 +// CHECK:STDOUT: %import_ref.1: ref = import_ref ir1, inst+4, loc_10 +// CHECK:STDOUT: %import_ref.2: ref = import_ref ir1, inst+9, loc_17 +// CHECK:STDOUT: %import_ref.3: ref = import_ref ir1, inst+13, loc_24 +// CHECK:STDOUT: %import_ref.4: ref = import_ref ir1, inst+17, loc_31 +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: %b.var: ref i32 = var b 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 2a0eff9432c6..91fd8f64e01d 100644 --- a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon +++ b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon @@ -21,9 +21,11 @@ var a: () = A(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: has_error // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc7_9.2: type = converted %.loc7_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a diff --git a/toolchain/check/testdata/packages/fail_package_main.carbon b/toolchain/check/testdata/packages/fail_package_main.carbon index 3c8e2efd6212..bcdfc8593a27 100644 --- a/toolchain/check/testdata/packages/fail_package_main.carbon +++ b/toolchain/check/testdata/packages/fail_package_main.carbon @@ -39,24 +39,36 @@ package Main library "lib" api; // CHECK:STDOUT: --- fail_main.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_raw_main.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/implicit_imports.carbon b/toolchain/check/testdata/packages/implicit_imports.carbon index 4b77a9a86c7d..51bbeaff0fc9 100644 --- a/toolchain/check/testdata/packages/implicit_imports.carbon +++ b/toolchain/check/testdata/packages/implicit_imports.carbon @@ -46,60 +46,90 @@ library "lib" impl; // CHECK:STDOUT: --- api_only.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- api_only_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- with_impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- with_impl.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- with_impl_extra.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- with_impl_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- with_impl_lib.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- main.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- main_lib.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- main_lib.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/loaded_global.carbon b/toolchain/check/testdata/packages/loaded_global.carbon index b4ca280c92c6..b20162e29804 100644 --- a/toolchain/check/testdata/packages/loaded_global.carbon +++ b/toolchain/check/testdata/packages/loaded_global.carbon @@ -38,8 +38,10 @@ var package_b: () = package.B(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -54,10 +56,12 @@ var package_b: () = package.B(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .package_a = %package_a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loc_11 [template = imports.%A] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+2, loc_11 [template = imports.%A] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref () = var a @@ -86,8 +90,10 @@ var package_b: () = package.B(); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %B: = fn_decl @B [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -102,10 +108,12 @@ var package_b: () = package.B(); // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .B = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .package_b = %package_b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+1, loc_17 [template = imports.%B] +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+2, loc_17 [template = imports.%B] +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc6_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %b.var: ref () = var b diff --git a/toolchain/check/testdata/packages/unused_lazy_import.carbon b/toolchain/check/testdata/packages/unused_lazy_import.carbon index 520814130d1f..117d5933c0ef 100644 --- a/toolchain/check/testdata/packages/unused_lazy_import.carbon +++ b/toolchain/check/testdata/packages/unused_lazy_import.carbon @@ -18,8 +18,10 @@ package Implicit impl; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -30,7 +32,9 @@ package Implicit impl; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index 829927772c41..8d57e523208c 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -18,8 +18,10 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 4a244700392b..7841ff75d9d0 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -34,8 +34,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/arrow.carbon b/toolchain/check/testdata/pointer/arrow.carbon index 1b55a2c86217..4db1d31b2f06 100644 --- a/toolchain/check/testdata/pointer/arrow.carbon +++ b/toolchain/check/testdata/pointer/arrow.carbon @@ -32,9 +32,11 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .Foo = %Foo // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %Foo: = fn_decl @Foo [template] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index 01b662742484..01103e285927 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -20,8 +20,10 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_address_of_error.carbon b/toolchain/check/testdata/pointer/fail_address_of_error.carbon index 99b904e83743..8eb8cc8be1e2 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_error.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_error.carbon @@ -24,8 +24,10 @@ fn Test() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Test = %Test // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Test: = fn_decl @Test [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index 072e5e77e167..a59df3fd7410 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -122,6 +122,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .H = %H // CHECK:STDOUT: .AddressOfLiteral = %AddressOfLiteral @@ -131,6 +132,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: .AddressOfTupleElementValue = %AddressOfTupleElementValue // CHECK:STDOUT: .AddressOfParam = %AddressOfParam // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %return.var.loc7: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index b90b58af962e..b1a591f9299b 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -17,7 +17,10 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: --- fail_deref_error.carbon // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] {} +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %undeclared.ref.loc11: = name_ref undeclared, [template = ] // CHECK:STDOUT: %.loc11: ref = deref // CHECK:STDOUT: %n: i32 = bind_name n, diff --git a/toolchain/check/testdata/pointer/fail_deref_function.carbon b/toolchain/check/testdata/pointer/fail_deref_function.carbon index aed0bc79c57a..62e8ca269091 100644 --- a/toolchain/check/testdata/pointer/fail_deref_function.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_function.carbon @@ -20,8 +20,10 @@ fn A() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon index 9c5243123fb8..6f41054b2ce3 100644 --- a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon @@ -22,9 +22,11 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index 922958f38ccf..01e442cff586 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -47,8 +47,10 @@ fn Deref(n: i32) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Deref = %Deref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Deref: = fn_decl @Deref [template] { // CHECK:STDOUT: %n.loc7_10.1: i32 = param n // CHECK:STDOUT: @Deref.%n: i32 = bind_name n, %n.loc7_10.1 diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 03565c6e1943..a8da68a1e2ca 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -21,9 +21,11 @@ var p2: i32->foo; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .p = %p // CHECK:STDOUT: .p2 = %p2 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc14: ref = deref i32 // CHECK:STDOUT: %p.var: ref = var p // CHECK:STDOUT: %p: ref = bind_name p, %p.var diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index ae14163bcf2c..ecb7f564f818 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -23,8 +23,10 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .ConstMismatch = %ConstMismatch // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %ConstMismatch: = fn_decl @ConstMismatch [template] { // CHECK:STDOUT: %.loc7_28.1: {} = struct_literal () // CHECK:STDOUT: %.loc7_28.2: type = converted %.loc7_28.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index edb375da7e15..4b3e9cb61e33 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -26,9 +26,11 @@ var a: i32* = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a_orig = %a_orig // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a_orig.var: ref i32 = var a_orig // CHECK:STDOUT: %a_orig: ref i32 = bind_name a_orig, %a_orig.var // CHECK:STDOUT: %.loc5: type = ptr_type i32 [template = constants.%.2] @@ -56,10 +58,12 @@ var a: i32* = a_ref; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a_orig = %import_ref.1 // CHECK:STDOUT: .a_ref = %import_ref.2 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.2: ref i32* = import_ref ir1, inst+9, loc_11 +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2: ref i32* = import_ref ir1, inst+10, loc_11 +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4: type = ptr_type i32 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref i32* = var a // CHECK:STDOUT: %a: ref i32* = bind_name a, %a.var diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index b8301877fd32..e50f2fcb3155 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -21,8 +21,10 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc8_23: type = const_type i32 [template = constants.%.1] // CHECK:STDOUT: %.loc8_32: type = ptr_type const i32 [template = constants.%.2] diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index f96a9e2398ea..04cbd8faa5bb 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -22,9 +22,11 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Ptr = %Ptr // CHECK:STDOUT: .ConstPtr = %ConstPtr // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Ptr: = fn_decl @Ptr [template] { // CHECK:STDOUT: %.loc7_14: type = ptr_type i32 [template = constants.%.1] // CHECK:STDOUT: %p.loc7_8.1: i32* = param p diff --git a/toolchain/check/testdata/return/code_after_return.carbon b/toolchain/check/testdata/return/code_after_return.carbon index a02b26b810e6..a95674c2dc9e 100644 --- a/toolchain/check/testdata/return/code_after_return.carbon +++ b/toolchain/check/testdata/return/code_after_return.carbon @@ -17,8 +17,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 246c21ae4f96..cf33a13b2503 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -28,8 +28,10 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %b.loc7_6.1: bool = param b // CHECK:STDOUT: @F.%b: bool = bind_name b, %b.loc7_6.1 diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index 7e047d6e2ea7..4aa29b133b1a 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -20,9 +20,11 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .ReturnType = %ReturnType // CHECK:STDOUT: .Six = %Six // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %ReturnType: = fn_decl @ReturnType [template] { // CHECK:STDOUT: %return.var.loc9: ref type = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_error_in_type.carbon b/toolchain/check/testdata/return/fail_error_in_type.carbon index 2c98c6166620..5eb5a36b2706 100644 --- a/toolchain/check/testdata/return/fail_error_in_type.carbon +++ b/toolchain/check/testdata/return/fail_error_in_type.carbon @@ -13,8 +13,10 @@ fn Six() -> x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Six = %Six // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Six: = fn_decl @Six [template] { // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] // CHECK:STDOUT: %return.var: ref = var diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index 340dc2738ef5..2a5e7d548b19 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -14,8 +14,10 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } 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 e0fbcd5fa437..a3f1514a39eb 100644 --- a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon +++ b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon @@ -18,8 +18,10 @@ fn F() -> () { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_12.1: () = tuple_literal () // CHECK:STDOUT: %.loc7_12.2: type = converted %.loc7_12.1, constants.%.1 [template = constants.%.1] 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 e4e5980bde46..e5f13aa47604 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 @@ -15,8 +15,10 @@ fn Procedure() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Procedure = %Procedure // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Procedure: = fn_decl @Procedure [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } 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 e667c72a79be..4334b7d3063d 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -43,10 +43,12 @@ fn G() -> C { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var.loc7: ref i32 = var // CHECK:STDOUT: } 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 9fa782f86546..c9116c957688 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 @@ -23,8 +23,10 @@ fn Procedure() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Procedure = %Procedure // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Procedure: = fn_decl @Procedure [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 1ad0e137f973..1b5c134c353a 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -45,9 +45,11 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .SameScope = %SameScope // CHECK:STDOUT: .DifferentScopes = %DifferentScopes // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %SameScope: = fn_decl @SameScope [template] { // CHECK:STDOUT: %return.var.loc7: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index bb5a72ce074c..83ae4d0c0d80 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -23,8 +23,10 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Mismatch = %Mismatch // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Mismatch: = fn_decl @Mismatch [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 693f6268224c..8a5c76c988a2 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -19,8 +19,10 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_value_disallowed.carbon b/toolchain/check/testdata/return/fail_value_disallowed.carbon index d8c44439ac86..a4b9dca7c744 100644 --- a/toolchain/check/testdata/return/fail_value_disallowed.carbon +++ b/toolchain/check/testdata/return/fail_value_disallowed.carbon @@ -22,8 +22,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 9a9ad1a14f4a..9d19f2e9b03a 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -18,8 +18,10 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index 5be468a309fc..e452589ba5ee 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -18,9 +18,11 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .Six = %Six // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref type = var x // CHECK:STDOUT: %x: ref type = bind_name x, %x.var // CHECK:STDOUT: %Six: = fn_decl @Six [template] { diff --git a/toolchain/check/testdata/return/missing_return_no_return_type.carbon b/toolchain/check/testdata/return/missing_return_no_return_type.carbon index 4d97aa856f91..618d20762fb5 100644 --- a/toolchain/check/testdata/return/missing_return_no_return_type.carbon +++ b/toolchain/check/testdata/return/missing_return_no_return_type.carbon @@ -11,8 +11,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/no_value.carbon b/toolchain/check/testdata/return/no_value.carbon index a23783f5c881..e72b242131d7 100644 --- a/toolchain/check/testdata/return/no_value.carbon +++ b/toolchain/check/testdata/return/no_value.carbon @@ -12,8 +12,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 7e5d428f4a15..a4968c910e66 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -34,10 +34,12 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 46096dfc5a48..ff4dc07ba434 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -33,9 +33,11 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .UnrelatedScopes = %UnrelatedScopes // CHECK:STDOUT: .EnclosingButAfter = %EnclosingButAfter // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %UnrelatedScopes: = fn_decl @UnrelatedScopes [template] { // CHECK:STDOUT: %return.var.loc7: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index 531164886898..3c001b78075d 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -18,8 +18,10 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %.loc7: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %return.var: ref {.a: i32} = var diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index d0863a7e516f..afd45305a47e 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -22,8 +22,10 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %.loc8_23.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc8_23.2: type = converted %.loc8_23.1, constants.%.2 [template = constants.%.2] diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 1d64413c46df..d0fecdc5563f 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -16,8 +16,10 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] { // CHECK:STDOUT: %return.var: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/empty.carbon b/toolchain/check/testdata/struct/empty.carbon index 9c7847ca396b..89ae8f5adc64 100644 --- a/toolchain/check/testdata/struct/empty.carbon +++ b/toolchain/check/testdata/struct/empty.carbon @@ -17,9 +17,11 @@ var y: {} = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_9.1: {} = struct_literal () // CHECK:STDOUT: %.loc7_9.2: type = converted %.loc7_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {} = var x diff --git a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon index d41eab9e5888..409dedac0b44 100644 --- a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon +++ b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon @@ -14,8 +14,10 @@ fn F() { a.b; } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index bf178ac99f7b..3b19bedc2db6 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -18,8 +18,10 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_assign_nested.carbon b/toolchain/check/testdata/struct/fail_assign_nested.carbon index b7fc6a22c0c7..f7351e02ea02 100644 --- a/toolchain/check/testdata/struct/fail_assign_nested.carbon +++ b/toolchain/check/testdata/struct/fail_assign_nested.carbon @@ -21,8 +21,10 @@ var x: {.a: {}} = {.b = {}}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_14.1: {} = struct_literal () // CHECK:STDOUT: %.loc10_14.2: type = converted %.loc10_14.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_15: type = struct_type {.a: {}} [template = constants.%.2] diff --git a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon index ab17cb209a7f..43e34507bf7b 100644 --- a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon @@ -20,8 +20,10 @@ var x: {} = {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_9.1: {} = struct_literal () // CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {} = var x diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index ccb3d1591c6e..aeee38eaa974 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -62,10 +62,12 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %return.var: ref = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index 0982b0d5f465..0197efddd01a 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -25,9 +25,11 @@ var y: {.b: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc11: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index 6d661cae08ba..0b44662d0060 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -19,8 +19,10 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 691cf494fe0a..88e38a98d8bb 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -20,9 +20,11 @@ var y: i32 = x.b; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7: type = struct_type {.a: f64} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: f64} = var x // CHECK:STDOUT: %x: ref {.a: f64} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_member_of_function.carbon b/toolchain/check/testdata/struct/fail_member_of_function.carbon index 3200041eaa7a..c5a34f4064a1 100644 --- a/toolchain/check/testdata/struct/fail_member_of_function.carbon +++ b/toolchain/check/testdata/struct/fail_member_of_function.carbon @@ -15,8 +15,10 @@ fn A() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon index d403eb1cf6ad..b289e60f7f67 100644 --- a/toolchain/check/testdata/struct/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon @@ -26,10 +26,12 @@ var p: Incomplete* = &s.a; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Incomplete = %Incomplete.decl // CHECK:STDOUT: .s = %s // CHECK:STDOUT: .p = %p // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: %Incomplete.ref.loc15: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc15: type = struct_type {.a: Incomplete} [template = constants.%.1] diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 126d0b5ae290..8b4dd65922b3 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -20,9 +20,11 @@ var y: i32 = x.b; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index c59baa7c6e45..c04c221abf4e 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -20,8 +20,10 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: i32, .b: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32, .b: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index aeef2ab83f1e..2f8a2349bd88 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -17,8 +17,10 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index df2dcb652121..a12f43e3eadb 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -18,8 +18,10 @@ var x: {.a = 1}; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_15: {.a: i32} = struct_literal (%.loc10_14) // CHECK:STDOUT: %x.var: ref = var x diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 18ca99210237..44767239c653 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -39,9 +39,11 @@ var b: {.a: {.b: i32, .c: (i32,)}, .d: i32} = b_ref; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: .b_ref = %b_ref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %a_ref.var: ref {.a: i32} = var a_ref // CHECK:STDOUT: %a_ref: ref {.a: i32} = bind_name a_ref, %a_ref.var @@ -100,11 +102,13 @@ var b: {.a: {.b: i32, .c: (i32,)}, .d: i32} = b_ref; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a_ref = %import_ref.1 // CHECK:STDOUT: .b_ref = %import_ref.2 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: ref {.a: i32} = import_ref ir1, inst+6, loc_15 -// CHECK:STDOUT: %import_ref.2: ref {.a: {.b: i32, .c: (i32,)}, .d: i32} = import_ref ir1, inst+37, loc_45 +// CHECK:STDOUT: %import_ref.1: ref {.a: i32} = import_ref ir1, inst+7, loc_15 +// CHECK:STDOUT: %import_ref.2: ref {.a: {.b: i32, .c: (i32,)}, .d: i32} = import_ref ir1, inst+38, loc_45 +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %a.var: ref {.a: i32} = var a // CHECK:STDOUT: %a: ref {.a: i32} = bind_name a, %a.var diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index 319ac42f5865..3cbd20fe498e 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -24,9 +24,11 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %G: = fn_decl @G [template] { // CHECK:STDOUT: %.loc7: type = struct_type {.x: i32, .y: i32, .z: i32} [template = constants.%.1] // CHECK:STDOUT: @G.%return: ref {.x: i32, .y: i32, .z: i32} = var diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 1f6e62a36dad..7a99e5031943 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -20,10 +20,12 @@ var z: i32 = y; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: .z = %z // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7: type = struct_type {.a: f64, .b: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: f64, .b: i32} = var x // CHECK:STDOUT: %x: ref {.a: f64, .b: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index 2f9244412c7f..cea2a063f1e3 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -23,9 +23,11 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_25.1: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%.2 [template = constants.%.2] diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index f21ee9e73eda..d16d99c81db4 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -17,9 +17,11 @@ var y: {.a: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7: type = struct_type {.a: i32} [template = constants.%.1] // CHECK:STDOUT: %x.var: ref {.a: i32} = var x // CHECK:STDOUT: %x: ref {.a: i32} = bind_name x, %x.var diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index 56b20e2b2f4f..0dd2979b49bb 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -24,10 +24,12 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .MakeI32 = %MakeI32 // CHECK:STDOUT: .MakeF64 = %MakeF64 // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %MakeI32: = fn_decl @MakeI32 [template] { // CHECK:STDOUT: %return.var.loc7: ref i32 = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index a81ee89f6ba7..6a5f41c8dee9 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -22,9 +22,11 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_27.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_27.2: type = converted %.loc7_27.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %.loc7_28: type = struct_type {.a: i32, .b: (i32,)} [template = constants.%.3] diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index ae62f59c1c52..0f594f0dcb00 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -22,9 +22,11 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.1] // CHECK:STDOUT: %.loc7_35: i32 = int_literal 1 [template = constants.%.3] // CHECK:STDOUT: %.loc7_43: i32 = int_literal 2 [template = constants.%.4] diff --git a/toolchain/check/testdata/tuples/empty.carbon b/toolchain/check/testdata/tuples/empty.carbon index 03a7e688a9c1..bb5a7484280d 100644 --- a/toolchain/check/testdata/tuples/empty.carbon +++ b/toolchain/check/testdata/tuples/empty.carbon @@ -16,9 +16,11 @@ var y: () = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc7_9.2: type = converted %.loc7_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %x.var: ref () = var x diff --git a/toolchain/check/testdata/tuples/fail_assign_empty.carbon b/toolchain/check/testdata/tuples/fail_assign_empty.carbon index 3013bc77c75a..8e021e71312b 100644 --- a/toolchain/check/testdata/tuples/fail_assign_empty.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_empty.carbon @@ -19,8 +19,10 @@ var x: (i32,) = (); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_13.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc10_13.2: type = converted %.loc10_13.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %x.var: ref (i32,) = var x diff --git a/toolchain/check/testdata/tuples/fail_assign_nested.carbon b/toolchain/check/testdata/tuples/fail_assign_nested.carbon index a222e723d983..d9cc10f7f8ab 100644 --- a/toolchain/check/testdata/tuples/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_nested.carbon @@ -31,8 +31,10 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_18.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_30.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_31.1: ((type, type), (type, type)) = tuple_literal (%.loc10_18.1, %.loc10_30.1) diff --git a/toolchain/check/testdata/tuples/fail_assign_to_empty.carbon b/toolchain/check/testdata/tuples/fail_assign_to_empty.carbon index 9ce510968535..5d4b3fea69db 100644 --- a/toolchain/check/testdata/tuples/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_to_empty.carbon @@ -18,8 +18,10 @@ var x: () = (66); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_9.1: () = tuple_literal () // CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %x.var: ref () = var x diff --git a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon index bc577cf7289e..de1d8ade2966 100644 --- a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon @@ -22,8 +22,10 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %x.var: ref (i32, i32) = var x diff --git a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon index e0a9bf48320c..ace70ecff4f3 100644 --- a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon @@ -28,10 +28,12 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Incomplete = %Incomplete.decl // CHECK:STDOUT: .t = %t // CHECK:STDOUT: .p = %p // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: %Incomplete.ref.loc15: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc15_24.1: (type, type) = tuple_literal (i32, %Incomplete.ref.loc15) diff --git a/toolchain/check/testdata/tuples/fail_too_few_element.carbon b/toolchain/check/testdata/tuples/fail_too_few_element.carbon index a7f348a96b22..073e7837b9aa 100644 --- a/toolchain/check/testdata/tuples/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuples/fail_too_few_element.carbon @@ -21,8 +21,10 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %x.var: ref (i32, i32) = var x diff --git a/toolchain/check/testdata/tuples/fail_type_assign.carbon b/toolchain/check/testdata/tuples/fail_type_assign.carbon index a1316acb5c69..b7d4fe3fb0ff 100644 --- a/toolchain/check/testdata/tuples/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuples/fail_type_assign.carbon @@ -18,8 +18,10 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_14.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc10_14.2: type = converted %.loc10_14.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %x.var: ref (i32,) = var x diff --git a/toolchain/check/testdata/tuples/fail_value_as_type.carbon b/toolchain/check/testdata/tuples/fail_value_as_type.carbon index 3aa1212cbf4c..589c5e6be4d8 100644 --- a/toolchain/check/testdata/tuples/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuples/fail_value_as_type.carbon @@ -18,8 +18,10 @@ var x: (1, ); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc10_9: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc10_12: (i32,) = tuple_literal (%.loc10_9) // CHECK:STDOUT: %x.var: ref = var x diff --git a/toolchain/check/testdata/tuples/import.carbon b/toolchain/check/testdata/tuples/import.carbon index d062b7cc615a..00984e4b9311 100644 --- a/toolchain/check/testdata/tuples/import.carbon +++ b/toolchain/check/testdata/tuples/import.carbon @@ -45,9 +45,11 @@ var b: (((i32,), i32), (i32, i32)) = b_ref; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: .b_ref = %b_ref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4_17.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc4_17.2: type = converted %.loc4_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a_ref.var: ref (i32,) = var a_ref @@ -122,11 +124,13 @@ var b: (((i32,), i32), (i32, i32)) = b_ref; // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a_ref = %import_ref.1 // CHECK:STDOUT: .b_ref = %import_ref.2 +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: ref (i32,) = import_ref ir1, inst+6, loc_13 -// CHECK:STDOUT: %import_ref.2: ref (((i32,), i32), (i32, i32)) = import_ref ir1, inst+34, loc_35 +// CHECK:STDOUT: %import_ref.1: ref (i32,) = import_ref ir1, inst+7, loc_13 +// CHECK:STDOUT: %import_ref.2: ref (((i32,), i32), (i32, i32)) = import_ref ir1, inst+35, loc_35 +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc4_13.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc4_13.2: type = converted %.loc4_13.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %a.var: ref (i32,) = var a diff --git a/toolchain/check/testdata/tuples/nested_tuple.carbon b/toolchain/check/testdata/tuples/nested_tuple.carbon index 843d75af3ba1..7713814139d4 100644 --- a/toolchain/check/testdata/tuples/nested_tuple.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple.carbon @@ -25,8 +25,10 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_18.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_24.1: ((type, type), type) = tuple_literal (%.loc7_18.1, i32) // CHECK:STDOUT: %.loc7_18.2: type = converted %.loc7_18.1, constants.%.3 [template = constants.%.3] diff --git a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon index c036978f8e47..4bc46e272680 100644 --- a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon @@ -34,10 +34,12 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .H = %H // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %.loc7_25.1: (type, type, type) = tuple_literal (i32, i32, i32) // CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%.2 [template = constants.%.2] diff --git a/toolchain/check/testdata/tuples/one_element.carbon b/toolchain/check/testdata/tuples/one_element.carbon index fb1106bf2ff2..960a9f09e509 100644 --- a/toolchain/check/testdata/tuples/one_element.carbon +++ b/toolchain/check/testdata/tuples/one_element.carbon @@ -18,9 +18,11 @@ var y: (i32,) = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_13.1: (type,) = tuple_literal (i32) // CHECK:STDOUT: %.loc7_13.2: type = converted %.loc7_13.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %x.var: ref (i32,) = var x diff --git a/toolchain/check/testdata/tuples/two_elements.carbon b/toolchain/check/testdata/tuples/two_elements.carbon index f2e4b4a787a7..63fe4fe3b99e 100644 --- a/toolchain/check/testdata/tuples/two_elements.carbon +++ b/toolchain/check/testdata/tuples/two_elements.carbon @@ -23,9 +23,11 @@ var y: (i32, i32) = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %.loc7_17.1: (type, type) = tuple_literal (i32, i32) // CHECK:STDOUT: %.loc7_17.2: type = converted %.loc7_17.1, constants.%.2 [template = constants.%.2] // CHECK:STDOUT: %.loc7_22: i32 = int_literal 4 [template = constants.%.4] diff --git a/toolchain/check/testdata/var/decl.carbon b/toolchain/check/testdata/var/decl.carbon index 2d34ba139477..0a85e92cf5f1 100644 --- a/toolchain/check/testdata/var/decl.carbon +++ b/toolchain/check/testdata/var/decl.carbon @@ -12,8 +12,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/decl_with_init.carbon b/toolchain/check/testdata/var/decl_with_init.carbon index 07bf3a500b91..a5d99ea0c278 100644 --- a/toolchain/check/testdata/var/decl_with_init.carbon +++ b/toolchain/check/testdata/var/decl_with_init.carbon @@ -16,8 +16,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/fail_duplicate_decl.carbon index a374cc7ada38..5761fd757275 100644 --- a/toolchain/check/testdata/var/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/fail_duplicate_decl.carbon @@ -24,8 +24,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_generic.carbon b/toolchain/check/testdata/var/fail_generic.carbon index a3af4605eb07..7a525d32feb9 100644 --- a/toolchain/check/testdata/var/fail_generic.carbon +++ b/toolchain/check/testdata/var/fail_generic.carbon @@ -19,8 +19,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/fail_init_type_mismatch.carbon index 0a015e9b49ff..c2a0e98365d7 100644 --- a/toolchain/check/testdata/var/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/fail_init_type_mismatch.carbon @@ -19,8 +19,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_init_with_self.carbon b/toolchain/check/testdata/var/fail_init_with_self.carbon index 384b58b69db7..fcd999345543 100644 --- a/toolchain/check/testdata/var/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/fail_init_with_self.carbon @@ -15,8 +15,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon b/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon index 0d29fcfa6fc2..bdb3ef8aaca6 100644 --- a/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon +++ b/toolchain/check/testdata/var/fail_lookup_outside_scope.carbon @@ -17,9 +17,11 @@ var y: i32 = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: %y.var: ref i32 = var y // CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var diff --git a/toolchain/check/testdata/var/fail_modifiers.carbon b/toolchain/check/testdata/var/fail_modifiers.carbon index fc4277be3814..a829f55b7dc5 100644 --- a/toolchain/check/testdata/var/fail_modifiers.carbon +++ b/toolchain/check/testdata/var/fail_modifiers.carbon @@ -45,11 +45,13 @@ abstract var e: i32; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var // CHECK:STDOUT: %c.var: ref i32 = var c diff --git a/toolchain/check/testdata/var/fail_namespace_conflict.carbon b/toolchain/check/testdata/var/fail_namespace_conflict.carbon index 302d47abf887..06da43f5d6d2 100644 --- a/toolchain/check/testdata/var/fail_namespace_conflict.carbon +++ b/toolchain/check/testdata/var/fail_namespace_conflict.carbon @@ -31,8 +31,10 @@ var A: i32 = 1; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A.loc7 // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A.loc7: = namespace [template] {} // CHECK:STDOUT: %A.var.loc16: ref i32 = var A // CHECK:STDOUT: %A.loc16: ref i32 = bind_name A, %A.var.loc16 diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 92a3f9c56074..d96d1cffaf9c 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -36,9 +36,11 @@ fn F(x: X) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .X = %X.decl // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} // CHECK:STDOUT: %F: = fn_decl @F [template] { // CHECK:STDOUT: %X.ref: type = name_ref X, %X.decl [template = constants.%X] diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index e4fd5c7135e8..21ca11b139c0 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -19,8 +19,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_todo_modifiers.carbon b/toolchain/check/testdata/var/fail_todo_modifiers.carbon index cd5b14975f89..e9e414d6f3f4 100644 --- a/toolchain/check/testdata/var/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/var/fail_todo_modifiers.carbon @@ -13,8 +13,10 @@ private var a: i32; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/global_decl.carbon b/toolchain/check/testdata/var/global_decl.carbon index 6a82c05a5147..97dab4dc96f9 100644 --- a/toolchain/check/testdata/var/global_decl.carbon +++ b/toolchain/check/testdata/var/global_decl.carbon @@ -10,8 +10,10 @@ var x: i32; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/global_decl_with_init.carbon b/toolchain/check/testdata/var/global_decl_with_init.carbon index 6b2e706754c9..f83854399a15 100644 --- a/toolchain/check/testdata/var/global_decl_with_init.carbon +++ b/toolchain/check/testdata/var/global_decl_with_init.carbon @@ -14,8 +14,10 @@ var x: i32 = 0; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/global_lookup.carbon b/toolchain/check/testdata/var/global_lookup.carbon index 47f6c0189b5a..a3455a09404d 100644 --- a/toolchain/check/testdata/var/global_lookup.carbon +++ b/toolchain/check/testdata/var/global_lookup.carbon @@ -15,9 +15,11 @@ var y: i32 = x; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .y = %y // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %y.var: ref i32 = var y diff --git a/toolchain/check/testdata/var/global_lookup_in_scope.carbon b/toolchain/check/testdata/var/global_lookup_in_scope.carbon index dc49668bfac9..2743c62ff093 100644 --- a/toolchain/check/testdata/var/global_lookup_in_scope.carbon +++ b/toolchain/check/testdata/var/global_lookup_in_scope.carbon @@ -18,9 +18,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .x = %x // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} diff --git a/toolchain/check/testdata/var/import.carbon b/toolchain/check/testdata/var/import.carbon index 21ecf90114b1..45fbde6db3ae 100644 --- a/toolchain/check/testdata/var/import.carbon +++ b/toolchain/check/testdata/var/import.carbon @@ -24,8 +24,10 @@ var a: i32 = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a_ref = %a_ref // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a_ref.var: ref i32 = var a_ref // CHECK:STDOUT: %a_ref: ref i32 = bind_name a_ref, %a_ref.var // CHECK:STDOUT: } @@ -42,9 +44,11 @@ var a: i32 = a_ref; // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .a_ref = %import_ref +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: ref i32 = import_ref ir1, inst+2, loc_10 +// CHECK:STDOUT: %import_ref: ref i32 = import_ref ir1, inst+3, loc_10 +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/lookup.carbon b/toolchain/check/testdata/var/lookup.carbon index 3097ff50d2a0..6b815bcd565c 100644 --- a/toolchain/check/testdata/var/lookup.carbon +++ b/toolchain/check/testdata/var/lookup.carbon @@ -17,8 +17,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/shadowing.carbon b/toolchain/check/testdata/var/shadowing.carbon index 71fb3d35a3a8..e4d42417f665 100644 --- a/toolchain/check/testdata/var/shadowing.carbon +++ b/toolchain/check/testdata/var/shadowing.carbon @@ -29,9 +29,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Main = %Main // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: %Main: = fn_decl @Main [template] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/while/break_continue.carbon b/toolchain/check/testdata/while/break_continue.carbon index 3e9586ecf37e..56ff1bba64db 100644 --- a/toolchain/check/testdata/while/break_continue.carbon +++ b/toolchain/check/testdata/while/break_continue.carbon @@ -30,6 +30,7 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .A = %A // CHECK:STDOUT: .B = %B // CHECK:STDOUT: .C = %C @@ -40,6 +41,7 @@ fn While() { // CHECK:STDOUT: .H = %H // CHECK:STDOUT: .While = %While // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %A: = fn_decl @A [template] { // CHECK:STDOUT: %return.var.loc7: ref bool = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index a6e7fe507048..840579d4da66 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -20,8 +20,10 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .While = %While // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %While: = fn_decl @While [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/while/fail_break_continue.carbon b/toolchain/check/testdata/while/fail_break_continue.carbon index 97ad034401dd..db85558116af 100644 --- a/toolchain/check/testdata/while/fail_break_continue.carbon +++ b/toolchain/check/testdata/while/fail_break_continue.carbon @@ -38,8 +38,10 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .While = %While // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %While: = fn_decl @While [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/while/unreachable_end.carbon b/toolchain/check/testdata/while/unreachable_end.carbon index abaaaca3c028..6dfc29e927f5 100644 --- a/toolchain/check/testdata/while/unreachable_end.carbon +++ b/toolchain/check/testdata/while/unreachable_end.carbon @@ -27,12 +27,14 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Cond = %Cond // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .H = %H // CHECK:STDOUT: .While = %While // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Cond: = fn_decl @Cond [template] { // CHECK:STDOUT: %return.var: ref bool = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/while/while.carbon b/toolchain/check/testdata/while/while.carbon index 01ac8b140858..6ccb939da7b6 100644 --- a/toolchain/check/testdata/while/while.carbon +++ b/toolchain/check/testdata/while/while.carbon @@ -26,12 +26,14 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Cond = %Cond // CHECK:STDOUT: .F = %F // CHECK:STDOUT: .G = %G // CHECK:STDOUT: .H = %H // CHECK:STDOUT: .While = %While // CHECK:STDOUT: } +// CHECK:STDOUT: %Core: = namespace [template] {} // CHECK:STDOUT: %Cond: = fn_decl @Cond [template] { // CHECK:STDOUT: %return.var: ref bool = var // CHECK:STDOUT: } diff --git a/toolchain/codegen/testdata/assembly/basic.carbon b/toolchain/codegen/testdata/assembly/basic.carbon index 221ba3ab1d28..3b8c3e727c52 100644 --- a/toolchain/codegen/testdata/assembly/basic.carbon +++ b/toolchain/codegen/testdata/assembly/basic.carbon @@ -2,9 +2,9 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --target=x86_64-unknown-linux-gnu --output=- %s +// ARGS: compile --no-prelude-import --target=x86_64-unknown-linux-gnu --output=- %s // NOAUTOUPDATE // SET-CHECK-SUBSET // CHECK:STDOUT: Main: -fn Main() -> i32 { return 0; } +fn Main() {} diff --git a/toolchain/codegen/testdata/fail_target_triple.carbon b/toolchain/codegen/testdata/fail_target_triple.carbon index 883ab5b59aad..2b5e2a067371 100644 --- a/toolchain/codegen/testdata/fail_target_triple.carbon +++ b/toolchain/codegen/testdata/fail_target_triple.carbon @@ -2,9 +2,9 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --target=x86_687-unknown-linux-gnu --output=- %s +// ARGS: compile --no-prelude-import --target=x86_687-unknown-linux-gnu --output=- %s // No autoupdate because the message comes from LLVM. // NOAUTOUPDATE // CHECK:STDERR: ERROR: Invalid target: {{.*}}x86_687{{.*}} -fn Main() -> i32 { return 0; } +fn Main() {} diff --git a/toolchain/codegen/testdata/objcode/basic.carbon b/toolchain/codegen/testdata/objcode/basic.carbon index 96beac6de170..5c4e8dd8a77c 100644 --- a/toolchain/codegen/testdata/objcode/basic.carbon +++ b/toolchain/codegen/testdata/objcode/basic.carbon @@ -2,9 +2,9 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --target=x86_64-unknown-linux-gnu --output=%t %s +// ARGS: compile --no-prelude-import --target=x86_64-unknown-linux-gnu --output=%t %s // // TODO: Add a way to write some basic tests for object file outputs. // AUTOUPDATE -fn Main() -> i32 { return 0; } +fn Main() {} diff --git a/toolchain/driver/driver.cpp b/toolchain/driver/driver.cpp index e145ba4008f4..b27a6b7fb5cf 100644 --- a/toolchain/driver/driver.cpp +++ b/toolchain/driver/driver.cpp @@ -255,6 +255,26 @@ Dump the generated assembly to stdout after codegen. )""", }, [&](auto& arg_b) { arg_b.Set(&dump_asm); }); + b.AddFlag( + { + .name = "prelude-import", + .help = R"""( +Whether to use the implicit prelude import. Enabled by default. +)""", + }, + [&](auto& arg_b) { + arg_b.Default(true); + arg_b.Set(&prelude_import); + }); + b.AddStringOption( + { + .name = "exclude-dump-file-prefix", + .value_name = "PREFIX", + .help = R"""( +Excludes files with the given prefix from dumps. +)""", + }, + [&](auto& arg_b) { arg_b.Set(&exclude_dump_file_prefix); }); } Phase phase; @@ -277,6 +297,9 @@ Dump the generated assembly to stdout after codegen. bool stream_errors = false; bool preorder_parse_tree = false; bool builtin_sem_ir = false; + bool prelude_import = false; + + llvm::StringRef exclude_dump_file_prefix; }; struct Driver::Options { @@ -428,7 +451,7 @@ class Driver::CompilationUnit { LogCall("Lex::Lex", [&] { tokens_ = Lex::Lex(value_stores_, *source_, *consumer_); }); - if (options_.dump_tokens) { + if (options_.dump_tokens && IncludeInDumps()) { consumer_->Flush(); driver_->output_stream_ << tokens_; } @@ -445,7 +468,7 @@ class Driver::CompilationUnit { LogCall("Parse::Parse", [&] { parse_tree_ = Parse::Parse(*tokens_, *consumer_, vlog_stream_); }); - if (options_.dump_parse_tree) { + if (options_.dump_parse_tree && IncludeInDumps()) { consumer_->Flush(); parse_tree_->Print(driver_->output_stream_, options_.preorder_parse_tree); } @@ -475,7 +498,7 @@ class Driver::CompilationUnit { consumer_->Flush(); CARBON_VLOG() << "*** Raw SemIR::File ***\n" << *sem_ir_ << "\n"; - if (options_.dump_raw_sem_ir) { + if (options_.dump_raw_sem_ir && IncludeInDumps()) { sem_ir_->Print(driver_->output_stream_, options_.builtin_sem_ir); if (options_.dump_sem_ir) { driver_->output_stream_ << "\n"; @@ -486,7 +509,7 @@ class Driver::CompilationUnit { CARBON_VLOG() << "*** SemIR::File ***\n"; SemIR::FormatFile(*tokens_, *parse_tree_, *sem_ir_, *vlog_stream_); } - if (options_.dump_sem_ir) { + if (options_.dump_sem_ir && IncludeInDumps()) { SemIR::FormatFile(*tokens_, *parse_tree_, *sem_ir_, driver_->output_stream_); } @@ -510,7 +533,7 @@ class Driver::CompilationUnit { /*ShouldPreserveUseListOrder=*/false, /*IsForDebug=*/true); } - if (options_.dump_llvm_ir) { + if (options_.dump_llvm_ir && IncludeInDumps()) { module_->print(driver_->output_stream_, /*AAW=*/nullptr, /*ShouldPreserveUseListOrder=*/true); } @@ -611,6 +634,12 @@ class Driver::CompilationUnit { CARBON_VLOG() << "*** " << label << " done ***\n"; } + // Returns true if the file can be dumped. + auto IncludeInDumps() const -> bool { + return options_.exclude_dump_file_prefix.empty() || + !input_filename_.starts_with(options_.exclude_dump_file_prefix); + } + Driver* driver_; SharedValueStores value_stores_; const CompileOptions& options_; @@ -708,7 +737,7 @@ auto Driver::Compile(const CompileOptions& options) -> RunResult { } CARBON_VLOG() << "*** Check::CheckParseTrees ***\n"; Check::CheckParseTrees(builtins, llvm::MutableArrayRef(check_units), - vlog_stream_); + options.prelude_import, vlog_stream_); CARBON_VLOG() << "*** Check::CheckParseTrees done ***\n"; for (auto& unit : units) { if (unit->has_source()) { diff --git a/toolchain/driver/driver_test.cpp b/toolchain/driver/driver_test.cpp index 8791222a9abe..f1d89c36539f 100644 --- a/toolchain/driver/driver_test.cpp +++ b/toolchain/driver/driver_test.cpp @@ -118,18 +118,20 @@ TEST_F(DriverTest, CompileCommandErrors) { // Invalid output filename. No reliably error message here. // TODO: Likely want a different filename on Windows. auto empty_file = MakeTestFile(""); - EXPECT_FALSE( - driver_.RunCommand({"compile", "--output=/dev/empty", empty_file}) - .success); + EXPECT_FALSE(driver_ + .RunCommand({"compile", "--no-prelude-import", + "--output=/dev/empty", empty_file}) + .success); EXPECT_THAT(test_error_stream_.TakeStr(), ContainsRegex("ERROR: .*/dev/empty.*")); } TEST_F(DriverTest, DumpTokens) { auto file = MakeTestFile("Hello World"); - EXPECT_TRUE( - driver_.RunCommand({"compile", "--phase=lex", "--dump-tokens", file}) - .success); + EXPECT_TRUE(driver_ + .RunCommand({"compile", "--no-prelude-import", "--phase=lex", + "--dump-tokens", file}) + .success); EXPECT_THAT(test_error_stream_.TakeStr(), StrEq("")); // Verify there is output without examining it. EXPECT_THAT(Yaml::Value::FromText(test_output_stream_.TakeStr()), @@ -137,11 +139,11 @@ TEST_F(DriverTest, DumpTokens) { } TEST_F(DriverTest, DumpParseTree) { - auto file = MakeTestFile("var v: i32 = 42;"); - EXPECT_TRUE( - driver_ - .RunCommand({"compile", "--phase=parse", "--dump-parse-tree", file}) - .success); + auto file = MakeTestFile("var v: () = ();"); + EXPECT_TRUE(driver_ + .RunCommand({"compile", "--no-prelude-import", + "--phase=parse", "--dump-parse-tree", file}) + .success); EXPECT_THAT(test_error_stream_.TakeStr(), StrEq("")); // Verify there is output without examining it. EXPECT_THAT(Yaml::Value::FromText(test_output_stream_.TakeStr()), @@ -150,17 +152,19 @@ TEST_F(DriverTest, DumpParseTree) { TEST_F(DriverTest, StdoutOutput) { // Use explicit filenames so we can look for those to validate output. - MakeTestFile("fn Main() -> i32 { return 0; }", "test.carbon"); + MakeTestFile("fn Main() {}", "test.carbon"); - EXPECT_TRUE( - driver_.RunCommand({"compile", "--output=-", "test.carbon"}).success); + EXPECT_TRUE(driver_ + .RunCommand({"compile", "--no-prelude-import", "--output=-", + "test.carbon"}) + .success); EXPECT_THAT(test_error_stream_.TakeStr(), StrEq("")); // The default is textual assembly. EXPECT_THAT(test_output_stream_.TakeStr(), ContainsRegex("Main:")); EXPECT_TRUE(driver_ - .RunCommand({"compile", "--output=-", "--force-obj-output", - "test.carbon"}) + .RunCommand({"compile", "--no-prelude-import", "--output=-", + "--force-obj-output", "test.carbon"}) .success); EXPECT_THAT(test_error_stream_.TakeStr(), StrEq("")); std::string output = test_output_stream_.TakeStr(); @@ -177,11 +181,13 @@ TEST_F(DriverTest, FileOutput) { // Use explicit filenames as the default output filename is computed from // this, and we can use this to validate output. - MakeTestFile("fn Main() -> i32 { return 0; }", "test.carbon"); + MakeTestFile("fn Main() {}", "test.carbon"); // Object output (the default) uses `.o`. // TODO: This should actually reflect the platform defaults. - EXPECT_TRUE(driver_.RunCommand({"compile", "test.carbon"}).success); + EXPECT_TRUE( + driver_.RunCommand({"compile", "--no-prelude-import", "test.carbon"}) + .success); EXPECT_THAT(test_error_stream_.TakeStr(), StrEq("")); // Ensure we wrote an object file of some form with the correct name. auto result = llvm::object::createBinary("test.o"); @@ -192,8 +198,10 @@ TEST_F(DriverTest, FileOutput) { // Assembly output uses `.s`. // TODO: This should actually reflect the platform defaults. - EXPECT_TRUE( - driver_.RunCommand({"compile", "--asm-output", "test.carbon"}).success); + EXPECT_TRUE(driver_ + .RunCommand({"compile", "--no-prelude-import", "--asm-output", + "test.carbon"}) + .success); EXPECT_THAT(test_error_stream_.TakeStr(), StrEq("")); // TODO: This may need to be tailored to other assembly formats. EXPECT_THAT(ReadFile("test.s"), ContainsRegex("Main:")); diff --git a/toolchain/driver/testdata/fail_flush_errors.carbon b/toolchain/driver/testdata/fail_flush_errors.carbon index eadc9ee74532..02208a8a96cd 100644 --- a/toolchain/driver/testdata/fail_flush_errors.carbon +++ b/toolchain/driver/testdata/fail_flush_errors.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile %s +// ARGS: compile --no-prelude-import %s // // AUTOUPDATE @@ -26,7 +26,7 @@ fn F() { undeclared2; // Add the name into the string table via a declaration rather than an expression. - if (true) { var undeclared3: i32 = 0; } + if (true) { var undeclared3: () = (); } // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: ERROR: Name `undeclared3` not found. // CHECK:STDERR: undeclared3; // CHECK:STDERR: ^~~~~~~~~~~ diff --git a/toolchain/driver/testdata/fail_missing_stdin_output.carbon b/toolchain/driver/testdata/fail_missing_stdin_output.carbon index 5da754574647..4aba91f3e3e1 100644 --- a/toolchain/driver/testdata/fail_missing_stdin_output.carbon +++ b/toolchain/driver/testdata/fail_missing_stdin_output.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile - +// ARGS: compile --no-prelude-import - // // AUTOUPDATE // CHECK:STDERR: ERROR: Output file name must be specified for input '-' that is not a regular file. diff --git a/toolchain/driver/testdata/stdin.carbon b/toolchain/driver/testdata/stdin.carbon index ea9749385423..fb2ff26da605 100644 --- a/toolchain/driver/testdata/stdin.carbon +++ b/toolchain/driver/testdata/stdin.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile - --phase=check --dump-sem-ir +// ARGS: compile - --no-prelude-import --phase=check --dump-sem-ir // // AUTOUPDATE diff --git a/toolchain/sem_ir/yaml_test.cpp b/toolchain/sem_ir/yaml_test.cpp index f451f13398a1..bf2a02682573 100644 --- a/toolchain/sem_ir/yaml_test.cpp +++ b/toolchain/sem_ir/yaml_test.cpp @@ -21,6 +21,7 @@ using ::testing::AllOf; using ::testing::Contains; using ::testing::Each; using ::testing::ElementsAre; +using ::testing::Ge; using ::testing::IsEmpty; using ::testing::MatchesRegex; using ::testing::Pair; @@ -32,15 +33,17 @@ TEST(SemIRTest, YAML) { llvm::vfs::InMemoryFileSystem fs; CARBON_CHECK(fs.addFile( "test.carbon", /*ModificationTime=*/0, - llvm::MemoryBuffer::getMemBuffer("fn F() { var x: i32 = 0; return; }"))); + llvm::MemoryBuffer::getMemBuffer("fn F() { var x: () = (); return; }"))); TestRawOstream print_stream; Driver d(fs, print_stream, llvm::errs()); - d.RunCommand( - {"compile", "--phase=check", "--dump-raw-sem-ir", "test.carbon"}); + auto run_result = + d.RunCommand({"compile", "--no-prelude-import", "--phase=check", + "--dump-raw-sem-ir", "test.carbon"}); + EXPECT_TRUE(run_result.success); // Matches the ID of an instruction. Instruction counts may change as various // support changes, so this code is only doing loose structural checks. - auto int_id = Yaml::Scalar(MatchesRegex(R"(int\d+)")); + auto type_block_id = Yaml::Scalar(MatchesRegex(R"(typeBlock\d+)")); auto inst_id = Yaml::Scalar(MatchesRegex(R"(inst\+\d+)")); auto constant_id = Yaml::Scalar(MatchesRegex(R"((template|symbolic) inst(\w+|\+\d+))")); @@ -57,7 +60,7 @@ TEST(SemIRTest, YAML) { Pair("functions", Yaml::Mapping(SizeIs(1))), Pair("classes", Yaml::Mapping(SizeIs(0))), Pair("types", Yaml::Mapping(Each(type_builtin))), - Pair("type_blocks", Yaml::Mapping(IsEmpty())), + Pair("type_blocks", Yaml::Mapping(SizeIs(Ge(1)))), Pair("insts", Yaml::Mapping(AllOf( Each(Key(inst_id)), @@ -67,10 +70,10 @@ TEST(SemIRTest, YAML) { Contains( Pair(_, Yaml::Mapping(ElementsAre(Pair("kind", "Return"))))), // A 1-arg instruction. - Contains( - Pair(_, Yaml::Mapping(ElementsAre(Pair("kind", "IntLiteral"), - Pair("arg0", int_id), - Pair("type", type_id))))), + Contains(Pair(_, Yaml::Mapping(ElementsAre( + Pair("kind", "TupleType"), + Pair("arg0", type_block_id), + Pair("type", "typeTypeType"))))), // A 2-arg instruction. Contains(Pair( _, Yaml::Mapping(ElementsAre(Pair("kind", "Assign"), @@ -85,7 +88,8 @@ TEST(SemIRTest, YAML) { Pair("exports", Yaml::Mapping(Each(Pair(_, inst_id)))), Pair("global_init", Yaml::Mapping(IsEmpty())), Pair("block3", Yaml::Mapping(Each(Pair(_, inst_id)))), - Pair("block4", Yaml::Mapping(Each(Pair(_, inst_id))))))))); + Pair("block4", Yaml::Mapping(Each(Pair(_, inst_id)))), + Pair("block5", Yaml::Mapping(Each(Pair(_, inst_id))))))))); auto root = Yaml::Sequence(ElementsAre(Yaml::Mapping( ElementsAre(Pair("filename", "test.carbon"), Pair("sem_ir", file))))); diff --git a/toolchain/testing/BUILD b/toolchain/testing/BUILD index e9f9b4f40ff5..033cb2a4a234 100644 --- a/toolchain/testing/BUILD +++ b/toolchain/testing/BUILD @@ -11,6 +11,7 @@ file_test( name = "file_test", size = "small", srcs = ["file_test.cpp"], + data = ["//core"], tests = [ "//toolchain/check:testdata", "//toolchain/codegen:testdata", @@ -22,6 +23,7 @@ file_test( ], deps = [ "//common:all_llvm_targets", + "//common:error", "//testing/file_test:file_test_base", "//toolchain/driver", "@llvm-project//llvm:Support", diff --git a/toolchain/testing/file_test.cpp b/toolchain/testing/file_test.cpp index 84e15ecb4537..8cbd0510c6ba 100644 --- a/toolchain/testing/file_test.cpp +++ b/toolchain/testing/file_test.cpp @@ -7,6 +7,7 @@ #include +#include "common/error.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -28,6 +29,8 @@ class ToolchainFileTest : public FileTestBase { auto Run(const llvm::SmallVector& test_args, llvm::vfs::InMemoryFileSystem& fs, llvm::raw_pwrite_stream& stdout, llvm::raw_pwrite_stream& stderr) -> ErrorOr override { + CARBON_RETURN_IF_ERROR(AddFile(fs, "core/prelude.carbon")); + Driver driver(fs, stdout, stderr); auto driver_result = driver.RunCommand(test_args); @@ -39,26 +42,36 @@ class ToolchainFileTest : public FileTestBase { llvm::erase_if(result.per_file_success, [](std::pair entry) { return entry.first == "." || entry.first == "-" || - entry.first.starts_with("not_file"); + entry.first.starts_with("not_file") || + entry.first.starts_with("core/"); }); return result; } auto GetDefaultArgs() -> llvm::SmallVector override { - if (component_ == "check") { - return {"compile", "--phase=check", "--dump-sem-ir", "%s"}; - } else if (component_ == "lex") { - return {"compile", "--phase=lex", "--dump-tokens", "%s"}; - } else if (component_ == "lower") { - return {"compile", "--phase=lower", "--dump-llvm-ir", "%s"}; + llvm::SmallVector args = {"compile", + "--phase=" + component_.str()}; + + if (component_ == "lex") { + args.insert(args.end(), {"--dump-tokens", "%s"}); + return args; } else if (component_ == "parse") { - return {"compile", "--phase=parse", "--dump-parse-tree", "%s"}; - } else if (component_ == "codegen" || component_ == "driver") { - CARBON_FATAL() << "ARGS is always set in these tests"; + args.insert(args.end(), {"--dump-parse-tree", "%s"}); + return args; + } + + if (component_ == "check") { + args.push_back("--dump-sem-ir"); + } else if (component_ == "lower") { + args.push_back("--dump-llvm-ir"); } else { CARBON_FATAL() << "Unexpected test component " << component_ << ": " << test_name(); } + + args.insert(args.end(), {"--exclude-dump-file-prefix=core/", + "core/prelude.carbon", "%s"}); + return args; } auto GetDefaultFileRE(llvm::ArrayRef filenames) @@ -102,6 +115,20 @@ class ToolchainFileTest : public FileTestBase { } private: + // Adds a file to the fs. + auto AddFile(llvm::vfs::InMemoryFileSystem& fs, llvm::StringRef path) + -> ErrorOr { + llvm::ErrorOr> file = + llvm::MemoryBuffer::getFile(path); + if (file.getError()) { + return ErrorBuilder() << file.getError().message(); + } + if (!fs.addFile(path, /*ModificationTime=*/0, std::move(*file))) { + return ErrorBuilder() << "Duplicate file: " << path; + } + return Success(); + } + // Returns the toolchain subdirectory being tested. static auto GetComponent(llvm::StringRef test_name) -> llvm::StringRef { // This handles cases where the toolchain directory may be copied into a