Skip to content

Commit

Permalink
Use the package/library name in ImportIRId formatting. (#4154)
Browse files Browse the repository at this point in the history
Also adds import_ir_scope to namespace formatting. I'd done this as an
aid for #4153, and am splitting it out.

---------

Co-authored-by: Geoff Romer <gromer@google.com>
  • Loading branch information
2 people authored and brymer-meneses committed Aug 15, 2024
1 parent f83be0f commit 2ccab8d
Show file tree
Hide file tree
Showing 475 changed files with 8,796 additions and 3,278 deletions.
9 changes: 8 additions & 1 deletion toolchain/check/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,15 @@ static auto CheckParseTree(
llvm::MutableArrayRef<Parse::NodeLocConverter*> node_converters,
UnitInfo& unit_info, int total_ir_count, llvm::raw_ostream* vlog_stream)
-> void {
auto package_id = IdentifierId::Invalid;
auto library_id = StringLiteralValueId::Invalid;
if (const auto& packaging = unit_info.unit->parse_tree->packaging_decl()) {
package_id = packaging->names.package_id;
library_id = packaging->names.library_id;
}
unit_info.unit->sem_ir->emplace(
unit_info.check_ir_id, *unit_info.unit->value_stores,
unit_info.check_ir_id, package_id, library_id,
*unit_info.unit->value_stores,
unit_info.unit->tokens->source().filename().str());

SemIR::File& sem_ir = **unit_info.unit->sem_ir;
Expand Down
12 changes: 10 additions & 2 deletions toolchain/check/testdata/alias/fail_bool_value.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let a_test: bool = a;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool]
// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -34,7 +34,15 @@ let a_test: bool = a;
// CHECK:STDOUT: .a_test = @__global_init.%a_test
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/operators
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc14: bool = bool_literal false [template = constants.%.1]
// CHECK:STDOUT: %a: <error> = bind_alias a, <error> [template = <error>]
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
Expand Down
14 changes: 11 additions & 3 deletions toolchain/check/testdata/alias/fail_builtins.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ alias b = bool;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -41,7 +41,15 @@ alias b = bool;
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/operators
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
// CHECK:STDOUT: }
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %a: <error> = bind_alias a, <error> [template = <error>]
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
Expand Down
24 changes: 12 additions & 12 deletions toolchain/check/testdata/alias/no_prelude/export_name.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+5, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -125,9 +125,9 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+5, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+5, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -155,8 +155,8 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+7, unloaded
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+7, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -191,7 +191,7 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref = import_ref ir1, inst+8, unloaded
// CHECK:STDOUT: %import_ref = import_ref Main//export, inst+8, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -224,9 +224,9 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, inst+8, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_orig, inst+7, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
22 changes: 11 additions & 11 deletions toolchain/check/testdata/alias/no_prelude/import.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.1 = import_ref Main//class1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//class1, inst+5, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref Main//class1, inst+10, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref Main//class1, inst+2, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -142,9 +142,9 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+10, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+15, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+8, unloaded
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, inst+10, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, inst+15, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref Main//class2, inst+8, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -202,8 +202,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+5, unloaded
// CHECK:STDOUT: %import_ref.2: ref %.1 = import_ref ir1, inst+12, loaded
// CHECK:STDOUT: %import_ref.1 = import_ref Main//var1, inst+5, unloaded
// CHECK:STDOUT: %import_ref.2: ref %.1 = import_ref Main//var1, inst+12, loaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -239,8 +239,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: ref %.1 = import_ref ir1, inst+6, loaded [template = <error>]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+10, unloaded
// CHECK:STDOUT: %import_ref.1: ref %.1 = import_ref Main//var2, inst+6, loaded [template = <error>]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//var2, inst+10, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
12 changes: 7 additions & 5 deletions toolchain/check/testdata/alias/no_prelude/import_access.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ var inst: Test.A = {};
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref ir0, inst+5, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref ir0, inst+2, unloaded
// CHECK:STDOUT: %import_ref.1 = import_ref Test//def, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Test//def, inst+5, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref Test//def, inst+2, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -124,7 +124,7 @@ var inst: Test.A = {};
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref = import_ref Test//def, inst+1, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -157,7 +157,9 @@ var inst: Test.A = {};
// CHECK:STDOUT: .inst = %inst
// CHECK:STDOUT: }
// CHECK:STDOUT: %Test.import = import Test
// CHECK:STDOUT: %Test: <namespace> = namespace %Test.import, [template] {}
// CHECK:STDOUT: %Test: <namespace> = namespace %Test.import, [template] {
// CHECK:STDOUT: import Test//def
// CHECK:STDOUT: }
// CHECK:STDOUT: %Test.ref: <namespace> = name_ref Test, %Test [template = %Test]
// CHECK:STDOUT: %A.ref: <error> = name_ref A, <error> [template = <error>]
// CHECK:STDOUT: %inst.var: ref <error> = var inst
Expand Down
14 changes: 7 additions & 7 deletions toolchain/check/testdata/alias/no_prelude/import_order.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ var a_val: a = {.v = b_val.v};
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+12, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+14, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+16, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir1, inst+18, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.7: %.4 = import_ref ir1, inst+7, loaded [template = %.1]
// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+12, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+14, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+16, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.5: type = import_ref Main//a, inst+18, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+2, unloaded
// CHECK:STDOUT: %import_ref.7: %.4 = import_ref Main//a, inst+7, loaded [template = %.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
22 changes: 15 additions & 7 deletions toolchain/check/testdata/array/array_in_place.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ fn G() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -51,7 +51,15 @@ fn G() {
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/operators
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32]
Expand Down
18 changes: 13 additions & 5 deletions toolchain/check/testdata/array/array_vs_tuple.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ fn G() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -48,7 +48,15 @@ fn G() {
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/operators
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
14 changes: 11 additions & 3 deletions toolchain/check/testdata/array/assign_return_value.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ fn Run() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -45,7 +45,15 @@ fn Run() {
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/operators
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32)
Expand Down
18 changes: 13 additions & 5 deletions toolchain/check/testdata/array/assign_var.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -43,7 +43,15 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/operators
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
// CHECK:STDOUT: }
// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32]
Expand Down
Loading

0 comments on commit 2ccab8d

Please sign in to comment.