diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index a758db7a9386..951c2e6cab9f 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -911,11 +911,7 @@ static auto CheckParseTree( return; } - // Pop information for the file-level scope. - sem_ir.set_top_inst_block_id(context.inst_block_stack().Pop()); - context.scope_stack().Pop(); - context.FinalizeExports(); - context.global_init().Finalize(); + context.Finalize(); DiagnoseMissingDefinitions(context, emitter); diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 95b6c481c253..dd1eb8870ca4 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -633,6 +633,19 @@ auto Context::is_current_position_reachable() -> bool { SemIR::TerminatorKind::Terminator; } +auto Context::Finalize() -> void { + // Pop information for the file-level scope. + sem_ir().set_top_inst_block_id(inst_block_stack().Pop()); + scope_stack().Pop(); + + // Finalizes the list of exports on the IR. + inst_blocks().Set(SemIR::InstBlockId::Exports, exports_); + // Finalizes the ImportRef inst block. + inst_blocks().Set(SemIR::InstBlockId::ImportRefs, import_ref_ids_); + // Finalizes __global_init. + global_init_.Finalize(); +} + namespace { // Worklist-based type completion mechanism. // diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 7e307a430e53..b15ff3ac0df3 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -292,10 +292,7 @@ class Context { // Adds an exported name. auto AddExport(SemIR::InstId inst_id) -> void { exports_.push_back(inst_id); } - // Finalizes the list of exports on the IR. - auto FinalizeExports() -> void { - inst_blocks().Set(SemIR::InstBlockId::Exports, exports_); - } + auto Finalize() -> void; // Sets the total number of IRs which exist. This is used to prepare a map // from IR to imported IR. @@ -427,6 +424,10 @@ class Context { auto global_init() -> GlobalInit& { return global_init_; } + auto import_ref_ids() -> llvm::SmallVector& { + return import_ref_ids_; + } + private: // A FoldingSet node for a type. class TypeNode : public llvm::FastFoldingSetNode { @@ -516,6 +517,15 @@ class Context { // State for global initialization. GlobalInit global_init_; + + // A list of import refs which can't be inserted into their current context. + // They're typically added during name lookup or import ref resolution, where + // the current block on inst_block_stack_ is unrelated. + // + // These are instead added here because they're referenced by other + // instructions and needs to be visible in textual IR. + // FinalizeImportRefBlock() will produce an inst block for them. + llvm::SmallVector import_ref_ids_; }; } // namespace Carbon::Check diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 49a36be8e001..8430b2ba2a70 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -61,15 +61,10 @@ auto AddImportRef(Context& context, SemIR::ImportIRInst import_ir_inst, auto import_ref_id = context.AddPlaceholderInstInNoBlock( SemIR::LocIdAndInst(import_ir_inst_id, inst)); - // We can't insert this instruction into whatever block we happen to be in, - // because this function is typically called by name lookup in the middle of - // an otherwise unknown checking step. But we need to add the instruction - // somewhere, because it's referenced by other instructions and needs to be - // visible in textual IR. Adding it to the file block is arbitrary but is the - // best place we have right now. - // - // TODO: Consider adding a dedicated block for import_refs. - context.inst_block_stack().AddInstIdToFileBlock(import_ref_id); + // ImportRefs have a dedicated block because this may be called during + // processing where the instruction shouldn't be inserted in the current inst + // block. + context.import_ref_ids().push_back(import_ref_id); return import_ref_id; } diff --git a/toolchain/check/inst_block_stack.h b/toolchain/check/inst_block_stack.h index d8d08c440120..a440066ec7d4 100644 --- a/toolchain/check/inst_block_stack.h +++ b/toolchain/check/inst_block_stack.h @@ -56,14 +56,6 @@ class InstBlockStack { stack_[size_ - 1].content.push_back(inst_id); } - // Adds the given instruction ID to the block at the bottom of the stack. - // - // TODO: We shouldn't need to do this. - auto AddInstIdToFileBlock(SemIR::InstId inst_id) -> void { - CARBON_CHECK(!empty()) << "no current block"; - stack_[0].content.push_back(inst_id); - } - // Returns whether the current block is statically reachable. auto is_current_block_reachable() -> bool { return size_ != 0 && diff --git a/toolchain/check/testdata/alias/fail_bool_value.carbon b/toolchain/check/testdata/alias/fail_bool_value.carbon index 2f650fbb0811..439fad059bd5 100644 --- a/toolchain/check/testdata/alias/fail_bool_value.carbon +++ b/toolchain/check/testdata/alias/fail_bool_value.carbon @@ -23,6 +23,10 @@ let a_test: bool = a; // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,7 +37,6 @@ let a_test: bool = a; // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc14: bool = bool_literal false [template = constants.%.1] // CHECK:STDOUT: %a: = bind_alias a, [template = ] -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc15_13.2: type = converted %bool.make_type, %.loc15_13.1 [template = bool] diff --git a/toolchain/check/testdata/alias/fail_builtins.carbon b/toolchain/check/testdata/alias/fail_builtins.carbon index ac0b09045514..ff34fe2978b4 100644 --- a/toolchain/check/testdata/alias/fail_builtins.carbon +++ b/toolchain/check/testdata/alias/fail_builtins.carbon @@ -29,6 +29,11 @@ alias b = bool; // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,10 +42,8 @@ alias b = bool; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %a: = bind_alias a, [template = ] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %b: = bind_alias b, [template = ] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/alias/fail_control_flow.carbon b/toolchain/check/testdata/alias/fail_control_flow.carbon index 290047f7e8e7..496d0986f4fb 100644 --- a/toolchain/check/testdata/alias/fail_control_flow.carbon +++ b/toolchain/check/testdata/alias/fail_control_flow.carbon @@ -29,7 +29,7 @@ alias a = true or false; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: %.loc22: bool = block_arg [template = constants.%.1] +// CHECK:STDOUT: %.loc22: bool = block_arg [template = constants.%.1] // CHECK:STDOUT: %a: = bind_alias a, [template = ] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index 90014321d257..d81e4b5ac03b 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -97,21 +97,24 @@ var d: D* = &c; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .D = %D -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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: %D: type = export D, %import_ref.2 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .D = %D +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %D: type = export D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_orig.carbon @@ -121,21 +124,24 @@ var d: D* = &c; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .D = %import_ref.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C +// CHECK:STDOUT: .D = imports.%import_ref.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_export.carbon @@ -148,22 +154,25 @@ var d: D* = &c; // CHECK:STDOUT: %struct: %C = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .D = %import_ref.1 +// CHECK:STDOUT: .D = imports.%import_ref.1 // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// 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: %D.ref: type = name_ref D, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %d.var: ref %C = var d // CHECK:STDOUT: %d: ref %C = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -181,13 +190,16 @@ var d: D* = &c; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+8, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .D = %import_ref +// CHECK:STDOUT: .D = imports.%import_ref // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+8, unloaded // CHECK:STDOUT: %C.ref: = name_ref C, [template = ] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var @@ -211,21 +223,24 @@ var d: D* = &c; // CHECK:STDOUT: %.4: type = ptr_type %C [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .D = %import_ref.1 -// CHECK:STDOUT: .C = %import_ref.2 +// CHECK:STDOUT: .D = imports.%import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.2 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// 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: %C.ref: type = name_ref C, %import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %D.ref: type = name_ref D, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] // CHECK:STDOUT: %d.var: ref %.4 = var d // CHECK:STDOUT: %d: ref %.4 = bind_name d, %d.var @@ -233,7 +248,7 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index 06fb7621261a..21b116cd83d8 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -104,22 +104,25 @@ var c: () = a_alias_alias; // CHECK:STDOUT: %.2: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c_alias = %import_ref.2 -// CHECK:STDOUT: .a = %import_ref.3 -// CHECK:STDOUT: .c_alias_alias = %c_alias_alias -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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: %c_alias.ref.loc6: type = name_ref c_alias, %import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %c_alias_alias: type = bind_alias c_alias_alias, %import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %c_alias.ref.loc8: type = name_ref c_alias, %import_ref.2 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c_alias = imports.%import_ref.2 +// CHECK:STDOUT: .a = imports.%import_ref.3 +// CHECK:STDOUT: .c_alias_alias = %c_alias_alias +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %c_alias.ref.loc6: type = name_ref c_alias, imports.%import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %c_alias_alias: type = bind_alias c_alias_alias, imports.%import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %c_alias.ref.loc8: type = name_ref c_alias, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.2] // CHECK:STDOUT: %b.var: ref %.2 = var b // CHECK:STDOUT: %b: ref %.2 = bind_name b, %b.var @@ -127,7 +130,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- class3.carbon @@ -138,17 +141,20 @@ var c: () = a_alias_alias; // CHECK:STDOUT: %.2: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .c_alias_alias = %import_ref.1 -// CHECK:STDOUT: .b = %import_ref.2 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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: %c_alias_alias.ref: type = name_ref c_alias_alias, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .c_alias_alias = imports.%import_ref.1 +// CHECK:STDOUT: .b = imports.%import_ref.2 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %c_alias_alias.ref: type = name_ref c_alias_alias, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %.loc6: type = ptr_type %C [template = constants.%.2] // CHECK:STDOUT: %c.var: ref %.2 = var c // CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var @@ -156,7 +162,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- var1.carbon @@ -195,18 +201,21 @@ var c: () = a_alias_alias; // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a = %import_ref.1 -// CHECK:STDOUT: .a_alias = %import_ref.2 +// CHECK:STDOUT: .a = imports.%import_ref.1 +// CHECK:STDOUT: .a_alias = imports.%import_ref.2 // CHECK:STDOUT: .a_alias_alias = %a_alias_alias // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// 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: %a_alias.ref: ref %.1 = name_ref a_alias, %import_ref.2 -// CHECK:STDOUT: %a_alias_alias: ref %.1 = bind_alias a_alias_alias, %import_ref.2 +// CHECK:STDOUT: %a_alias.ref: ref %.1 = name_ref a_alias, imports.%import_ref.2 +// CHECK:STDOUT: %a_alias_alias: ref %.1 = bind_alias a_alias_alias, imports.%import_ref.2 // CHECK:STDOUT: %.loc8_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc8_9.2: type = converted %.loc8_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %b.var: ref %.1 = var b @@ -215,7 +224,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_alias.ref: ref %.1 = name_ref a_alias, file.%import_ref.2 +// CHECK:STDOUT: %a_alias.ref: ref %.1 = name_ref a_alias, imports.%import_ref.2 // CHECK:STDOUT: %.loc8_13: init %.1 = tuple_init () to file.%b.var [template = constants.%tuple] // CHECK:STDOUT: %.loc8_20: init %.1 = converted %a_alias.ref, %.loc8_13 [template = constants.%tuple] // CHECK:STDOUT: assign file.%b.var, %.loc8_20 @@ -229,15 +238,18 @@ var c: () = a_alias_alias; // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: ref %.1 = import_ref ir1, inst+6, loaded [template = ] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+10, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_alias_alias = %import_ref.1 -// CHECK:STDOUT: .b = %import_ref.2 +// CHECK:STDOUT: .a_alias_alias = imports.%import_ref.1 +// CHECK:STDOUT: .b = imports.%import_ref.2 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: ref %.1 = import_ref ir1, inst+6, loaded [template = ] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+10, unloaded // CHECK:STDOUT: %.loc12_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %c.var: ref %.1 = var c @@ -246,7 +258,7 @@ var c: () = a_alias_alias; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_alias_alias.ref: ref %.1 = name_ref a_alias_alias, file.%import_ref.1 [template = ] +// CHECK:STDOUT: %a_alias_alias.ref: ref %.1 = name_ref a_alias_alias, imports.%import_ref.1 [template = ] // CHECK:STDOUT: %.loc12_13: init %.1 = tuple_init () to file.%c.var [template = constants.%tuple] // CHECK:STDOUT: %.loc12_26: init %.1 = converted %a_alias_alias.ref, %.loc12_13 [template = constants.%tuple] // CHECK:STDOUT: assign file.%c.var, %.loc12_26 diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index 47b3219c0138..448bb3b120a3 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -84,25 +84,28 @@ var inst: Test.A = {}; // CHECK:STDOUT: %struct: %C = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .A [private] = %import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .A [private] = imports.%import_ref.2 // CHECK:STDOUT: .inst = %inst // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// 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: %A.ref: type = name_ref A, %import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %inst.var: ref %C = var inst // CHECK:STDOUT: %inst: ref %C = bind_name inst, %inst.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -120,13 +123,16 @@ var inst: Test.A = {}; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: .inst = %inst // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: %A.ref: = name_ref A, [template = ] // CHECK:STDOUT: %inst.var: ref = var inst // CHECK:STDOUT: %inst: ref = bind_name inst, %inst.var diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/no_prelude/import_order.carbon index 1b92d4496b9e..3da804665c5c 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_order.carbon @@ -80,44 +80,47 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.4: type = unbound_element_type %C, %.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// 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: .d_val = %d_val -// CHECK:STDOUT: .c_val = %c_val -// CHECK:STDOUT: .b_val = %b_val -// CHECK:STDOUT: .a_val = %a_val -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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 = imports.%.1] -// CHECK:STDOUT: %d.ref: type = name_ref d, %import_ref.5 [template = constants.%C] +// CHECK:STDOUT: %import_ref.7: %.4 = import_ref ir1, inst+7, loaded [template = %.1] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .a = imports.%import_ref.2 +// CHECK:STDOUT: .b = imports.%import_ref.3 +// CHECK:STDOUT: .c = imports.%import_ref.4 +// CHECK:STDOUT: .d = imports.%import_ref.5 +// 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: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %d.ref: type = name_ref d, imports.%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.ref: type = name_ref c, imports.%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.ref: type = name_ref b, imports.%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.ref: type = name_ref a, imports.%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: .Self = file.%import_ref.6 -// CHECK:STDOUT: .v = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .v = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -131,7 +134,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc7_25: init %C = converted %.loc7_24.1, %.loc7_24.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%d_val.var, %.loc7_25 // CHECK:STDOUT: %d_val.ref: ref %C = name_ref d_val, file.%d_val -// CHECK:STDOUT: %v.ref.loc8: %.4 = name_ref v, file.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc8: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc8_27.1: ref %.1 = class_element_access %d_val.ref, element0 // CHECK:STDOUT: %.loc8_29.1: %.2 = struct_literal (%.loc8_27.1) // CHECK:STDOUT: %.loc8_29.2: ref %.1 = class_element_access file.%c_val.var, element0 @@ -141,7 +144,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc8_30: init %C = converted %.loc8_29.1, %.loc8_29.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%c_val.var, %.loc8_30 // CHECK:STDOUT: %c_val.ref: ref %C = name_ref c_val, file.%c_val -// CHECK:STDOUT: %v.ref.loc9: %.4 = name_ref v, file.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc9: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc9_27.1: ref %.1 = class_element_access %c_val.ref, element0 // CHECK:STDOUT: %.loc9_29.1: %.2 = struct_literal (%.loc9_27.1) // CHECK:STDOUT: %.loc9_29.2: ref %.1 = class_element_access file.%b_val.var, element0 @@ -151,7 +154,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc9_30: init %C = converted %.loc9_29.1, %.loc9_29.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%b_val.var, %.loc9_30 // CHECK:STDOUT: %b_val.ref: ref %C = name_ref b_val, file.%b_val -// CHECK:STDOUT: %v.ref.loc10: %.4 = name_ref v, file.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc10: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc10_27.1: ref %.1 = class_element_access %b_val.ref, element0 // CHECK:STDOUT: %.loc10_29.1: %.2 = struct_literal (%.loc10_27.1) // CHECK:STDOUT: %.loc10_29.2: ref %.1 = class_element_access file.%a_val.var, element0 diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index beb8a1833d61..7e55375aac68 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -35,6 +35,15 @@ fn G() { // CHECK:STDOUT: %.10: i32 = int_literal 1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,9 +52,6 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %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] @@ -61,9 +67,6 @@ fn G() { // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index fb4fa15d4c3b..77a3ad9a1eb2 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -35,6 +35,13 @@ fn G() { // CHECK:STDOUT: %tuple: %.7 = tuple_value (%.5, %.6, %.2) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,10 +50,6 @@ fn G() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 48694fd263ba..9a356bc032ad 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -33,6 +33,11 @@ fn Run() { // CHECK:STDOUT: %.7: type = ptr_type %.6 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,7 +46,6 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // 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) @@ -51,7 +55,6 @@ fn Run() { // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index e30f94e898d9..59ab13c390e5 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -29,6 +29,13 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %.10: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,11 +44,8 @@ var b: [i32; 3] = a; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_22.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14, %int.make_type_32.loc11_19) // CHECK:STDOUT: %.loc11_22.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -53,7 +57,6 @@ var b: [i32; 3] = a; // CHECK:STDOUT: %.loc11_22.8: type = converted %.loc11_22.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_14: i32 = int_literal 3 [template = constants.%.7] // CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 14c41beac407..c1be1e189ffd 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -44,6 +44,11 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %array.3: %.15 = tuple_value (%tuple, %tuple, %tuple, %tuple, %tuple) [template] // 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: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -53,7 +58,6 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -62,7 +66,6 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var // CHECK:STDOUT: %.loc12_9.1: i32 = int_literal 64 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_9.1) [template = f64] // CHECK:STDOUT: %.loc12_14: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %float.make_type [template = f64] diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 1c4f7d447ed9..458de1e6e03f 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -31,6 +31,14 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: %array: %.5 = tuple_value (%.2, %.3, %.4) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,9 +48,6 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] @@ -59,7 +64,6 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32] // CHECK:STDOUT: @Add.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %.loc13_18: i32 = int_literal 1 [template = constants.%.2] @@ -70,7 +74,6 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: %.loc13_23: type = array_type %int.sadd, i32 [template = constants.%.5] // CHECK:STDOUT: %a.var: ref %.5 = var a // CHECK:STDOUT: %a.loc13: ref %.5 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_14: i32 = int_literal 3 [template = constants.%.4] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 725c8af9abbd..8723e4649bbc 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -27,6 +27,12 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %.3: i32 = int_literal -1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,8 +41,6 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] @@ -48,7 +52,6 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11_22, %.loc11_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc16_21: i32 = int_literal 1 [template = constants.%.2] diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index 9d072003235b..1f63502f37a0 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -35,6 +35,10 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,7 +47,6 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32, %.loc18_9.1 [template = i32] diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 474f7237015f..d2da77bfe609 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -27,6 +27,10 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,7 +38,6 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32 [template = i32] 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 10152ccf5c39..39ef9c5cd5ad 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 @@ -32,6 +32,11 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %struct: %.9 = struct_value (%.2) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,7 +45,6 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -48,7 +52,6 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index e25fc0de9f0e..3ef3679706d7 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -57,6 +57,16 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.17: type = ptr_type %.15 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,7 +79,6 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] @@ -77,7 +86,6 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.loc15_15: type = array_type %.loc15_14, i32 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_29.1: %.11 = tuple_literal (%int.make_type_32.loc17, String, String) // CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %int.make_type_32.loc17 [template = i32] @@ -85,7 +93,6 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.loc17_29.4: type = converted %.loc17_29.1, constants.%.9 [template = constants.%.9] // CHECK:STDOUT: %t1.var: ref %.9 = var t1 // CHECK:STDOUT: %t1: ref %.9 = bind_name t1, %t1.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc22_9.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] @@ -93,7 +100,6 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.loc22_15: type = array_type %.loc22_14, i32 [template = constants.%.3] // CHECK:STDOUT: %b.var: ref %.3 = var b // CHECK:STDOUT: %b: ref %.3 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc28_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc28_9.1: type = value_of_initializer %int.make_type_32.loc28 [template = i32] @@ -101,9 +107,7 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.loc28_15: type = array_type %.loc28_14, i32 [template = constants.%.3] // CHECK:STDOUT: %c.var: ref %.3 = var c // CHECK:STDOUT: %c: ref %.3 = bind_name c, %c.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc30_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc30_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc30_18.1: %.16 = tuple_literal (%int.make_type_32.loc30_10, %int.make_type_32.loc30_15) // CHECK:STDOUT: %.loc30_18.2: type = value_of_initializer %int.make_type_32.loc30_10 [template = i32] @@ -113,7 +117,6 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: %.loc30_18.6: type = converted %.loc30_18.1, constants.%.15 [template = constants.%.15] // CHECK:STDOUT: %t2.var: ref %.15 = var t2 // CHECK:STDOUT: %t2: ref %.15 = bind_name t2, %t2.var -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc34_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc34_9.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 45f6a436159a..4a09481db68a 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -36,6 +36,13 @@ fn G() -> i32 { // CHECK:STDOUT: %array: %.3 = tuple_value (%.5, %.6, %.2) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -44,9 +51,6 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %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: %.loc11_17: i32 = int_literal 3 [template = constants.%.2] @@ -65,7 +69,6 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_32.loc11_32, %.loc11_32.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 431536ee3c6e..81495763f00d 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -29,6 +29,11 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %struct: %.9 = struct_value (%.6) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,7 +42,6 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -45,7 +49,6 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index ea482248ee16..05a5d03a2b88 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -32,6 +32,10 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: %array: %.3 = tuple_value (%.5, %.6, %.7, %.8, %.9, %.10, %.11, %.12, %.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,7 +43,6 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 9 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 37cad15a92cc..0c98999569ab 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -121,6 +121,11 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.7: type = ptr_type %B [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -135,8 +140,6 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// 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: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %A.ref.loc17: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a_ref.var: ref %A = var a_ref @@ -242,6 +245,13 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -252,14 +262,10 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] -// 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: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { @@ -384,6 +390,11 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %struct: %A = struct_value (%.5, %.6) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -395,8 +406,6 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// 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: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %B.ref.loc13: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %B.ref.loc24: type = name_ref B, %B.decl [template = constants.%B] @@ -483,6 +492,10 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %.5: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -493,7 +506,6 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] // CHECK:STDOUT: %b.var: ref %B = var b diff --git a/toolchain/check/testdata/as/as_type.carbon b/toolchain/check/testdata/as/as_type.carbon index 49f46559ee03..08d292f3caf9 100644 --- a/toolchain/check/testdata/as/as_type.carbon +++ b/toolchain/check/testdata/as/as_type.carbon @@ -20,6 +20,11 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: %.3: type = tuple_type (i32, i32) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -27,8 +32,6 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index 43f8165ddb9e..e325391fc09c 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -23,6 +23,11 @@ fn Main() -> i32 { // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,14 +35,12 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] // CHECK:STDOUT: @Main.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 56aa7338af66..ede3a142c070 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -25,6 +25,13 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %.5: i32 = int_literal 1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -32,9 +39,7 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: %.2 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) // CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] @@ -42,8 +47,6 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: %.loc14_17.4: type = value_of_initializer %int.make_type_32.loc14_14 [template = i32] // CHECK:STDOUT: %.loc14_17.5: type = converted %int.make_type_32.loc14_14, %.loc14_17.4 [template = i32] // CHECK:STDOUT: %.loc14_17.6: type = converted %.loc14_17.1, constants.%.3 [template = constants.%.3] -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 3346a9c8fd2e..e9e53aff1dbe 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -23,6 +23,10 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,7 +34,6 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_32, %.loc14_8.1 [template = i32] diff --git a/toolchain/check/testdata/basics/builtin_insts.carbon b/toolchain/check/testdata/basics/builtin_insts.carbon index a1d66d1eb1e8..91417e0422a6 100644 --- a/toolchain/check/testdata/basics/builtin_insts.carbon +++ b/toolchain/check/testdata/basics/builtin_insts.carbon @@ -51,7 +51,8 @@ // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: {} +// CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block3: +// CHECK:STDOUT: block4: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index 6037d77d4ffc..c399cfef7946 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -28,6 +28,12 @@ var test_type: type = i32; // CHECK:STDOUT: %.6: String = string_literal "Test" [template] // 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: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,14 +44,12 @@ var test_type: type = i32; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_15.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_15.2: type = converted %int.make_type_32, %.loc11_15.1 [template = i32] // 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: %.loc12_15.1: i32 = int_literal 64 [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_15.1) [template = f64] // CHECK:STDOUT: %.loc12_15.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc12_15.3: type = converted %float.make_type, %.loc12_15.2 [template = f64] @@ -53,7 +57,6 @@ var test_type: type = i32; // CHECK:STDOUT: %test_f64: ref f64 = bind_name test_f64, %test_f64.var // CHECK:STDOUT: %test_type.var: ref type = var test_type // CHECK:STDOUT: %test_type: ref type = bind_name test_type, %test_type.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index 12b7616c98f0..21509f5d35c3 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -23,6 +23,10 @@ fn Run(n: i32) {} // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,7 +34,6 @@ fn Run(n: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index dd34dd7c2125..db8d70d37d91 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -48,6 +48,14 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // 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: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -59,25 +67,20 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_8.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_8.2: type = converted %int.make_type_32.loc21, %.loc21_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc27_8.1: type = value_of_initializer %int.make_type_32.loc27 [template = i32] // CHECK:STDOUT: %.loc27_8.2: type = converted %int.make_type_32.loc27, %.loc27_8.1 [template = i32] // CHECK:STDOUT: %.loc33_8.1: i32 = int_literal 64 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc33: init type = call constants.%Float(%.loc33_8.1) [template = f64] // CHECK:STDOUT: %.loc33_8.2: type = value_of_initializer %float.make_type.loc33 [template = f64] // CHECK:STDOUT: %.loc33_8.3: type = converted %float.make_type.loc33, %.loc33_8.2 [template = f64] // CHECK:STDOUT: %.loc38_8.1: i32 = int_literal 64 [template = constants.%.2] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc38: init type = call constants.%Float(%.loc38_8.1) [template = f64] // CHECK:STDOUT: %.loc38_8.2: type = value_of_initializer %float.make_type.loc38 [template = f64] // CHECK:STDOUT: %.loc38_8.3: type = converted %float.make_type.loc38, %.loc38_8.2 [template = f64] diff --git a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon index 202aa0583cc7..b1852c98ede6 100644 --- a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon +++ b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon @@ -22,6 +22,11 @@ var y: i32 = x.b; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,13 +35,11 @@ var y: i32 = x.b; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon index 77699b19c0df..84cb5d5d5a78 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon @@ -36,7 +36,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+1}} // CHECK:STDOUT: bind_names: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: empty, body: [block3]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: empty, body: [block4]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: generic_instances: {} @@ -63,10 +63,11 @@ fn B() { // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: // CHECK:STDOUT: 0: inst+1 +// CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block3: -// CHECK:STDOUT: 0: inst+5 // CHECK:STDOUT: block4: +// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: block5: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 // CHECK:STDOUT: ... @@ -106,7 +107,7 @@ fn B() { // CHECK:STDOUT: bind_names: // CHECK:STDOUT: bind_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: empty, body: [block3]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: empty, body: [block4]} // CHECK:STDOUT: function1: {name: name1, parent_scope: name_scope1, param_refs: empty} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} @@ -132,7 +133,7 @@ fn B() { // CHECK:STDOUT: 'inst+10': {kind: FunctionType, arg0: function1, type: typeTypeType} // CHECK:STDOUT: 'inst+11': {kind: StructValue, arg0: empty, type: type3} // CHECK:STDOUT: 'inst+12': {kind: NameRef, arg0: name1, arg1: inst+8, type: type3} -// CHECK:STDOUT: 'inst+13': {kind: Call, arg0: inst+12, arg1: block4, type: type2} +// CHECK:STDOUT: 'inst+13': {kind: Call, arg0: inst+12, arg1: block5, type: type2} // CHECK:STDOUT: 'inst+14': {kind: Return} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: 'inst+0': template inst+0 @@ -151,19 +152,20 @@ fn B() { // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: // CHECK:STDOUT: 0: inst+3 +// CHECK:STDOUT: import_refs: +// CHECK:STDOUT: 0: inst+8 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block3: +// CHECK:STDOUT: block4: // CHECK:STDOUT: 0: inst+7 // CHECK:STDOUT: 1: inst+12 // CHECK:STDOUT: 2: inst+13 // CHECK:STDOUT: 3: inst+14 -// CHECK:STDOUT: block4: {} -// CHECK:STDOUT: block5: +// CHECK:STDOUT: block5: {} +// CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 // CHECK:STDOUT: 2: inst+2 // CHECK:STDOUT: 3: inst+3 -// CHECK:STDOUT: 4: inst+8 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon @@ -176,6 +178,10 @@ fn B() { // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir1, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A @@ -184,13 +190,12 @@ fn B() { // CHECK:STDOUT: %A.import = import A // CHECK:STDOUT: %A: = namespace %A.import, [template] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir1, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %A.ref.loc6_3: = name_ref A, file.%A [template = file.%A] -// CHECK:STDOUT: %A.ref.loc6_4: %A.type = name_ref A, file.%import_ref [template = constants.%A] +// CHECK:STDOUT: %A.ref.loc6_4: %A.type = name_ref A, imports.%import_ref [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref.loc6_4() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon index fe8ed29d5195..68453f0e290d 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon @@ -36,7 +36,7 @@ fn B() { // CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name0: inst+1}} // CHECK:STDOUT: bind_names: {} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: empty, body: [block3]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: empty, body: [block4]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: generic_instances: {} @@ -63,10 +63,11 @@ fn B() { // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: // CHECK:STDOUT: 0: inst+1 +// CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block3: -// CHECK:STDOUT: 0: inst+5 // CHECK:STDOUT: block4: +// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: block5: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 // CHECK:STDOUT: ... @@ -85,7 +86,7 @@ fn B() { // CHECK:STDOUT: bind_names: // CHECK:STDOUT: bind_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: empty, body: [block3]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: empty, body: [block4]} // CHECK:STDOUT: function1: {name: name1, parent_scope: name_scope1, param_refs: empty} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} @@ -111,7 +112,7 @@ fn B() { // CHECK:STDOUT: 'inst+10': {kind: FunctionType, arg0: function1, type: typeTypeType} // CHECK:STDOUT: 'inst+11': {kind: StructValue, arg0: empty, type: type3} // CHECK:STDOUT: 'inst+12': {kind: NameRef, arg0: name1, arg1: inst+8, type: type3} -// CHECK:STDOUT: 'inst+13': {kind: Call, arg0: inst+12, arg1: block4, type: type2} +// CHECK:STDOUT: 'inst+13': {kind: Call, arg0: inst+12, arg1: block5, type: type2} // CHECK:STDOUT: 'inst+14': {kind: Return} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: 'inst+0': template inst+0 @@ -130,17 +131,18 @@ fn B() { // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: // CHECK:STDOUT: 0: inst+3 +// CHECK:STDOUT: import_refs: +// CHECK:STDOUT: 0: inst+8 // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block3: +// CHECK:STDOUT: block4: // CHECK:STDOUT: 0: inst+7 // CHECK:STDOUT: 1: inst+12 // CHECK:STDOUT: 2: inst+13 // CHECK:STDOUT: 3: inst+14 -// CHECK:STDOUT: block4: {} -// CHECK:STDOUT: block5: +// CHECK:STDOUT: block5: {} +// CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 // CHECK:STDOUT: 2: inst+2 // CHECK:STDOUT: 3: inst+3 -// CHECK:STDOUT: 4: inst+8 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon index 01aac5a4b380..d0a0342f9195 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon @@ -27,7 +27,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: bind_names: // CHECK:STDOUT: bind_name0: {name: name1, parent_scope: name_scope, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: block3, return_storage: inst+13, return_slot: present, body: [block6]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: block4, return_storage: inst+13, return_slot: present, body: [block7]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: {} // CHECK:STDOUT: generic_instances: {} @@ -52,27 +52,27 @@ fn Foo(n: ()) -> ((), ()) { // 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: type_block1, type: typeTypeType} -// CHECK:STDOUT: 'inst+9': {kind: TupleLiteral, arg0: block4, type: type2} +// CHECK:STDOUT: 'inst+9': {kind: TupleLiteral, arg0: block5, 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: FunctionDecl, arg0: function0, arg1: block5, type: type3} +// CHECK:STDOUT: 'inst+14': {kind: FunctionDecl, arg0: function0, arg1: block6, type: type3} // CHECK:STDOUT: 'inst+15': {kind: FunctionType, arg0: function0, type: typeTypeType} // CHECK:STDOUT: 'inst+16': {kind: StructValue, arg0: empty, type: type3} // CHECK:STDOUT: 'inst+17': {kind: PointerType, arg0: type2, type: typeTypeType} // CHECK:STDOUT: 'inst+18': {kind: NameRef, arg0: name1, arg1: inst+5, type: type1} // CHECK:STDOUT: 'inst+19': {kind: TupleLiteral, arg0: empty, type: type1} -// CHECK:STDOUT: 'inst+20': {kind: TupleLiteral, arg0: block7, type: type2} +// CHECK:STDOUT: 'inst+20': {kind: TupleLiteral, arg0: block8, type: type2} // CHECK:STDOUT: 'inst+21': {kind: TupleAccess, arg0: inst+13, arg1: element0, type: type1} -// CHECK:STDOUT: 'inst+22': {kind: TupleInit, arg0: block8, arg1: inst+21, type: type1} -// CHECK:STDOUT: 'inst+23': {kind: TupleValue, arg0: block9, type: type1} +// CHECK:STDOUT: 'inst+22': {kind: TupleInit, arg0: block9, arg1: inst+21, type: type1} +// CHECK:STDOUT: 'inst+23': {kind: TupleValue, arg0: block10, type: type1} // CHECK:STDOUT: 'inst+24': {kind: Converted, arg0: inst+18, arg1: inst+22, type: type1} // CHECK:STDOUT: 'inst+25': {kind: TupleAccess, arg0: inst+13, arg1: element1, type: type1} // CHECK:STDOUT: 'inst+26': {kind: TupleInit, arg0: empty, arg1: inst+25, type: type1} // CHECK:STDOUT: 'inst+27': {kind: Converted, arg0: inst+19, arg1: inst+26, type: type1} -// CHECK:STDOUT: 'inst+28': {kind: TupleInit, arg0: block10, arg1: inst+13, type: type2} -// CHECK:STDOUT: 'inst+29': {kind: TupleValue, arg0: block11, type: type2} +// CHECK:STDOUT: 'inst+28': {kind: TupleInit, arg0: block11, arg1: inst+13, type: type2} +// CHECK:STDOUT: 'inst+29': {kind: TupleValue, arg0: block12, type: type2} // CHECK:STDOUT: 'inst+30': {kind: Converted, arg0: inst+20, arg1: inst+28, type: type2} // CHECK:STDOUT: 'inst+31': {kind: ReturnExpr, arg0: inst+30, arg1: inst+13} // CHECK:STDOUT: constant_values: @@ -99,13 +99,14 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: // CHECK:STDOUT: 0: inst+14 +// CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block3: -// CHECK:STDOUT: 0: inst+5 // CHECK:STDOUT: block4: +// CHECK:STDOUT: 0: inst+5 +// CHECK:STDOUT: block5: // CHECK:STDOUT: 0: inst+6 // CHECK:STDOUT: 1: inst+7 -// CHECK:STDOUT: block5: +// CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: 1: inst+3 // CHECK:STDOUT: 2: inst+4 @@ -117,7 +118,7 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 8: inst+11 // CHECK:STDOUT: 9: inst+12 // CHECK:STDOUT: 10: inst+13 -// CHECK:STDOUT: block6: +// CHECK:STDOUT: block7: // CHECK:STDOUT: 0: inst+18 // CHECK:STDOUT: 1: inst+19 // CHECK:STDOUT: 2: inst+20 @@ -130,18 +131,18 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: 9: inst+28 // CHECK:STDOUT: 10: inst+30 // CHECK:STDOUT: 11: inst+31 -// CHECK:STDOUT: block7: +// CHECK:STDOUT: block8: // CHECK:STDOUT: 0: inst+18 // CHECK:STDOUT: 1: inst+19 -// CHECK:STDOUT: block8: {} // CHECK:STDOUT: block9: {} -// CHECK:STDOUT: block10: +// CHECK:STDOUT: block10: {} +// CHECK:STDOUT: block11: // CHECK:STDOUT: 0: inst+24 // CHECK:STDOUT: 1: inst+27 -// CHECK:STDOUT: block11: +// CHECK:STDOUT: block12: // CHECK:STDOUT: 0: inst+23 // CHECK:STDOUT: 1: inst+23 -// CHECK:STDOUT: block12: +// CHECK:STDOUT: block13: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+14 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon index b7406aaf3f76..5dca2899dad7 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon @@ -28,10 +28,10 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: bind_name0: {name: name1, parent_scope: name_scope, index: comp_time_bind0} // CHECK:STDOUT: bind_name1: {name: name2, parent_scope: name_scope, index: comp_time_bind} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: block4, return_storage: inst+15, return_slot: present, body: [block8]} +// CHECK:STDOUT: function0: {name: name0, parent_scope: name_scope0, param_refs: block5, return_storage: inst+15, return_slot: present, body: [block9]} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic0: {decl: inst+16, bindings: block7} +// CHECK:STDOUT: generic0: {decl: inst+16, bindings: block8} // CHECK:STDOUT: generic_instances: {} // CHECK:STDOUT: types: // CHECK:STDOUT: type0: {constant: template instNamespaceType, value_rep: {kind: copy, type: type0}} @@ -61,25 +61,25 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: 'inst+8': {kind: TupleType, arg0: type_block0, type: typeTypeType} // CHECK:STDOUT: 'inst+9': {kind: TupleLiteral, arg0: empty, type: type2} // CHECK:STDOUT: 'inst+10': {kind: TupleType, arg0: type_block1, type: typeTypeType} -// CHECK:STDOUT: 'inst+11': {kind: TupleLiteral, arg0: block5, type: type3} +// CHECK:STDOUT: 'inst+11': {kind: TupleLiteral, arg0: block6, type: type3} // CHECK:STDOUT: 'inst+12': {kind: Converted, arg0: inst+9, arg1: inst+8, type: typeTypeType} // CHECK:STDOUT: 'inst+13': {kind: TupleType, arg0: type_block2, type: typeTypeType} // CHECK:STDOUT: 'inst+14': {kind: Converted, arg0: inst+11, arg1: inst+13, type: typeTypeType} // CHECK:STDOUT: 'inst+15': {kind: VarStorage, arg0: nameReturnSlot, type: type4} -// CHECK:STDOUT: 'inst+16': {kind: FunctionDecl, arg0: function0, arg1: block6, type: type5} +// CHECK:STDOUT: 'inst+16': {kind: FunctionDecl, arg0: function0, arg1: block7, type: type5} // CHECK:STDOUT: 'inst+17': {kind: FunctionType, arg0: function0, type: typeTypeType} // CHECK:STDOUT: 'inst+18': {kind: StructValue, arg0: empty, type: type5} // CHECK:STDOUT: 'inst+19': {kind: PointerType, arg0: type4, type: typeTypeType} // CHECK:STDOUT: 'inst+20': {kind: NameRef, arg0: name2, arg1: inst+6, type: type1} // CHECK:STDOUT: 'inst+21': {kind: TupleLiteral, arg0: empty, type: type2} -// CHECK:STDOUT: 'inst+22': {kind: TupleLiteral, arg0: block9, type: type4} +// CHECK:STDOUT: 'inst+22': {kind: TupleLiteral, arg0: block10, type: type4} // CHECK:STDOUT: 'inst+23': {kind: TupleAccess, arg0: inst+15, arg1: element0, type: type1} // CHECK:STDOUT: 'inst+24': {kind: InitializeFrom, arg0: inst+20, arg1: inst+23, type: type1} // CHECK:STDOUT: 'inst+25': {kind: TupleAccess, arg0: inst+15, arg1: element1, type: type2} // CHECK:STDOUT: 'inst+26': {kind: TupleInit, arg0: empty, arg1: inst+25, type: type2} -// CHECK:STDOUT: 'inst+27': {kind: TupleValue, arg0: block11, type: type2} +// CHECK:STDOUT: 'inst+27': {kind: TupleValue, arg0: block12, type: type2} // CHECK:STDOUT: 'inst+28': {kind: Converted, arg0: inst+21, arg1: inst+26, type: type2} -// CHECK:STDOUT: 'inst+29': {kind: TupleInit, arg0: block10, arg1: inst+15, type: type4} +// CHECK:STDOUT: 'inst+29': {kind: TupleInit, arg0: block11, arg1: inst+15, type: type4} // CHECK:STDOUT: 'inst+30': {kind: Converted, arg0: inst+22, arg1: inst+29, type: type4} // CHECK:STDOUT: 'inst+31': {kind: ReturnExpr, arg0: inst+30, arg1: inst+15} // CHECK:STDOUT: constant_values: @@ -104,15 +104,16 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: empty: {} // CHECK:STDOUT: exports: // CHECK:STDOUT: 0: inst+16 +// CHECK:STDOUT: import_refs: {} // CHECK:STDOUT: global_init: {} -// CHECK:STDOUT: block3: -// CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: block4: -// CHECK:STDOUT: 0: inst+6 +// CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: block5: +// CHECK:STDOUT: 0: inst+6 +// CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+7 // CHECK:STDOUT: 1: inst+9 -// CHECK:STDOUT: block6: +// CHECK:STDOUT: block7: // CHECK:STDOUT: 0: inst+1 // CHECK:STDOUT: 1: inst+2 // CHECK:STDOUT: 2: inst+4 @@ -124,9 +125,9 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: 8: inst+12 // CHECK:STDOUT: 9: inst+14 // CHECK:STDOUT: 10: inst+15 -// CHECK:STDOUT: block7: -// CHECK:STDOUT: 0: inst+2 // CHECK:STDOUT: block8: +// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: block9: // CHECK:STDOUT: 0: inst+20 // CHECK:STDOUT: 1: inst+21 // CHECK:STDOUT: 2: inst+22 @@ -138,14 +139,14 @@ fn Foo[T:! type](n: T) -> (T, ()) { // CHECK:STDOUT: 8: inst+29 // CHECK:STDOUT: 9: inst+30 // CHECK:STDOUT: 10: inst+31 -// CHECK:STDOUT: block9: +// CHECK:STDOUT: block10: // CHECK:STDOUT: 0: inst+20 // CHECK:STDOUT: 1: inst+21 -// CHECK:STDOUT: block10: +// CHECK:STDOUT: block11: // CHECK:STDOUT: 0: inst+24 // CHECK:STDOUT: 1: inst+28 -// CHECK:STDOUT: block11: {} -// CHECK:STDOUT: block12: +// CHECK:STDOUT: block12: {} +// CHECK:STDOUT: block13: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+16 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index 5557539f2b26..0a616792eb06 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -66,6 +66,11 @@ fn F() { // CHECK:STDOUT: %array.2: %.16 = tuple_value (%.18, %.19, %.20, %.21, %.22, %.23) [template] // 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: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -74,8 +79,6 @@ fn F() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 910e2bc2f529..18f22023af8c 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -21,6 +21,11 @@ var b: i32 = ((2)); // CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -29,13 +34,11 @@ var b: i32 = ((2)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index ceaec8de767e..41fb4f450da0 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -21,6 +21,10 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -28,7 +32,6 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index ac36810457ad..4376c4663706 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -125,6 +125,12 @@ var test_f128: f128; // CHECK:STDOUT: %.7: type = int_type signed, %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.3: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -135,21 +141,18 @@ var test_f128: f128; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 8 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] // CHECK:STDOUT: %int.make_type_signed.loc3: init type = call constants.%Int(%.loc3_14.1) [template = constants.%.3] // CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_signed.loc3 [template = constants.%.3] // CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_signed.loc3, %.loc3_14.2 [template = constants.%.3] // CHECK:STDOUT: %test_i8.var: ref %.3 = var test_i8 // CHECK:STDOUT: %test_i8: ref %.3 = bind_name test_i8, %test_i8.var // CHECK:STDOUT: %.loc4_15.1: i32 = int_literal 16 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] // CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_15.1) [template = constants.%.5] // CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%.5] // CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_signed.loc4, %.loc4_15.2 [template = constants.%.5] // CHECK:STDOUT: %test_i16.var: ref %.5 = var test_i16 // CHECK:STDOUT: %test_i16: ref %.5 = bind_name test_i16, %test_i16.var // CHECK:STDOUT: %.loc5_15.1: i32 = int_literal 64 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] // CHECK:STDOUT: %int.make_type_signed.loc5: init type = call constants.%Int(%.loc5_15.1) [template = constants.%.7] // CHECK:STDOUT: %.loc5_15.2: type = value_of_initializer %int.make_type_signed.loc5 [template = constants.%.7] // CHECK:STDOUT: %.loc5_15.3: type = converted %int.make_type_signed.loc5, %.loc5_15.2 [template = constants.%.7] @@ -172,6 +175,13 @@ var test_f128: f128; // CHECK:STDOUT: %.6: i32 = int_literal 1000000000 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.3: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.4: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -187,27 +197,23 @@ var test_f128: f128; // CHECK:STDOUT: %test_i0.var: ref = var test_i0 // CHECK:STDOUT: %test_i0: ref = bind_name test_i0, %test_i0.var // CHECK:STDOUT: %.loc12_14.1: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] // CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_14.1) [template = constants.%.3] // CHECK:STDOUT: %.loc12_14.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%.3] // CHECK:STDOUT: %.loc12_14.3: type = converted %int.make_type_signed.loc12, %.loc12_14.2 [template = constants.%.3] // CHECK:STDOUT: %test_i1.var: ref %.3 = var test_i1 // CHECK:STDOUT: %test_i1: ref %.3 = bind_name test_i1, %test_i1.var // CHECK:STDOUT: %.loc17_15.1: i32 = int_literal 15 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] // CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_15.1) [template = constants.%.5] // CHECK:STDOUT: %.loc17_15.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%.5] // CHECK:STDOUT: %.loc17_15.3: type = converted %int.make_type_signed.loc17, %.loc17_15.2 [template = constants.%.5] // CHECK:STDOUT: %test_i15.var: ref %.5 = var test_i15 // CHECK:STDOUT: %test_i15: ref %.5 = bind_name test_i15, %test_i15.var // CHECK:STDOUT: %.loc22_23.1: i32 = int_literal 1000000000 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] // CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_23.1) [template = ] // CHECK:STDOUT: %.loc22_23.2: type = value_of_initializer %int.make_type_signed.loc22 [template = ] // CHECK:STDOUT: %.loc22_23.3: type = converted %int.make_type_signed.loc22, %.loc22_23.2 [template = ] // CHECK:STDOUT: %test_i1000000000.var: ref = var test_i1000000000 // CHECK:STDOUT: %test_i1000000000: ref = bind_name test_i1000000000, %test_i1000000000.var -// CHECK:STDOUT: %import_ref.4: %Int.type = import_ref ir3, inst+14, loaded [template = constants.%Int] // CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int() [template = ] // CHECK:STDOUT: %.loc28_33.1: type = value_of_initializer %int.make_type_signed.loc28 [template = ] // CHECK:STDOUT: %.loc28_33.2: type = converted %int.make_type_signed.loc28, %.loc28_33.1 [template = ] @@ -231,6 +237,12 @@ var test_f128: f128; // CHECK:STDOUT: %.7: type = int_type unsigned, %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.3: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -241,21 +253,18 @@ var test_f128: f128; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 8 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %int.make_type_unsigned.loc3: init type = call constants.%UInt(%.loc3_14.1) [template = constants.%.3] // CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_unsigned.loc3 [template = constants.%.3] // CHECK:STDOUT: %.loc3_14.3: type = converted %int.make_type_unsigned.loc3, %.loc3_14.2 [template = constants.%.3] // CHECK:STDOUT: %test_u8.var: ref %.3 = var test_u8 // CHECK:STDOUT: %test_u8: ref %.3 = bind_name test_u8, %test_u8.var // CHECK:STDOUT: %.loc4_15.1: i32 = int_literal 16 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %int.make_type_unsigned.loc4: init type = call constants.%UInt(%.loc4_15.1) [template = constants.%.5] // CHECK:STDOUT: %.loc4_15.2: type = value_of_initializer %int.make_type_unsigned.loc4 [template = constants.%.5] // CHECK:STDOUT: %.loc4_15.3: type = converted %int.make_type_unsigned.loc4, %.loc4_15.2 [template = constants.%.5] // CHECK:STDOUT: %test_u16.var: ref %.5 = var test_u16 // CHECK:STDOUT: %test_u16: ref %.5 = bind_name test_u16, %test_u16.var // CHECK:STDOUT: %.loc5_15.1: i32 = int_literal 64 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %int.make_type_unsigned.loc5: init type = call constants.%UInt(%.loc5_15.1) [template = constants.%.7] // CHECK:STDOUT: %.loc5_15.2: type = value_of_initializer %int.make_type_unsigned.loc5 [template = constants.%.7] // CHECK:STDOUT: %.loc5_15.3: type = converted %int.make_type_unsigned.loc5, %.loc5_15.2 [template = constants.%.7] @@ -278,6 +287,13 @@ var test_f128: f128; // CHECK:STDOUT: %.6: i32 = int_literal 1000000000 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.3: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.4: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -293,27 +309,23 @@ var test_f128: f128; // CHECK:STDOUT: %test_u0.var: ref = var test_u0 // CHECK:STDOUT: %test_u0: ref = bind_name test_u0, %test_u0.var // CHECK:STDOUT: %.loc12_14.1: i32 = int_literal 1 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %int.make_type_unsigned.loc12: init type = call constants.%UInt(%.loc12_14.1) [template = constants.%.3] // CHECK:STDOUT: %.loc12_14.2: type = value_of_initializer %int.make_type_unsigned.loc12 [template = constants.%.3] // CHECK:STDOUT: %.loc12_14.3: type = converted %int.make_type_unsigned.loc12, %.loc12_14.2 [template = constants.%.3] // CHECK:STDOUT: %test_u1.var: ref %.3 = var test_u1 // CHECK:STDOUT: %test_u1: ref %.3 = bind_name test_u1, %test_u1.var // CHECK:STDOUT: %.loc17_15.1: i32 = int_literal 15 [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %int.make_type_unsigned.loc17: init type = call constants.%UInt(%.loc17_15.1) [template = constants.%.5] // CHECK:STDOUT: %.loc17_15.2: type = value_of_initializer %int.make_type_unsigned.loc17 [template = constants.%.5] // CHECK:STDOUT: %.loc17_15.3: type = converted %int.make_type_unsigned.loc17, %.loc17_15.2 [template = constants.%.5] // CHECK:STDOUT: %test_u15.var: ref %.5 = var test_u15 // CHECK:STDOUT: %test_u15: ref %.5 = bind_name test_u15, %test_u15.var // CHECK:STDOUT: %.loc22_23.1: i32 = int_literal 1000000000 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.3: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %int.make_type_unsigned.loc22: init type = call constants.%UInt(%.loc22_23.1) [template = ] // CHECK:STDOUT: %.loc22_23.2: type = value_of_initializer %int.make_type_unsigned.loc22 [template = ] // CHECK:STDOUT: %.loc22_23.3: type = converted %int.make_type_unsigned.loc22, %.loc22_23.2 [template = ] // CHECK:STDOUT: %test_u1000000000.var: ref = var test_u1000000000 // CHECK:STDOUT: %test_u1000000000: ref = bind_name test_u1000000000, %test_u1000000000.var -// CHECK:STDOUT: %import_ref.4: %UInt.type = import_ref ir3, inst+23, loaded [template = constants.%UInt] // CHECK:STDOUT: %int.make_type_unsigned.loc28: init type = call constants.%UInt() [template = ] // CHECK:STDOUT: %.loc28_33.1: type = value_of_initializer %int.make_type_unsigned.loc28 [template = ] // CHECK:STDOUT: %.loc28_33.2: type = converted %int.make_type_unsigned.loc28, %.loc28_33.1 [template = ] diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index 22572c25e471..f119677eb52e 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -53,17 +53,20 @@ var b: Bool() = false; // CHECK:STDOUT: %.2: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir1, inst+4, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Bool = %import_ref +// CHECK:STDOUT: .Bool = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir1, inst+4, loaded [template = constants.%Bool] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Bool.ref: %Bool.type = name_ref Bool, %import_ref [template = constants.%Bool] +// CHECK:STDOUT: %Bool.ref: %Bool.type = name_ref Bool, imports.%import_ref [template = constants.%Bool] // CHECK:STDOUT: %bool.make_type: init type = call %Bool.ref() [template = bool] // CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] // CHECK:STDOUT: %.loc6_13.2: type = converted %bool.make_type, %.loc6_13.1 [template = bool] diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index efbff86dd1e9..5e34d058b95f 100644 --- a/toolchain/check/testdata/builtins/float/add.carbon +++ b/toolchain/check/testdata/builtins/float/add.carbon @@ -66,6 +66,16 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.5: f64 = float_literal 4.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -75,9 +85,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -97,9 +104,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_27.3: type = converted %float.make_type.loc2_27, %.loc2_27.2 [template = f64] // CHECK:STDOUT: @Add.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] @@ -120,7 +124,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: @RuntimeCall.%return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_8.1) [template = f64] // CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] // CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] @@ -178,6 +181,30 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -191,8 +218,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] @@ -206,10 +231,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc8_22.3: type = converted %float.make_type.loc8_22, %.loc8_22.2 [template = f64] // CHECK:STDOUT: @TooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] @@ -235,9 +256,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc13_39.3: type = converted %float.make_type.loc13_39, %.loc13_39.2 [template = f64] // CHECK:STDOUT: @TooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %.loc17_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%.loc17_21.1) [template = f64] @@ -256,9 +274,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type.loc17, %.loc17_37.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %.loc18_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%.loc18_17.1) [template = f64] @@ -278,8 +293,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc18_33.3: type = converted %float.make_type.loc18_33, %.loc18_33.2 [template = f64] // CHECK:STDOUT: @JustRight.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %.loc20_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%.loc20_25.1) [template = f64] @@ -293,10 +306,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc20_33.3: type = converted %float.make_type.loc20_33, %.loc20_33.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %.loc24_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%.loc24_26.1) [template = f64] @@ -322,9 +331,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc24_50.3: type = converted %float.make_type.loc24_50, %.loc24_50.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %.loc28_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%.loc28_32.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index 8994f4ddadff..bd9a41719e24 100644 --- a/toolchain/check/testdata/builtins/float/div.carbon +++ b/toolchain/check/testdata/builtins/float/div.carbon @@ -72,6 +72,18 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.9: f64 = float_literal NaN [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.9: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -83,9 +95,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -105,9 +114,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_27.3: type = converted %float.make_type.loc2_27, %.loc2_27.2 [template = f64] // CHECK:STDOUT: @Div.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] @@ -128,19 +134,16 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: @RuntimeCall.%return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_8.1) [template = f64] // CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] // CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] // CHECK:STDOUT: %a.var: ref f64 = var a // CHECK:STDOUT: %a.loc8: ref f64 = bind_name a, %a.var // CHECK:STDOUT: %.loc9_8.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc9: init type = call constants.%Float(%.loc9_8.1) [template = f64] // CHECK:STDOUT: %.loc9_8.2: type = value_of_initializer %float.make_type.loc9 [template = f64] // CHECK:STDOUT: %.loc9_8.3: type = converted %float.make_type.loc9, %.loc9_8.2 [template = f64] // CHECK:STDOUT: %.loc10_8.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.9: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc10: init type = call constants.%Float(%.loc10_8.1) [template = f64] // CHECK:STDOUT: %.loc10_8.2: type = value_of_initializer %float.make_type.loc10 [template = f64] // CHECK:STDOUT: %.loc10_8.3: type = converted %float.make_type.loc10, %.loc10_8.2 [template = f64] @@ -210,6 +213,30 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -223,8 +250,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] @@ -238,10 +263,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc8_22.3: type = converted %float.make_type.loc8_22, %.loc8_22.2 [template = f64] // CHECK:STDOUT: @TooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] @@ -267,9 +288,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc13_39.3: type = converted %float.make_type.loc13_39, %.loc13_39.2 [template = f64] // CHECK:STDOUT: @TooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %.loc17_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%.loc17_21.1) [template = f64] @@ -288,9 +306,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type.loc17, %.loc17_37.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %.loc18_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%.loc18_17.1) [template = f64] @@ -310,8 +325,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc18_33.3: type = converted %float.make_type.loc18_33, %.loc18_33.2 [template = f64] // CHECK:STDOUT: @JustRight.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %.loc20_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%.loc20_25.1) [template = f64] @@ -325,10 +338,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc20_33.3: type = converted %float.make_type.loc20_33, %.loc20_33.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %.loc24_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%.loc24_26.1) [template = f64] @@ -354,9 +363,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc24_50.3: type = converted %float.make_type.loc24_50, %.loc24_50.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %.loc28_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%.loc28_32.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index de59ae27e1e0..47894581c22f 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -58,6 +58,15 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,9 +78,6 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { // CHECK:STDOUT: %.loc2_10.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_10: init type = call constants.%Float(%.loc2_10.1) [template = f64] @@ -100,9 +106,6 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %false_.loc7_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc7_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc12_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%.loc12_19.1) [template = f64] @@ -204,6 +207,12 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %WrongResult: %WrongResult.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -211,9 +220,6 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %.loc7_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%.loc7_19.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/greater.carbon b/toolchain/check/testdata/builtins/float/greater.carbon index 9250dd8df362..176e77e47d29 100644 --- a/toolchain/check/testdata/builtins/float/greater.carbon +++ b/toolchain/check/testdata/builtins/float/greater.carbon @@ -57,6 +57,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,9 +80,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { // CHECK:STDOUT: %.loc2_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_15: init type = call constants.%Float(%.loc2_15.1) [template = f64] @@ -90,8 +98,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type.loc2, %.loc2_31.1 [template = bool] // CHECK:STDOUT: @Greater.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%.loc3_14.1) [template = f64] @@ -115,9 +121,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.loc8_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc16_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%.loc16_19.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/greater_eq.carbon b/toolchain/check/testdata/builtins/float/greater_eq.carbon index 413825e406e9..622a6a490f78 100644 --- a/toolchain/check/testdata/builtins/float/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/float/greater_eq.carbon @@ -57,6 +57,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,9 +80,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { // CHECK:STDOUT: %.loc2_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_17: init type = call constants.%Float(%.loc2_17.1) [template = f64] @@ -90,8 +98,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type.loc2, %.loc2_33.1 [template = bool] // CHECK:STDOUT: @GreaterEq.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%.loc3_14.1) [template = f64] @@ -115,9 +121,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.loc8_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc16_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%.loc16_19.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/less.carbon b/toolchain/check/testdata/builtins/float/less.carbon index 8a74eb941948..18c6fbb21bba 100644 --- a/toolchain/check/testdata/builtins/float/less.carbon +++ b/toolchain/check/testdata/builtins/float/less.carbon @@ -57,6 +57,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,9 +80,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { // CHECK:STDOUT: %.loc2_12.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_12: init type = call constants.%Float(%.loc2_12.1) [template = f64] @@ -90,8 +98,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type.loc2, %.loc2_28.1 [template = bool] // CHECK:STDOUT: @Less.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%.loc3_14.1) [template = f64] @@ -115,9 +121,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.loc8_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc16_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%.loc16_19.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/less_eq.carbon b/toolchain/check/testdata/builtins/float/less_eq.carbon index daac6e96bf3d..7c41c26f0784 100644 --- a/toolchain/check/testdata/builtins/float/less_eq.carbon +++ b/toolchain/check/testdata/builtins/float/less_eq.carbon @@ -57,6 +57,17 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,9 +80,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { // CHECK:STDOUT: %.loc2_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%.loc2_14.1) [template = f64] @@ -90,8 +98,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type.loc2, %.loc2_30.1 [template = bool] // CHECK:STDOUT: @LessEq.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc3_14: init type = call constants.%Float(%.loc3_14.1) [template = f64] @@ -115,9 +121,6 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false_.loc8_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc16_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%.loc16_19.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 8c830b06dd8e..8168b58df2c8 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -54,6 +54,10 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -61,7 +65,6 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Float.decl: %Float.type = fn_decl @Float [template = constants.%Float] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_16.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -90,25 +93,28 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %GetFloat: %GetFloat.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir1, inst+15, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Float = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .f = %f // CHECK:STDOUT: .GetFloat = %GetFloat.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir1, inst+15, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, %import_ref.1 [template = constants.%Float] +// CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%.loc6_14) [template = f64] // CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc6_16.2: type = converted %float.make_type, %.loc6_16.1 [template = f64] // CHECK:STDOUT: %f.var: ref f64 = var f // CHECK:STDOUT: %f: ref f64 = bind_name f, %f.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %GetFloat.decl: %GetFloat.type = fn_decl @GetFloat [template = constants.%GetFloat] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_23.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -125,7 +131,7 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: // CHECK:STDOUT: fn @GetFloat(%dyn_size: i32) -> type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, file.%import_ref.1 [template = constants.%Float] +// CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %dyn_size.ref: i32 = name_ref dyn_size, %dyn_size // CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%dyn_size.ref) // CHECK:STDOUT: %.loc9_25.1: type = value_of_initializer %float.make_type @@ -152,9 +158,14 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: %.3: i32 = int_literal 64 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir1, inst+15, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Float = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .invalid_float = %invalid_float // CHECK:STDOUT: .dyn_size = %dyn_size @@ -162,22 +173,20 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir1, inst+15, loaded [template = constants.%Float] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Float.ref.loc10: %Float.type = name_ref Float, %import_ref.1 [template = constants.%Float] +// CHECK:STDOUT: %Float.ref.loc10: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %.loc10_26: i32 = int_literal 32 [template = constants.%.2] // CHECK:STDOUT: %float.make_type.loc10: init type = call %Float.ref.loc10(%.loc10_26) [template = ] // CHECK:STDOUT: %.loc10_28.1: type = value_of_initializer %float.make_type.loc10 [template = ] // CHECK:STDOUT: %.loc10_28.2: type = converted %float.make_type.loc10, %.loc10_28.1 [template = ] // CHECK:STDOUT: %invalid_float.var: ref = var invalid_float // CHECK:STDOUT: %invalid_float: ref = bind_name invalid_float, %invalid_float.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_32, %.loc12_15.1 [template = i32] // CHECK:STDOUT: %dyn_size.var: ref i32 = var dyn_size // CHECK:STDOUT: %dyn_size: ref i32 = bind_name dyn_size, %dyn_size.var -// CHECK:STDOUT: %Float.ref.loc16: %Float.type = name_ref Float, %import_ref.1 [template = constants.%Float] +// CHECK:STDOUT: %Float.ref.loc16: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %dyn_size.ref: ref i32 = name_ref dyn_size, %dyn_size // CHECK:STDOUT: %.loc16_16: i32 = bind_value %dyn_size.ref // CHECK:STDOUT: %float.make_type.loc16: init type = call %Float.ref.loc16(%.loc16_16) diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index 10ff4f4ef9b4..9bdea70aefc4 100644 --- a/toolchain/check/testdata/builtins/float/mul.carbon +++ b/toolchain/check/testdata/builtins/float/mul.carbon @@ -66,6 +66,16 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.5: f64 = float_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -75,9 +85,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -97,9 +104,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_27.3: type = converted %float.make_type.loc2_27, %.loc2_27.2 [template = f64] // CHECK:STDOUT: @Mul.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] @@ -120,7 +124,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: @RuntimeCall.%return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_8.1) [template = f64] // CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] // CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] @@ -178,6 +181,30 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -191,8 +218,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] @@ -206,10 +231,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc8_22.3: type = converted %float.make_type.loc8_22, %.loc8_22.2 [template = f64] // CHECK:STDOUT: @TooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] @@ -235,9 +256,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc13_39.3: type = converted %float.make_type.loc13_39, %.loc13_39.2 [template = f64] // CHECK:STDOUT: @TooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %.loc17_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%.loc17_21.1) [template = f64] @@ -256,9 +274,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type.loc17, %.loc17_37.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %.loc18_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%.loc18_17.1) [template = f64] @@ -278,8 +293,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc18_33.3: type = converted %float.make_type.loc18_33, %.loc18_33.2 [template = f64] // CHECK:STDOUT: @JustRight.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %.loc20_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%.loc20_25.1) [template = f64] @@ -293,10 +306,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc20_33.3: type = converted %float.make_type.loc20_33, %.loc20_33.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %.loc24_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%.loc24_26.1) [template = f64] @@ -322,9 +331,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc24_50.3: type = converted %float.make_type.loc24_50, %.loc24_50.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %.loc28_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%.loc28_32.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index e6bf6d7f0274..9bd63af9ae46 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -86,6 +86,15 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.4: f64 = float_literal -1.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -95,8 +104,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %.loc2_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%.loc2_14.1) [template = f64] @@ -110,9 +117,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_22.3: type = converted %float.make_type.loc2_22, %.loc2_22.2 [template = f64] // CHECK:STDOUT: @Negate.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] @@ -133,7 +137,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: @RuntimeCall.%return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_8.1) [template = f64] // CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] // CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] @@ -189,6 +192,26 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.9: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.17: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -202,7 +225,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_16.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_16.1) [template = f64] @@ -210,9 +232,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc8_16.3: type = converted %float.make_type.loc8, %.loc8_16.2 [template = f64] // CHECK:STDOUT: @TooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] @@ -232,8 +251,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [template = f64] // CHECK:STDOUT: @TooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %.loc18_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18: init type = call constants.%Float(%.loc18_21.1) [template = f64] @@ -246,8 +263,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type.loc18, %.loc18_29.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %.loc19_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc19_17: init type = call constants.%Float(%.loc19_17.1) [template = f64] @@ -261,8 +276,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [template = f64] // CHECK:STDOUT: @JustRight.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %.loc21_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc21_25: init type = call constants.%Float(%.loc21_25.1) [template = f64] @@ -276,10 +289,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc21_33.3: type = converted %float.make_type.loc21_33, %.loc21_33.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %.loc32_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc32_26: init type = call constants.%Float(%.loc32_26.1) [template = f64] @@ -305,9 +314,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc32_50.3: type = converted %float.make_type.loc32_50, %.loc32_50.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %.loc43_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc43_32: init type = call constants.%Float(%.loc43_32.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index eae70287e0ca..d5c5a7868c0f 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -58,6 +58,15 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,9 +78,6 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -100,9 +106,6 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %false_.loc7_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc7_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc12_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%.loc12_19.1) [template = f64] @@ -204,6 +207,12 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %WrongResult: %WrongResult.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -211,9 +220,6 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %.loc7_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%.loc7_19.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index cf3681e51daf..043ebd652312 100644 --- a/toolchain/check/testdata/builtins/float/sub.carbon +++ b/toolchain/check/testdata/builtins/float/sub.carbon @@ -66,6 +66,16 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.5: f64 = float_literal 1.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -75,9 +85,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -97,9 +104,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc2_27.3: type = converted %float.make_type.loc2_27, %.loc2_27.2 [template = f64] // CHECK:STDOUT: @Sub.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %.loc4_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%.loc4_19.1) [template = f64] @@ -120,7 +124,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: @RuntimeCall.%return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %.loc8_8.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_8.1) [template = f64] // CHECK:STDOUT: %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [template = f64] // CHECK:STDOUT: %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [template = f64] @@ -178,6 +181,30 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -191,8 +218,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] @@ -206,10 +231,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc8_22.3: type = converted %float.make_type.loc8_22, %.loc8_22.2 [template = f64] // CHECK:STDOUT: @TooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %.loc13_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc13_15: init type = call constants.%Float(%.loc13_15.1) [template = f64] @@ -235,9 +256,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc13_39.3: type = converted %float.make_type.loc13_39, %.loc13_39.2 [template = f64] // CHECK:STDOUT: @TooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %.loc17_21.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc17_21: init type = call constants.%Float(%.loc17_21.1) [template = f64] @@ -256,9 +274,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc17_37.2: type = converted %bool.make_type.loc17, %.loc17_37.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %.loc18_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc18_17: init type = call constants.%Float(%.loc18_17.1) [template = f64] @@ -278,8 +293,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc18_33.3: type = converted %float.make_type.loc18_33, %.loc18_33.2 [template = f64] // CHECK:STDOUT: @JustRight.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %.loc20_25.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%.loc20_25.1) [template = f64] @@ -293,10 +306,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc20_33.3: type = converted %float.make_type.loc20_33, %.loc20_33.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %.loc24_26.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%.loc24_26.1) [template = f64] @@ -322,9 +331,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %.loc24_50.3: type = converted %float.make_type.loc24_50, %.loc24_50.2 [template = f64] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %.loc28_32.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%.loc28_32.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index da3253254e60..00dcee1fe13e 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -36,6 +36,17 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -46,9 +57,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %And.decl: %And.type = fn_decl @And [template = constants.%And] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -65,7 +73,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @And.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 12 [template = constants.%.2] @@ -76,16 +83,12 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc4_27: type = array_type %int.and, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 8 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index a68dd2a270b9..2cd5d6b9368e 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -40,6 +40,18 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -51,8 +63,6 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Complement.decl: %Complement.type = fn_decl @Complement [template = constants.%Complement] { // CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] @@ -64,9 +74,6 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_32.loc2_26, %.loc2_26.1 [template = i32] // CHECK:STDOUT: @Complement.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %And.decl: %And.type = fn_decl @And [template = constants.%And] { // CHECK:STDOUT: %int.make_type_32.loc3_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_11.1: type = value_of_initializer %int.make_type_32.loc3_11 [template = i32] @@ -83,7 +90,6 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %.loc3_27.2: type = converted %int.make_type_32.loc3_27, %.loc3_27.1 [template = i32] // CHECK:STDOUT: @And.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %And.ref: %And.type = name_ref And, %And.decl [template = constants.%And] // CHECK:STDOUT: %Complement.ref: %Complement.type = name_ref Complement, %Complement.decl [template = constants.%Complement] @@ -98,15 +104,12 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: %.loc5_51: type = array_type %int.and, i32 [template = constants.%.6] // CHECK:STDOUT: %arr.var: ref %.6 = var arr // CHECK:STDOUT: %arr: ref %.6 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_18: i32 = int_literal 15584169 [template = constants.%.5] // CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_13.2: type = converted %int.make_type_32.loc6, %.loc6_13.1 [template = i32] // CHECK:STDOUT: %.loc6_26: type = array_type %.loc6_18, i32 [template = constants.%.6] // CHECK:STDOUT: %.loc6_27: type = ptr_type %.6 [template = constants.%.7] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc8_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_19.1: type = value_of_initializer %int.make_type_32.loc8_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index aa22c07e6df5..ed77843494cf 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -57,6 +57,15 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -68,9 +77,6 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { // CHECK:STDOUT: %int.make_type_32.loc2_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_32.loc2_10 [template = i32] @@ -97,9 +103,6 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %false_.loc7_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc7_19.1 // CHECK:STDOUT: } -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc12_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12_19 [template = i32] @@ -198,6 +201,12 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: %WrongResult: %WrongResult.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -205,9 +214,6 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 71bd02db8ad9..538939ac1f76 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -56,6 +56,17 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -68,9 +79,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { // CHECK:STDOUT: %int.make_type_32.loc2_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_15.1: type = value_of_initializer %int.make_type_32.loc2_15 [template = i32] @@ -87,8 +95,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type.loc2, %.loc2_31.1 [template = bool] // CHECK:STDOUT: @Greater.%return: ref bool = var // CHECK:STDOUT: } -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] @@ -110,9 +116,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.loc8_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index 50aaddc2a002..76cb1d098d04 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -56,6 +56,17 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -68,9 +79,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { // CHECK:STDOUT: %int.make_type_32.loc2_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_32.loc2_17 [template = i32] @@ -87,8 +95,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type.loc2, %.loc2_33.1 [template = bool] // CHECK:STDOUT: @GreaterEq.%return: ref bool = var // CHECK:STDOUT: } -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] @@ -110,9 +116,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.loc8_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index 0d6277b9580a..dbf2682c4f83 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -80,6 +80,17 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -90,9 +101,6 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { // CHECK:STDOUT: %int.make_type_32.loc2_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_32.loc2_17 [template = i32] @@ -109,7 +117,6 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc2_33.2: type = converted %int.make_type_32.loc2_33, %.loc2_33.1 [template = i32] // CHECK:STDOUT: @LeftShift.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %LeftShift.ref: %LeftShift.type = name_ref LeftShift, %LeftShift.decl [template = constants.%LeftShift] // CHECK:STDOUT: %.loc4_26: i32 = int_literal 5 [template = constants.%.2] @@ -120,16 +127,12 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc4_31: type = array_type %int.left_shift, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 20 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_21: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -191,6 +194,22 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.9: i32 = int_literal -1 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -207,9 +226,6 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { // CHECK:STDOUT: %int.make_type_32.loc4_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_32.loc4_17 [template = i32] @@ -226,8 +242,6 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc4_33.2: type = converted %int.make_type_32.loc4_33, %.loc4_33.1 [template = i32] // CHECK:STDOUT: @LeftShift.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc5_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5_14 [template = i32] @@ -239,35 +253,27 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_32.loc18, %.loc18_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_17.2: type = converted %int.make_type_32.loc21, %.loc21_17.1 [template = i32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc26_17.1: type = value_of_initializer %int.make_type_32.loc26 [template = i32] // CHECK:STDOUT: %.loc26_17.2: type = converted %int.make_type_32.loc26, %.loc26_17.1 [template = i32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_20.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] // CHECK:STDOUT: %.loc29_20.2: type = converted %int.make_type_32.loc29, %.loc29_20.1 [template = i32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc34_20.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] // CHECK:STDOUT: %.loc34_20.2: type = converted %int.make_type_32.loc34, %.loc34_20.1 [template = i32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc40_15.1: type = value_of_initializer %int.make_type_32.loc40 [template = i32] // CHECK:STDOUT: %.loc40_15.2: type = converted %int.make_type_32.loc40, %.loc40_15.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index 3819b4430682..38dcb94a2801 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -56,6 +56,17 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -68,9 +79,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { // CHECK:STDOUT: %int.make_type_32.loc2_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %int.make_type_32.loc2_12 [template = i32] @@ -87,8 +95,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type.loc2, %.loc2_28.1 [template = bool] // CHECK:STDOUT: @Less.%return: ref bool = var // CHECK:STDOUT: } -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] @@ -110,9 +116,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.loc8_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 5f4a923ec2ce..54b4e187f8c8 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -56,6 +56,17 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -68,9 +79,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] @@ -87,8 +95,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type.loc2, %.loc2_30.1 [template = bool] // CHECK:STDOUT: @LessEq.%return: ref bool = var // CHECK:STDOUT: } -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc3_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc3_14.1: type = value_of_initializer %int.make_type_32.loc3_14 [template = i32] @@ -110,9 +116,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.loc8_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc8_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc16_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32.loc16_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/make_type_32.carbon b/toolchain/check/testdata/builtins/int/make_type_32.carbon index de3b1091e759..5bac897566ad 100644 --- a/toolchain/check/testdata/builtins/int/make_type_32.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_32.carbon @@ -53,17 +53,20 @@ var i: Int() = 0; // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int.type = import_ref ir1, inst+4, loaded [template = constants.%Int] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .i = %i // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %Int.type = import_ref ir1, inst+4, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, %import_ref [template = constants.%Int] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref [template = constants.%Int] // CHECK:STDOUT: %int.make_type_32: init type = call %Int.ref() [template = i32] // CHECK:STDOUT: %.loc6_12.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc6_12.2: type = converted %int.make_type_32, %.loc6_12.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 05e22f633e1b..1af453f4a481 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -79,6 +79,10 @@ var m: Int(1000000000); // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -86,7 +90,6 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -123,9 +126,14 @@ var m: Int(1000000000); // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref ir1, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = %import_ref.1 +// CHECK:STDOUT: .Int = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl @@ -133,17 +141,16 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref ir1, inst+15, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, %import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc6_13: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_signed.loc6_12: init type = call %Int.ref.loc6_9(%.loc6_13) [template = constants.%.3] // CHECK:STDOUT: %.loc6_15.1: type = value_of_initializer %int.make_type_signed.loc6_12 [template = constants.%.3] // CHECK:STDOUT: %.loc6_15.2: type = converted %int.make_type_signed.loc6_12, %.loc6_15.1 [template = constants.%.3] // CHECK:STDOUT: %n.loc6_6.1: %.3 = param n // CHECK:STDOUT: @F.%n: %.3 = bind_name n, %n.loc6_6.1 -// CHECK:STDOUT: %Int.ref.loc6_21: %Int.type = name_ref Int, %import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref.loc6_21: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc6_25: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_signed.loc6_24: init type = call %Int.ref.loc6_21(%.loc6_25) [template = constants.%.3] // CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6_24 [template = constants.%.3] @@ -151,35 +158,34 @@ var m: Int(1000000000); // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, %import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc10_13: i32 = int_literal 13 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_signed.loc10_12: init type = call %Int.ref.loc10_9(%.loc10_13) [template = constants.%.5] // CHECK:STDOUT: %.loc10_15.1: type = value_of_initializer %int.make_type_signed.loc10_12 [template = constants.%.5] // CHECK:STDOUT: %.loc10_15.2: type = converted %int.make_type_signed.loc10_12, %.loc10_15.1 [template = constants.%.5] // CHECK:STDOUT: %n.loc10_6.1: %.5 = param n // CHECK:STDOUT: @G.%n: %.5 = bind_name n, %n.loc10_6.1 -// CHECK:STDOUT: %Int.ref.loc10_21: %Int.type = name_ref Int, %import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref.loc10_21: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc10_25: i32 = int_literal 13 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_signed.loc10_24: init type = call %Int.ref.loc10_21(%.loc10_25) [template = constants.%.5] // CHECK:STDOUT: %.loc10_27.1: type = value_of_initializer %int.make_type_signed.loc10_24 [template = constants.%.5] // CHECK:STDOUT: %.loc10_27.2: type = converted %int.make_type_signed.loc10_24, %.loc10_27.1 [template = constants.%.5] // CHECK:STDOUT: @G.%return: ref %.5 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_17.2: type = converted %int.make_type_32, %.loc14_17.1 [template = i32] // CHECK:STDOUT: %N.loc14_13.1: i32 = param N // CHECK:STDOUT: @Symbolic.%N: i32 = bind_symbolic_name N 0, %N.loc14_13.1 [symbolic = constants.%N] -// CHECK:STDOUT: %Int.ref.loc14_25: %Int.type = name_ref Int, %import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref.loc14_25: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc14_29: i32 = name_ref N, @Symbolic.%N [symbolic = constants.%N] // CHECK:STDOUT: %int.make_type_signed.loc14_28: init type = call %Int.ref.loc14_25(%N.ref.loc14_29) [symbolic = constants.%.6] // CHECK:STDOUT: %.loc14_30.1: type = value_of_initializer %int.make_type_signed.loc14_28 [symbolic = constants.%.6] // CHECK:STDOUT: %.loc14_30.2: type = converted %int.make_type_signed.loc14_28, %.loc14_30.1 [symbolic = constants.%.6] // CHECK:STDOUT: %x.loc14_22.1: %.6 = param x // CHECK:STDOUT: @Symbolic.%x: %.6 = bind_name x, %x.loc14_22.1 -// CHECK:STDOUT: %Int.ref.loc14_36: %Int.type = name_ref Int, %import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref.loc14_36: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %N.ref.loc14_40: i32 = name_ref N, @Symbolic.%N [symbolic = constants.%N] // CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_36(%N.ref.loc14_40) [symbolic = constants.%.6] // CHECK:STDOUT: %.loc14_41.1: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = constants.%.6] @@ -220,17 +226,20 @@ var m: Int(1000000000); // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int.type = import_ref ir1, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %Int.type = import_ref ir1, inst+15, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, %import_ref [template = constants.%Int] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref [template = constants.%Int] // CHECK:STDOUT: %.loc10_12: i32 = int_literal 0 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc10_12) [template = ] // CHECK:STDOUT: %.loc10_13.1: type = value_of_initializer %int.make_type_signed [template = ] @@ -255,19 +264,22 @@ var m: Int(1000000000); // CHECK:STDOUT: %.3: i32 = int_literal -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref ir1, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = %import_ref.1 +// CHECK:STDOUT: .Int = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Negate = %Negate.decl // CHECK:STDOUT: .n = %n.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref ir1, inst+15, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] @@ -279,7 +291,7 @@ var m: Int(1000000000); // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, %import_ref.1 [template = constants.%Int] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc12_19: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc12_19) [template = constants.%.3] @@ -307,17 +319,20 @@ var m: Int(1000000000); // CHECK:STDOUT: %.2: i32 = int_literal 1000000000 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int.type = import_ref ir1, inst+15, loaded [template = constants.%Int] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = %import_ref +// CHECK:STDOUT: .Int = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .m = %m // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %Int.type = import_ref ir1, inst+15, loaded [template = constants.%Int] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, %import_ref [template = constants.%Int] +// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref [template = constants.%Int] // CHECK:STDOUT: %.loc9_12: i32 = int_literal 1000000000 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc9_12) [template = ] // CHECK:STDOUT: %.loc9_22.1: type = value_of_initializer %int.make_type_signed [template = ] diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index 9b2431258eb6..76bf25226e66 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -79,6 +79,10 @@ var m: UInt(1000000000); // CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -86,7 +90,6 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %UInt.decl: %UInt.type = fn_decl @UInt [template = constants.%UInt] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_12.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -123,9 +126,14 @@ var m: UInt(1000000000); // CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref ir1, inst+15, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = %import_ref.1 +// CHECK:STDOUT: .UInt = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .G = %G.decl @@ -133,17 +141,16 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref ir1, inst+15, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, %import_ref.1 [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_unsigned.loc6_13: init type = call %UInt.ref.loc6_9(%.loc6_14) [template = constants.%.3] // CHECK:STDOUT: %.loc6_16.1: type = value_of_initializer %int.make_type_unsigned.loc6_13 [template = constants.%.3] // CHECK:STDOUT: %.loc6_16.2: type = converted %int.make_type_unsigned.loc6_13, %.loc6_16.1 [template = constants.%.3] // CHECK:STDOUT: %n.loc6_6.1: %.3 = param n // CHECK:STDOUT: @F.%n: %.3 = bind_name n, %n.loc6_6.1 -// CHECK:STDOUT: %UInt.ref.loc6_22: %UInt.type = name_ref UInt, %import_ref.1 [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref.loc6_22: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc6_27: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_unsigned.loc6_26: init type = call %UInt.ref.loc6_22(%.loc6_27) [template = constants.%.3] // CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %int.make_type_unsigned.loc6_26 [template = constants.%.3] @@ -151,35 +158,34 @@ var m: UInt(1000000000); // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, %import_ref.1 [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc10_14: i32 = int_literal 13 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_unsigned.loc10_13: init type = call %UInt.ref.loc10_9(%.loc10_14) [template = constants.%.5] // CHECK:STDOUT: %.loc10_16.1: type = value_of_initializer %int.make_type_unsigned.loc10_13 [template = constants.%.5] // CHECK:STDOUT: %.loc10_16.2: type = converted %int.make_type_unsigned.loc10_13, %.loc10_16.1 [template = constants.%.5] // CHECK:STDOUT: %n.loc10_6.1: %.5 = param n // CHECK:STDOUT: @G.%n: %.5 = bind_name n, %n.loc10_6.1 -// CHECK:STDOUT: %UInt.ref.loc10_22: %UInt.type = name_ref UInt, %import_ref.1 [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref.loc10_22: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc10_27: i32 = int_literal 13 [template = constants.%.4] // CHECK:STDOUT: %int.make_type_unsigned.loc10_26: init type = call %UInt.ref.loc10_22(%.loc10_27) [template = constants.%.5] // CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_unsigned.loc10_26 [template = constants.%.5] // CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_unsigned.loc10_26, %.loc10_29.1 [template = constants.%.5] // CHECK:STDOUT: @G.%return: ref %.5 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_17.2: type = converted %int.make_type_32, %.loc14_17.1 [template = i32] // CHECK:STDOUT: %N.loc14_13.1: i32 = param N // CHECK:STDOUT: @Symbolic.%N: i32 = bind_symbolic_name N 0, %N.loc14_13.1 [symbolic = constants.%N] -// CHECK:STDOUT: %UInt.ref.loc14_25: %UInt.type = name_ref UInt, %import_ref.1 [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref.loc14_25: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %N.ref.loc14_30: i32 = name_ref N, @Symbolic.%N [symbolic = constants.%N] // CHECK:STDOUT: %int.make_type_unsigned.loc14_29: init type = call %UInt.ref.loc14_25(%N.ref.loc14_30) [symbolic = constants.%.6] // CHECK:STDOUT: %.loc14_31.1: type = value_of_initializer %int.make_type_unsigned.loc14_29 [symbolic = constants.%.6] // CHECK:STDOUT: %.loc14_31.2: type = converted %int.make_type_unsigned.loc14_29, %.loc14_31.1 [symbolic = constants.%.6] // CHECK:STDOUT: %x.loc14_22.1: %.6 = param x // CHECK:STDOUT: @Symbolic.%x: %.6 = bind_name x, %x.loc14_22.1 -// CHECK:STDOUT: %UInt.ref.loc14_37: %UInt.type = name_ref UInt, %import_ref.1 [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref.loc14_37: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %N.ref.loc14_42: i32 = name_ref N, @Symbolic.%N [symbolic = constants.%N] // CHECK:STDOUT: %int.make_type_unsigned.loc14_41: init type = call %UInt.ref.loc14_37(%N.ref.loc14_42) [symbolic = constants.%.6] // CHECK:STDOUT: %.loc14_43.1: type = value_of_initializer %int.make_type_unsigned.loc14_41 [symbolic = constants.%.6] @@ -220,17 +226,20 @@ var m: UInt(1000000000); // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref ir1, inst+15, loaded [template = constants.%UInt] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = %import_ref +// CHECK:STDOUT: .UInt = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .n = %n // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %UInt.type = import_ref ir1, inst+15, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, %import_ref [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref [template = constants.%UInt] // CHECK:STDOUT: %.loc10_13: i32 = int_literal 0 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc10_13) [template = ] // CHECK:STDOUT: %.loc10_14.1: type = value_of_initializer %int.make_type_unsigned [template = ] @@ -255,19 +264,22 @@ var m: UInt(1000000000); // CHECK:STDOUT: %.3: i32 = int_literal -1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref ir1, inst+15, loaded [template = constants.%UInt] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = %import_ref.1 +// CHECK:STDOUT: .UInt = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Negate = %Negate.decl // CHECK:STDOUT: .n = %n.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref ir1, inst+15, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] @@ -279,7 +291,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, %import_ref.1 [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %.loc12_20: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc12_20) [template = constants.%.3] @@ -307,17 +319,20 @@ var m: UInt(1000000000); // CHECK:STDOUT: %.2: i32 = int_literal 1000000000 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref ir1, inst+15, loaded [template = constants.%UInt] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = %import_ref +// CHECK:STDOUT: .UInt = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .m = %m // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %UInt.type = import_ref ir1, inst+15, loaded [template = constants.%UInt] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, %import_ref [template = constants.%UInt] +// CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref [template = constants.%UInt] // CHECK:STDOUT: %.loc9_13: i32 = int_literal 1000000000 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc9_13) [template = ] // CHECK:STDOUT: %.loc9_23.1: type = value_of_initializer %int.make_type_unsigned [template = ] diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index 406e2587d004..a554f9392853 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -48,6 +48,15 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -59,9 +68,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -88,9 +94,6 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: %false_.loc7_19.1: %False = param false_ // CHECK:STDOUT: @F.%false_: %False = bind_name false_, %false_.loc7_19.1 // CHECK:STDOUT: } -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc12_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_19.1: type = value_of_initializer %int.make_type_32.loc12_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index 2d935e3c04e5..00ff3d00f71e 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -36,6 +36,17 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -46,9 +57,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] { // CHECK:STDOUT: %int.make_type_32.loc2_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_32.loc2_10 [template = i32] @@ -65,7 +73,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc2_26.2: type = converted %int.make_type_32.loc2_26, %.loc2_26.1 [template = i32] // CHECK:STDOUT: @Or.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, %Or.decl [template = constants.%Or] // CHECK:STDOUT: %.loc4_19: i32 = int_literal 12 [template = constants.%.2] @@ -76,16 +83,12 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc4_26: type = array_type %int.or, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 14 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_20: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_21: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index be6e30acc4c7..f7a70abb85bb 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -81,6 +81,17 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -91,9 +102,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] @@ -110,7 +118,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc2_34.2: type = converted %int.make_type_32.loc2_34, %.loc2_34.1 [template = i32] // CHECK:STDOUT: @RightShift.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %RightShift.ref: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] // CHECK:STDOUT: %.loc4_27: i32 = int_literal 22 [template = constants.%.2] @@ -121,16 +128,12 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc4_33: type = array_type %int.right_shift, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 5 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -195,6 +198,18 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.12: type = ptr_type %.11 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -207,9 +222,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %int.make_type_32.loc6_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_18.1: type = value_of_initializer %int.make_type_32.loc6_18 [template = i32] @@ -226,8 +238,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc6_34.2: type = converted %int.make_type_32.loc6_34, %.loc6_34.1 [template = i32] // CHECK:STDOUT: @RightShift.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc7_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_14.1: type = value_of_initializer %int.make_type_32.loc7_14 [template = i32] @@ -239,7 +249,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc7_22.2: type = converted %int.make_type_32.loc7_22, %.loc7_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref.loc10_17: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %RightShift.ref.loc10: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] @@ -258,14 +267,12 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc10_49: type = array_type %int.snegate.loc10_23, i32 [template = constants.%.4] // CHECK:STDOUT: %arr1.var: ref %.4 = var arr1 // CHECK:STDOUT: %arr1: ref %.4 = bind_name arr1, %arr1.var -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11, %.loc11_14.1 [template = i32] // CHECK:STDOUT: %.loc11_20: type = array_type %.loc11_19, i32 [template = constants.%.4] // CHECK:STDOUT: %.loc11_21: type = ptr_type %.4 [template = constants.%.5] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref.loc14_17: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %RightShift.ref.loc14: %RightShift.type = name_ref RightShift, %RightShift.decl [template = constants.%RightShift] @@ -284,7 +291,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc14_50: type = array_type %int.snegate.loc14_23, i32 [template = constants.%.11] // CHECK:STDOUT: %arr2.var: ref %.11 = var arr2 // CHECK:STDOUT: %arr2: ref %.11 = bind_name arr2, %arr2.var -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_19: i32 = int_literal 3 [template = constants.%.10] // CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] @@ -328,6 +334,18 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.7: i32 = int_literal -1 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -340,9 +358,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %int.make_type_32.loc4_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_18.1: type = value_of_initializer %int.make_type_32.loc4_18 [template = i32] @@ -359,8 +374,6 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc4_34.2: type = converted %int.make_type_32.loc4_34, %.loc4_34.1 [template = i32] // CHECK:STDOUT: @RightShift.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc5_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_14.1: type = value_of_initializer %int.make_type_32.loc5_14 [template = i32] @@ -372,19 +385,15 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_13.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_13.2: type = converted %int.make_type_32.loc18, %.loc18_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc24: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_15.1: type = value_of_initializer %int.make_type_32.loc24 [template = i32] // CHECK:STDOUT: %.loc24_15.2: type = converted %int.make_type_32.loc24, %.loc24_15.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 8e83d5cda00d..14358a49b2f6 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -106,6 +106,17 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -116,9 +127,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -135,7 +143,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Add.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 1 [template = constants.%.2] @@ -146,16 +153,12 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc4_25: type = array_type %int.sadd, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 3 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -224,6 +227,34 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.25: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -241,8 +272,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %int.make_type_32.loc8_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_32.loc8_14 [template = i32] @@ -254,10 +283,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc8_22.2: type = converted %int.make_type_32.loc8_22, %.loc8_22.1 [template = i32] // CHECK:STDOUT: @TooFew.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] @@ -279,9 +304,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc13_39.2: type = converted %int.make_type_32.loc13_39, %.loc13_39.1 [template = i32] // CHECK:STDOUT: @TooMany.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %int.make_type_32.loc18_21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18_21 [template = i32] @@ -298,9 +320,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type.loc18, %.loc18_37.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] @@ -317,14 +336,12 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc19_33.2: type = converted %int.make_type_32.loc19_33, %.loc19_33.1 [template = i32] // CHECK:STDOUT: @JustRight.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %.loc25: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%.loc25) // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %.loc30_29: i32 = int_literal 1 [template = constants.%.2] @@ -333,7 +350,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29, %.loc30_32, %.loc30_35) // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %.loc35_42: i32 = int_literal 1 [template = constants.%.2] @@ -341,7 +357,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42, %.loc35_45) // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] // CHECK:STDOUT: %.loc44_31: i32 = int_literal 1 [template = constants.%.2] @@ -353,8 +368,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc44_39: type = array_type %int.sadd, i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] @@ -366,10 +379,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %int.make_type_32.loc50_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc50_26.1: type = value_of_initializer %int.make_type_32.loc50_26 [template = i32] @@ -391,9 +400,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc50_50.2: type = converted %int.make_type_32.loc50_50, %.loc50_50.1 [template = i32] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.25: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %int.make_type_32.loc54_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc54_32.1: type = value_of_initializer %int.make_type_32.loc54_32 [template = i32] @@ -471,6 +477,14 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.5: i32 = int_literal -2147483648 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -480,9 +494,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -499,11 +510,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Add.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32.loc10, %.loc10_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index 5581b2ea363c..594c5b3fbd28 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -74,6 +74,17 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -84,9 +95,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -103,7 +111,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Div.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, %Div.decl [template = constants.%Div] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 3 [template = constants.%.2] @@ -114,16 +121,12 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc4_25: type = array_type %int.sdiv, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -184,6 +187,20 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.6: i32 = int_literal -2147483648 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -196,9 +213,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -215,9 +229,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Div.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] @@ -234,8 +245,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] @@ -247,15 +256,12 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] // CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_8.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] // CHECK:STDOUT: %.loc19_8.2: type = converted %int.make_type_32.loc19, %.loc19_8.1 [template = i32] @@ -337,6 +343,14 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.3: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -346,9 +360,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -365,11 +376,9 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Div.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32.loc10, %.loc10_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index 64b3340cd945..40a315b8b953 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -77,6 +77,17 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -87,9 +98,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -106,7 +114,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Mod.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, %Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 5 [template = constants.%.2] @@ -117,16 +124,12 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc4_25: type = array_type %int.smod, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 2 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -188,6 +191,20 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.7: i32 = int_literal -2147483648 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -200,9 +217,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -219,9 +233,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Mod.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] @@ -238,8 +249,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] @@ -251,15 +260,12 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] // CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_8.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] // CHECK:STDOUT: %.loc20_8.2: type = converted %int.make_type_32.loc20, %.loc20_8.1 [template = i32] @@ -341,6 +347,14 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.3: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -350,9 +364,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -369,11 +380,9 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Mod.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index da0e26a0d435..bbba63348a19 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -48,6 +48,17 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -58,9 +69,6 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -77,7 +85,6 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Mul.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, %Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 3 [template = constants.%.2] @@ -88,16 +95,12 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc4_25: type = array_type %int.smul, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 6 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -154,6 +157,14 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.6: i32 = int_literal -2147483648 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -163,9 +174,6 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -182,11 +190,9 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Mul.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32.loc10, %.loc10_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index e0699a9762d5..1704024e5ac3 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -134,6 +134,17 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -145,8 +156,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] @@ -158,7 +167,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_32.loc2_22, %.loc2_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] @@ -172,20 +180,15 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc4_35: type = array_type %int.snegate.loc4_22, i32 [template = constants.%.4] // CHECK:STDOUT: %arr.var: ref %.4 = var arr // CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 123 [template = constants.%.2] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18, i32 [template = constants.%.4] // CHECK:STDOUT: %.loc5_22: type = ptr_type %.4 [template = constants.%.5] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc9_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_32.loc9_19 [template = i32] @@ -258,6 +261,30 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -275,16 +302,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_32.loc8, %.loc8_16.1 [template = i32] // CHECK:STDOUT: @TooFew.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] @@ -301,8 +324,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] // CHECK:STDOUT: @TooMany.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] @@ -314,8 +335,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type.loc18, %.loc18_29.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] @@ -327,13 +346,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] // CHECK:STDOUT: @JustRight.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref() // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %.loc30_29: i32 = int_literal 1 [template = constants.%.2] @@ -341,14 +358,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29, %.loc30_32) // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %.loc35: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35) // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] // CHECK:STDOUT: %.loc44_31: i32 = int_literal 1 [template = constants.%.2] @@ -359,8 +374,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc44_36: type = array_type %int.snegate, i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] @@ -372,10 +385,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %int.make_type_32.loc57_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_26.1: type = value_of_initializer %int.make_type_32.loc57_26 [template = i32] @@ -397,9 +406,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc57_50.2: type = converted %int.make_type_32.loc57_50, %.loc57_50.1 [template = i32] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %int.make_type_32.loc68_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc68_32.1: type = value_of_initializer %int.make_type_32.loc68_32 [template = i32] @@ -479,6 +485,16 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.5: i32 = int_literal -2147483648 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -489,8 +505,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc4_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4_14 [template = i32] @@ -502,9 +516,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_32.loc4_22, %.loc4_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] @@ -521,11 +532,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_32.loc14, %.loc14_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index b1946b9e3e95..8b761758dd35 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -49,6 +49,17 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -59,9 +70,6 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -78,7 +86,6 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, %Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 3 [template = constants.%.2] @@ -89,16 +96,12 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc4_25: type = array_type %int.ssub, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -156,6 +159,15 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.7: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -166,9 +178,6 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -185,15 +194,12 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index f7ad690f53dc..281fa79b7485 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -103,6 +103,17 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -113,9 +124,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -132,7 +140,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Add.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 1 [template = constants.%.2] @@ -143,16 +150,12 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc4_25: type = array_type %int.uadd, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 3 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -221,6 +224,34 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.25: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -238,8 +269,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %int.make_type_32.loc8_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_32.loc8_14 [template = i32] @@ -251,10 +280,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc8_22.2: type = converted %int.make_type_32.loc8_22, %.loc8_22.1 [template = i32] // CHECK:STDOUT: @TooFew.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] @@ -276,9 +301,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc13_39.2: type = converted %int.make_type_32.loc13_39, %.loc13_39.1 [template = i32] // CHECK:STDOUT: @TooMany.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %int.make_type_32.loc18_21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18_21 [template = i32] @@ -295,9 +317,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type.loc18, %.loc18_37.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] @@ -314,14 +333,12 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc19_33.2: type = converted %int.make_type_32.loc19_33, %.loc19_33.1 [template = i32] // CHECK:STDOUT: @JustRight.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %.loc25: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref(%.loc25) // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %.loc30_29: i32 = int_literal 1 [template = constants.%.2] @@ -330,7 +347,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29, %.loc30_32, %.loc30_35) // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %.loc35_42: i32 = int_literal 1 [template = constants.%.2] @@ -338,7 +354,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35_42, %.loc35_45) // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc43: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] // CHECK:STDOUT: %.loc43_31: i32 = int_literal 1 [template = constants.%.2] @@ -350,8 +365,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc43_39: type = array_type %int.uadd, i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %int.make_type_32.loc45_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc45_25.1: type = value_of_initializer %int.make_type_32.loc45_25 [template = i32] @@ -363,10 +376,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc45_33.2: type = converted %int.make_type_32.loc45_33, %.loc45_33.1 [template = i32] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %int.make_type_32.loc49_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc49_26.1: type = value_of_initializer %int.make_type_32.loc49_26 [template = i32] @@ -388,9 +397,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc49_50.2: type = converted %int.make_type_32.loc49_50, %.loc49_50.1 [template = i32] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.25: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %int.make_type_32.loc53_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc53_32.1: type = value_of_initializer %int.make_type_32.loc53_32 [template = i32] @@ -468,6 +474,14 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.5: i32 = int_literal -2147483648 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -477,9 +491,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -496,11 +507,9 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Add.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 3346dd667804..ff6dfdb0fa7f 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -70,6 +70,17 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -80,9 +91,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -99,7 +107,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Div.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, %Div.decl [template = constants.%Div] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 3 [template = constants.%.2] @@ -110,16 +117,12 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc4_25: type = array_type %int.udiv, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -181,6 +184,20 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.7: i32 = int_literal -2147483648 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -193,9 +210,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -212,9 +226,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Div.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] @@ -231,8 +242,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] @@ -244,15 +253,12 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] // CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] @@ -334,6 +340,14 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.3: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -343,9 +357,6 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -362,11 +373,9 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Div.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32] // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32.loc10, %.loc10_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 77f7d8f9763d..a74b44c2902b 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -72,6 +72,17 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -82,9 +93,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -101,7 +109,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Mod.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Mod.ref: %Mod.type = name_ref Mod, %Mod.decl [template = constants.%Mod] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 5 [template = constants.%.2] @@ -112,16 +119,12 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc4_25: type = array_type %int.umod, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 2 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -183,6 +186,20 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.7: i32 = int_literal 0 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -195,9 +212,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -214,9 +228,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Mod.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] @@ -233,8 +244,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] @@ -246,15 +255,12 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc6_22.2: type = converted %int.make_type_32.loc6_22, %.loc6_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] // CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] @@ -336,6 +342,14 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.3: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -345,9 +359,6 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -364,11 +375,9 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Mod.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index 8f5141ace935..6e61dbcbdc76 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -45,6 +45,17 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -55,9 +66,6 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -74,7 +82,6 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Mul.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, %Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 3 [template = constants.%.2] @@ -85,16 +92,12 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc4_25: type = array_type %int.umul, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 6 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -151,6 +154,14 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.6: i32 = int_literal -2147483648 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -160,9 +171,6 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -179,11 +187,9 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Mul.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index a0b57036b7bc..5ccdc604dbdf 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -130,6 +130,17 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -141,8 +152,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] @@ -154,7 +163,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc2_22.2: type = converted %int.make_type_32.loc2_22, %.loc2_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Negate.ref.loc4_16: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %Negate.ref.loc4_23: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate] @@ -168,20 +176,15 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc4_35: type = array_type %int.unegate.loc4_22, i32 [template = constants.%.4] // CHECK:STDOUT: %arr.var: ref %.4 = var arr // CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 123 [template = constants.%.2] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_21: type = array_type %.loc5_18, i32 [template = constants.%.4] // CHECK:STDOUT: %.loc5_22: type = ptr_type %.4 [template = constants.%.5] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc9_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_19.1: type = value_of_initializer %int.make_type_32.loc9_19 [template = i32] @@ -254,6 +257,30 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -271,16 +298,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_16.2: type = converted %int.make_type_32.loc8, %.loc8_16.1 [template = i32] // CHECK:STDOUT: @TooFew.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { // CHECK:STDOUT: %int.make_type_32.loc13_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15.1: type = value_of_initializer %int.make_type_32.loc13_15 [template = i32] @@ -297,8 +320,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc13_31.2: type = converted %int.make_type_32.loc13_31, %.loc13_31.1 [template = i32] // CHECK:STDOUT: @TooMany.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_21.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] @@ -310,8 +331,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type.loc18, %.loc18_29.1 [template = bool] // CHECK:STDOUT: @BadReturnType.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { // CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32] @@ -323,13 +342,11 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] // CHECK:STDOUT: @JustRight.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, %TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %TooFew.call: init i32 = call %TooFew.ref() // CHECK:STDOUT: %too_few.var: ref = var too_few // CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc30: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, %TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %.loc30_29: i32 = int_literal 1 [template = constants.%.2] @@ -337,14 +354,12 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %TooMany.call: init i32 = call %TooMany.ref(%.loc30_29, %.loc30_32) // CHECK:STDOUT: %too_many.var: ref = var too_many // CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc35: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, %BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %.loc35: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%.loc35) // CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type // CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc44: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %JustRight.ref: %JustRight.type = name_ref JustRight, %JustRight.decl [template = constants.%JustRight] // CHECK:STDOUT: %.loc44_31: i32 = int_literal 1 [template = constants.%.2] @@ -355,8 +370,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc44_36: type = array_type %int.unegate, i32 [template = ] // CHECK:STDOUT: %bad_call.var: ref = var bad_call // CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { // CHECK:STDOUT: %int.make_type_32.loc46_25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_25.1: type = value_of_initializer %int.make_type_32.loc46_25 [template = i32] @@ -368,10 +381,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc46_33.2: type = converted %int.make_type_32.loc46_33, %.loc46_33.1 [template = i32] // CHECK:STDOUT: @RuntimeCallTooFew.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { // CHECK:STDOUT: %int.make_type_32.loc57_26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_26.1: type = value_of_initializer %int.make_type_32.loc57_26 [template = i32] @@ -393,9 +402,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc57_50.2: type = converted %int.make_type_32.loc57_50, %.loc57_50.1 [template = i32] // CHECK:STDOUT: @RuntimeCallTooMany.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { // CHECK:STDOUT: %int.make_type_32.loc68_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc68_32.1: type = value_of_initializer %int.make_type_32.loc68_32 [template = i32] @@ -475,6 +481,16 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.5: i32 = int_literal -2147483648 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -485,8 +501,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc4_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4_14 [template = i32] @@ -498,9 +512,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_32.loc4_22, %.loc4_22.1 [template = i32] // CHECK:STDOUT: @Negate.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_11.1: type = value_of_initializer %int.make_type_32.loc5_11 [template = i32] @@ -517,11 +528,9 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: %.loc5_27.2: type = converted %int.make_type_32.loc5_27, %.loc5_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index dea9b260dfbc..d34821516497 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -46,6 +46,17 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -56,9 +67,6 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -75,7 +83,6 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, %Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 3 [template = constants.%.2] @@ -86,16 +93,12 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc4_25: type = array_type %int.usub, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] @@ -153,6 +156,15 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.7: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -163,9 +175,6 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -182,15 +191,12 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32.loc4_27, %.loc4_27.1 [template = i32] // CHECK:STDOUT: @Sub.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index 4b715a69fc9a..1daa2071cc51 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -36,6 +36,17 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -46,9 +57,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Xor.decl: %Xor.type = fn_decl @Xor [template = constants.%Xor] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -65,7 +73,6 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc2_27.2: type = converted %int.make_type_32.loc2_27, %.loc2_27.1 [template = i32] // CHECK:STDOUT: @Xor.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, %Xor.decl [template = constants.%Xor] // CHECK:STDOUT: %.loc4_20: i32 = int_literal 12 [template = constants.%.2] @@ -76,16 +83,12 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: %.loc4_27: type = array_type %int.xor, i32 [template = constants.%.5] // CHECK:STDOUT: %arr.var: ref %.5 = var arr // CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18: i32 = int_literal 6 [template = constants.%.4] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32.loc5, %.loc5_13.1 [template = i32] // CHECK:STDOUT: %.loc5_19: type = array_type %.loc5_18, i32 [template = constants.%.5] // CHECK:STDOUT: %.loc5_20: type = ptr_type %.5 [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/print.carbon b/toolchain/check/testdata/builtins/print.carbon index 642d72a8cfda..2798a56e50cb 100644 --- a/toolchain/check/testdata/builtins/print.carbon +++ b/toolchain/check/testdata/builtins/print.carbon @@ -32,6 +32,11 @@ fn Main() { // CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // 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: %Print.type.2 = import_ref ir1, inst+43, loaded [template = constants.%Print.2] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,7 +45,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Print.decl: %Print.type.1 = fn_decl @Print.1 [template = constants.%Print.1] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -49,7 +53,6 @@ fn Main() { // CHECK:STDOUT: @Print.1.%a: i32 = bind_name a, %a.loc11_10.1 // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref.2: %Print.type.2 = import_ref ir1, inst+43, loaded [template = constants.%Print.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -62,7 +65,7 @@ fn Main() { // CHECK:STDOUT: %.loc14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %print.int.loc14: init %.1 = call %Print.ref.loc14(%.loc14) // CHECK:STDOUT: %Core.ref: = name_ref Core, file.%Core [template = file.%Core] -// CHECK:STDOUT: %Print.ref.loc16: %Print.type.2 = name_ref Print, file.%import_ref.2 [template = constants.%Print.2] +// CHECK:STDOUT: %Print.ref.loc16: %Print.type.2 = name_ref Print, imports.%import_ref.2 [template = constants.%Print.2] // CHECK:STDOUT: %.loc16: i32 = int_literal 2 [template = constants.%.3] // CHECK:STDOUT: %print.int.loc16: init %.1 = call %Print.ref.loc16(%.loc16) // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index b581007dd135..8bb636b5f8d3 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -59,6 +59,13 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %StructAdapter: type = class_type @StructAdapter [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,12 +76,8 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} -// 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: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} // CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @SomeClass { diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index d037b00739a2..8120668dc5e0 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -57,6 +57,13 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %.16: type = ptr_type %.15 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -68,15 +75,11 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %Derived.ref.loc21: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: @Make.%return: ref %Derived = var // CHECK:STDOUT: } -// 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: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { // CHECK:STDOUT: %Derived.ref.loc25: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d.loc25_11.1: %Derived = param d diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index 01757c8a3c06..eb47a09e0bfe 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -48,6 +48,15 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %.12: type = ptr_type %.7 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -58,13 +67,7 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// 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: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} -// 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: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc24_21: type = ptr_type %Derived [template = constants.%.8] diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index dc2c3e8b7690..098814d236d1 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -50,6 +50,10 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %.11: type = ptr_type %.8 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -60,7 +64,6 @@ fn Call(p: Derived*) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Base.ref: type = name_ref Base, %Base.decl [template = constants.%Base] // CHECK:STDOUT: %.loc17_26: type = ptr_type %Base [template = constants.%.3] diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index 46fb049e7113..65a8f4cbee19 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -71,6 +71,15 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %PassDerivedToBaseIndirect: %PassDerivedToBaseIndirect.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -85,10 +94,7 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Derived.decl.loc11: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// 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: %Derived.decl.loc18: type = class_decl @Derived [template = constants.%Derived] {} -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %Derived.ref.loc25: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %a.loc25_9.1: %Derived = param a @@ -98,7 +104,6 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc25_24.2: type = converted %int.make_type_32.loc25, %.loc25_24.1 [template = i32] // CHECK:STDOUT: @Call.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [template = constants.%CallIndirect] { // CHECK:STDOUT: %Derived.ref.loc29: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %.loc29_27: type = ptr_type %Derived [template = constants.%.8] @@ -109,7 +114,6 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc29_33.2: type = converted %int.make_type_32.loc29, %.loc29_33.1 [template = i32] // CHECK:STDOUT: @CallIndirect.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %PassDerivedToBase.decl: %PassDerivedToBase.type = fn_decl @PassDerivedToBase [template = constants.%PassDerivedToBase] { // CHECK:STDOUT: %Derived.ref.loc33: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %a.loc33_22.1: %Derived = param a @@ -119,7 +123,6 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: %.loc33_37.2: type = converted %int.make_type_32.loc33, %.loc33_37.1 [template = i32] // CHECK:STDOUT: @PassDerivedToBase.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %PassDerivedToBaseIndirect.decl: %PassDerivedToBaseIndirect.type = fn_decl @PassDerivedToBaseIndirect [template = constants.%PassDerivedToBaseIndirect] { // CHECK:STDOUT: %Derived.ref.loc37: type = name_ref Derived, %Derived.decl.loc11 [template = constants.%Derived] // CHECK:STDOUT: %.loc37_40: type = ptr_type %Derived [template = constants.%.8] diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index c3ad0ba94607..483e42c5dfdb 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -44,6 +44,17 @@ fn Run() -> i32 { // CHECK:STDOUT: %.4: i32 = int_literal 4 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -53,13 +64,6 @@ fn Run() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc21_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_15.1: type = value_of_initializer %int.make_type_32.loc21_15 [template = i32] @@ -71,7 +75,6 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc21_23.2: type = converted %int.make_type_32.loc21_23, %.loc21_23.1 [template = i32] // CHECK:STDOUT: @G.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc25_13.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index 2fd35a6a5e24..2ed7012dbe2f 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -28,6 +28,11 @@ class C { // CHECK:STDOUT: %.4: type = ptr_type %.3 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -36,8 +41,6 @@ class C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index 1db3376b9e3b..3d10a7c53105 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -66,6 +66,18 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %AccessBaseIndirect: %AccessBaseIndirect.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -79,13 +91,7 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// 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: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} -// 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: %AccessDerived.decl: %AccessDerived.type = fn_decl @AccessDerived [template = constants.%AccessDerived] { // CHECK:STDOUT: %Derived.ref.loc24: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d.loc24_18.1: %Derived = param d @@ -95,7 +101,6 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %.loc24_33.2: type = converted %int.make_type_32.loc24, %.loc24_33.1 [template = i32] // CHECK:STDOUT: @AccessDerived.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessBase.decl: %AccessBase.type = fn_decl @AccessBase [template = constants.%AccessBase] { // CHECK:STDOUT: %Derived.ref.loc28: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d.loc28_15.1: %Derived = param d @@ -105,7 +110,6 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %.loc28_30.2: type = converted %int.make_type_32.loc28, %.loc28_30.1 [template = i32] // CHECK:STDOUT: @AccessBase.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessDerivedIndirect.decl: %AccessDerivedIndirect.type = fn_decl @AccessDerivedIndirect [template = constants.%AccessDerivedIndirect] { // CHECK:STDOUT: %Derived.ref.loc32: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc32_36: type = ptr_type %Derived [template = constants.%.11] @@ -117,7 +121,6 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: %.loc32_45.3: type = ptr_type i32 [template = constants.%.12] // CHECK:STDOUT: @AccessDerivedIndirect.%return: ref %.12 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessBaseIndirect.decl: %AccessBaseIndirect.type = fn_decl @AccessBaseIndirect [template = constants.%AccessBaseIndirect] { // CHECK:STDOUT: %Derived.ref.loc36: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc36_33: type = ptr_type %Derived [template = constants.%.11] diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 4f66d6f72a80..e0fe1f654aab 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -182,6 +182,11 @@ var c: Other.C = {}; // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir8, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir8, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -193,16 +198,14 @@ var c: Other.C = {}; // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir8, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir8, inst+4, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -221,6 +224,10 @@ var c: Other.C = {}; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir8, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -232,8 +239,7 @@ var c: Other.C = {}; // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref: type = import_ref ir8, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref [template = constants.%C] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var // CHECK:STDOUT: } @@ -257,6 +263,12 @@ var c: Other.C = {}; // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir8, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir8, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir9, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -268,17 +280,14 @@ var c: Other.C = {}; // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir8, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir8, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir9, inst+3, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -300,6 +309,12 @@ var c: Other.C = {}; // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir8, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir8, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir9, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -311,17 +326,14 @@ var c: Other.C = {}; // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir8, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir8, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir9, inst+3, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 61c60c6364db..aac7c3195808 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -87,6 +87,12 @@ fn ConvertInit() { // CHECK:STDOUT: %struct.3: %C = struct_value (%struct.2, %.23) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -103,11 +109,8 @@ fn ConvertInit() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %ConvertCToB.decl: %ConvertCToB.type = fn_decl @ConvertCToB [template = constants.%ConvertCToB] { // CHECK:STDOUT: %C.ref.loc25: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc25_20: type = ptr_type %C [template = constants.%.14] diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index 1c5af6b6c8de..ca20287b07cc 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -111,6 +111,11 @@ class StructAdapter { // CHECK:STDOUT: %TestAdapterMethod: %TestAdapterMethod.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -123,8 +128,6 @@ class StructAdapter { // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %SomeClassAdapter.decl.loc4: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} -// 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: %SomeClassAdapter.decl.loc15: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} // CHECK:STDOUT: %TestStaticMemberFunction.decl: %TestStaticMemberFunction.type = fn_decl @TestStaticMemberFunction [template = constants.%TestStaticMemberFunction] { // CHECK:STDOUT: %SomeClassAdapter.ref.loc19: type = name_ref SomeClassAdapter, %SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter] @@ -273,6 +276,12 @@ class StructAdapter { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -283,10 +292,7 @@ class StructAdapter { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} -// 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: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, %SomeClassAdapter.decl [template = constants.%SomeClassAdapter] // CHECK:STDOUT: %a.loc13_6.1: %SomeClassAdapter = param a @@ -344,6 +350,11 @@ class StructAdapter { // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -352,8 +363,6 @@ class StructAdapter { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @StructAdapter { diff --git a/toolchain/check/testdata/class/extern.carbon b/toolchain/check/testdata/class/extern.carbon index 5883af27bd6f..c4a3ede862e7 100644 --- a/toolchain/check/testdata/class/extern.carbon +++ b/toolchain/check/testdata/class/extern.carbon @@ -502,72 +502,87 @@ extern class C; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_extern_decl_then_decl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_decl_then_extern_decl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_extern_decl_then_def.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_ownership_conflict.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+3, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_extern_decl_copy.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -577,6 +592,10 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl @@ -584,7 +603,6 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } @@ -597,6 +615,10 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl @@ -604,7 +626,6 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: type = import_ref ir1, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } @@ -618,6 +639,11 @@ extern class C; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl @@ -625,15 +651,13 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- extern_decl_after_import_def.carbon @@ -643,6 +667,11 @@ extern class C; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl @@ -650,14 +679,12 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index d45c51ec0f74..18e9dc2de1b2 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -59,6 +59,13 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %.16: type = ptr_type %.15 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -70,15 +77,11 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %Derived.ref.loc21: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: @Make.%return: ref %Derived = var // CHECK:STDOUT: } -// 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: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { // CHECK:STDOUT: %Derived.ref.loc29: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %d.loc29_11.1: %Derived = param d diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index 6b0ae2e68106..52af9607260f 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -87,6 +87,10 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %.4: type = unbound_element_type %AdaptWithBase, %Base [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -97,7 +101,6 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %AdaptWithBase.decl: type = class_decl @AdaptWithBase [template = constants.%AdaptWithBase] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { @@ -133,6 +136,15 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %.3: type = unbound_element_type %AdaptWithFields, i32 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -142,13 +154,7 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %AdaptWithField.decl: type = class_decl @AdaptWithField [template = constants.%AdaptWithField] {} -// 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: %AdaptWithFields.decl: type = class_decl @AdaptWithFields [template = constants.%AdaptWithFields] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @AdaptWithField { @@ -207,6 +213,10 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %.5: type = unbound_element_type %AdaptWithBaseAndFields, i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -217,7 +227,6 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %AdaptWithBaseAndFields.decl: type = class_decl @AdaptWithBaseAndFields [template = constants.%AdaptWithBaseAndFields] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index 7fa7a7a0de1f..fa29247d83b8 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -202,6 +202,24 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_NoMember: %AccessMemberWithInvalidBaseFinal_NoMember.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -233,9 +251,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %Core: = namespace %Core.import, [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: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %DeriveFromError.decl: type = class_decl @DeriveFromError [template = constants.%DeriveFromError] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessMemberWithInvalidBaseError.decl: %AccessMemberWithInvalidBaseError.type = fn_decl @AccessMemberWithInvalidBaseError [template = constants.%AccessMemberWithInvalidBaseError] { // CHECK:STDOUT: %DeriveFromError.ref: type = name_ref DeriveFromError, %DeriveFromError.decl [template = constants.%DeriveFromError] // CHECK:STDOUT: %.loc25_55: type = ptr_type %DeriveFromError [template = constants.%.5] @@ -247,7 +263,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: @AccessMemberWithInvalidBaseError.%return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %DeriveFromNonType.decl: type = class_decl @DeriveFromNonType [template = constants.%DeriveFromNonType] {} -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessMemberWithInvalidBasNonType.decl: %AccessMemberWithInvalidBasNonType.type = fn_decl @AccessMemberWithInvalidBasNonType [template = constants.%AccessMemberWithInvalidBasNonType] { // CHECK:STDOUT: %DeriveFromNonType.ref: type = name_ref DeriveFromNonType, %DeriveFromNonType.decl [template = constants.%DeriveFromNonType] // CHECK:STDOUT: %.loc35_58: type = ptr_type %DeriveFromNonType [template = constants.%.7] @@ -259,8 +274,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: @AccessMemberWithInvalidBasNonType.%return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %DeriveFromi32.decl: type = class_decl @DeriveFromi32 [template = constants.%DeriveFromi32] {} -// 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: %ConvertToBadBasei32.decl: %ConvertToBadBasei32.type = fn_decl @ConvertToBadBasei32 [template = constants.%ConvertToBadBasei32] { // CHECK:STDOUT: %DeriveFromi32.ref.loc51: type = name_ref DeriveFromi32, %DeriveFromi32.decl [template = constants.%DeriveFromi32] // CHECK:STDOUT: %.loc51_40: type = ptr_type %DeriveFromi32 [template = constants.%.8] @@ -272,7 +285,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc51_49.3: type = ptr_type i32 [template = constants.%.9] // CHECK:STDOUT: @ConvertToBadBasei32.%return: ref %.9 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessMemberWithInvalidBasei32.decl: %AccessMemberWithInvalidBasei32.type = fn_decl @AccessMemberWithInvalidBasei32 [template = constants.%AccessMemberWithInvalidBasei32] { // CHECK:STDOUT: %DeriveFromi32.ref.loc53: type = name_ref DeriveFromi32, %DeriveFromi32.decl [template = constants.%DeriveFromi32] // CHECK:STDOUT: %.loc53_51: type = ptr_type %DeriveFromi32 [template = constants.%.8] @@ -295,7 +307,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc67_57.2: type = ptr_type %.11 [template = constants.%.15] // CHECK:STDOUT: @ConvertToBadBaseTuple.%return: ref %.15 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessMemberWithInvalidBaseTuple.decl: %AccessMemberWithInvalidBaseTuple.type = fn_decl @AccessMemberWithInvalidBaseTuple [template = constants.%AccessMemberWithInvalidBaseTuple] { // CHECK:STDOUT: %DeriveFromTuple.ref.loc69: type = name_ref DeriveFromTuple, %DeriveFromTuple.decl [template = constants.%DeriveFromTuple] // CHECK:STDOUT: %.loc69_55: type = ptr_type %DeriveFromTuple [template = constants.%.14] @@ -307,10 +318,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: @AccessMemberWithInvalidBaseTuple.%return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %DeriveFromStruct.decl: type = class_decl @DeriveFromStruct [template = constants.%DeriveFromStruct] {} -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %ConvertToBadBaseStruct.decl: %ConvertToBadBaseStruct.type = fn_decl @ConvertToBadBaseStruct [template = constants.%ConvertToBadBaseStruct] { // CHECK:STDOUT: %DeriveFromStruct.ref.loc85: type = name_ref DeriveFromStruct, %DeriveFromStruct.decl [template = constants.%DeriveFromStruct] // CHECK:STDOUT: %.loc85_46: type = ptr_type %DeriveFromStruct [template = constants.%.18] @@ -326,7 +333,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc85_70: type = ptr_type %.16 [template = constants.%.17] // CHECK:STDOUT: @ConvertToBadBaseStruct.%return: ref %.17 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessMemberWithInvalidBaseStruct.decl: %AccessMemberWithInvalidBaseStruct.type = fn_decl @AccessMemberWithInvalidBaseStruct [template = constants.%AccessMemberWithInvalidBaseStruct] { // CHECK:STDOUT: %DeriveFromStruct.ref.loc88: type = name_ref DeriveFromStruct, %DeriveFromStruct.decl [template = constants.%DeriveFromStruct] // CHECK:STDOUT: %.loc88_57: type = ptr_type %DeriveFromStruct [template = constants.%.18] @@ -348,7 +354,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc107_70: type = ptr_type %Incomplete [template = constants.%.20] // CHECK:STDOUT: @ConvertToBadBaseIncomplete.%return: ref %.20 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessMemberWithInvalidBaseIncomplete.decl: %AccessMemberWithInvalidBaseIncomplete.type = fn_decl @AccessMemberWithInvalidBaseIncomplete [template = constants.%AccessMemberWithInvalidBaseIncomplete] { // CHECK:STDOUT: %DeriveFromIncomplete.ref.loc109: type = name_ref DeriveFromIncomplete, %DeriveFromIncomplete.decl [template = constants.%DeriveFromIncomplete] // CHECK:STDOUT: %.loc109_65: type = ptr_type %DeriveFromIncomplete [template = constants.%.19] @@ -369,7 +374,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc120_55: type = ptr_type %Final [template = constants.%.25] // CHECK:STDOUT: @ConvertToBadBaseFinal.%return: ref %.25 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_WithMember.decl: %AccessMemberWithInvalidBaseFinal_WithMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_WithMember [template = constants.%AccessMemberWithInvalidBaseFinal_WithMember] { // CHECK:STDOUT: %DeriveFromFinal.ref.loc124: type = name_ref DeriveFromFinal, %DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %.loc124_66: type = ptr_type %DeriveFromFinal [template = constants.%.24] @@ -380,7 +384,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: %.loc124_72.2: type = converted %int.make_type_32.loc124, %.loc124_72.1 [template = i32] // CHECK:STDOUT: @AccessMemberWithInvalidBaseFinal_WithMember.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AccessMemberWithInvalidBaseFinal_NoMember.decl: %AccessMemberWithInvalidBaseFinal_NoMember.type = fn_decl @AccessMemberWithInvalidBaseFinal_NoMember [template = constants.%AccessMemberWithInvalidBaseFinal_NoMember] { // CHECK:STDOUT: %DeriveFromFinal.ref.loc128: type = name_ref DeriveFromFinal, %DeriveFromFinal.decl [template = constants.%DeriveFromFinal] // CHECK:STDOUT: %.loc128_64: type = ptr_type %DeriveFromFinal [template = constants.%.24] diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 0713bc93e95d..813dbd561bd7 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -41,6 +41,12 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -51,10 +57,7 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} -// 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: %AccessBInA.decl: %AccessBInA.type = fn_decl @AccessBInA [template = constants.%AccessBInA] { // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a.loc19_15.1: %A = param a diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 78aa3d88fa1b..08a981617579 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -64,6 +64,12 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %ConvertIncomplete: %ConvertIncomplete.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -77,11 +83,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A1.decl: type = class_decl @A1 [template = constants.%A1] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %A2.decl: type = class_decl @A2 [template = constants.%A2] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %ConvertUnrelated.decl: %ConvertUnrelated.type = fn_decl @ConvertUnrelated [template = constants.%ConvertUnrelated] { // CHECK:STDOUT: %B2.ref: type = name_ref B2, %B2.decl [template = constants.%B2] // CHECK:STDOUT: %.loc28_26: type = ptr_type %B2 [template = constants.%.9] diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index acb176bd7d51..f02b505544b0 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -47,6 +47,13 @@ class Class { // CHECK:STDOUT: %.5: type = struct_type {.j: i32, .k: i32} [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -55,10 +62,6 @@ class Class { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 8585d07a6764..e3654eddc231 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -50,6 +50,10 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -61,7 +65,6 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = constants.%T] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.4] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc32_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 273cd064aae4..8e124d57ad7f 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -83,28 +83,31 @@ var a: Incomplete; // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%Empty] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+6, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Empty = %import_ref.1 -// CHECK:STDOUT: .Incomplete = %import_ref.2 +// CHECK:STDOUT: .Empty = imports.%import_ref.1 +// CHECK:STDOUT: .Incomplete = imports.%import_ref.2 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%Empty] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+6, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+4, unloaded // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.2] {} -// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, %import_ref.2 [template = constants.%Incomplete] +// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.2 [template = constants.%Incomplete] // CHECK:STDOUT: %a.var: ref = var a // CHECK:STDOUT: %a: ref = bind_name a, %a.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index b5411fc1d13c..5e52700e5551 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -168,6 +168,11 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: %CallReturnIncomplete: %CallReturnIncomplete.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -196,7 +201,6 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: %Class.ref.loc49: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: @ConvertFromStruct.%return: ref %Class = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Class.ref.loc51: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc51_14: type = ptr_type %Class [template = constants.%.4] @@ -207,7 +211,6 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: %.loc51_20.2: type = converted %int.make_type_32.loc51, %.loc51_20.1 [template = i32] // CHECK:STDOUT: @G.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %MemberAccess.decl: %MemberAccess.type = fn_decl @MemberAccess [template = constants.%MemberAccess] { // CHECK:STDOUT: %Class.ref.loc62: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc62_25: type = ptr_type %Class [template = constants.%.4] diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 46a0f3b0e5c2..019d1347b33d 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -50,6 +50,11 @@ fn F() { // CHECK:STDOUT: %.10: type = struct_type {.a: i32, .b: i32, .c: i32} [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -59,8 +64,6 @@ fn F() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 3b7cdf7d827a..30e297da45ec 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -46,6 +46,11 @@ fn F() { // CHECK:STDOUT: %struct: %Class = struct_value (%.6, %.7) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -56,8 +61,6 @@ fn F() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc16: type = ptr_type %Class [template = constants.%.4] diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 154f077b358c..ba32dd68df56 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -39,6 +39,10 @@ fn T.F() {} // CHECK:STDOUT: %.3: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -48,7 +52,6 @@ fn T.F() {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index bf10ee37e6e5..b98ab4c088dc 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -36,6 +36,11 @@ fn G() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -45,8 +50,6 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/class/fail_todo_modifiers.carbon b/toolchain/check/testdata/class/fail_todo_modifiers.carbon index 35361caa8777..aeb970659d6a 100644 --- a/toolchain/check/testdata/class/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_todo_modifiers.carbon @@ -82,6 +82,11 @@ abstract class Abstract { // CHECK:STDOUT: %L: %L.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -92,8 +97,6 @@ abstract class Abstract { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Access.decl: type = class_decl @Access [template = constants.%Access] {} -// 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: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 5edc095b0af1..b3b343cffd84 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -41,6 +41,12 @@ fn G() -> i32 { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -50,9 +56,6 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index aa4cfd853ef1..0381e5e0de06 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -34,6 +34,11 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: %.4: type = ptr_type %.3 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,8 +48,6 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.loc15_6.1: %Class = param c diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index f9a224b70d3e..0b55477035ad 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -37,6 +37,13 @@ fn Run() { // CHECK:STDOUT: %.6: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -46,11 +53,7 @@ fn Run() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index b1aa532de3f2..9faae685ef13 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -38,6 +38,13 @@ fn Test() { // CHECK:STDOUT: %.6: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -47,11 +54,7 @@ fn Test() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index faa526f2ce51..e3a7b90e8d5f 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -83,6 +83,11 @@ var a: Class(5, i32*); // CHECK:STDOUT: %Class.4: type = class_type @Class, (%.1, %.6) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -92,7 +97,6 @@ var a: Class(5, i32*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = constants.%T] @@ -103,7 +107,6 @@ var a: Class(5, i32*); // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N 1, %N.loc4_23.1 [symbolic = constants.%N] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref.loc6: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_17.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_17.2: type = converted %int.make_type_32.loc6, %.loc6_17.1 [template = i32] @@ -148,6 +151,11 @@ var a: Class(5, i32*); // CHECK:STDOUT: %.3: type = ptr_type i32 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -156,7 +164,6 @@ var a: Class(5, i32*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = constants.%T] @@ -167,7 +174,6 @@ var a: Class(5, i32*); // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N 1, %N.loc4_23.1 [symbolic = constants.%N] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13, %.loc13_17.1 [template = i32] @@ -204,6 +210,11 @@ var a: Class(5, i32*); // CHECK:STDOUT: %.5: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -212,7 +223,6 @@ var a: Class(5, i32*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = constants.%T] @@ -223,7 +233,6 @@ var a: Class(5, i32*); // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N 1, %N.loc4_23.1 [symbolic = constants.%N] // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13, %.loc13_17.1 [template = i32] @@ -261,6 +270,11 @@ var a: Class(5, i32*); // CHECK:STDOUT: %.4: type = ptr_type i32 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -269,7 +283,6 @@ var a: Class(5, i32*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = constants.%T] @@ -281,7 +294,6 @@ var a: Class(5, i32*); // CHECK:STDOUT: } // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1] // CHECK:STDOUT: %.loc12_14: i32 = int_literal 5 [template = constants.%.3] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_32.loc12, %.loc12_20.1 [template = i32] diff --git a/toolchain/check/testdata/class/generic/fail_todo_use.carbon b/toolchain/check/testdata/class/generic/fail_todo_use.carbon index 70f93addbfd8..aecc6b5a7524 100644 --- a/toolchain/check/testdata/class/generic/fail_todo_use.carbon +++ b/toolchain/check/testdata/class/generic/fail_todo_use.carbon @@ -61,6 +61,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %.9: type = ptr_type %Class.3 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -73,14 +78,12 @@ fn Run() -> i32 { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = constants.%T] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc20_13.2: type = converted %int.make_type_32, %.loc20_13.1 [template = i32] // CHECK:STDOUT: @Run.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index e0e74a19cd6f..25d92b5da5a1 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -111,6 +111,12 @@ class Class(U:! type) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -128,9 +134,6 @@ class Class(U:! type) { // CHECK:STDOUT: %T.loc6_21.1: type = param T // CHECK:STDOUT: %T.loc6_21.2: type = bind_symbolic_name T 0, %T.loc6_21.1 [symbolic = constants.%T] // CHECK:STDOUT: } -// 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: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, %CompleteClass.decl [template = constants.%CompleteClass.1] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -200,30 +203,33 @@ class Class(U:! type) { // CHECK:STDOUT: %struct: %CompleteClass.3 = struct_value (%.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref ir0, inst+6, loaded [template = constants.%Class.1] +// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref ir0, inst+13, loaded [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref ir0, inst+51, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4 = import_ref ir0, inst+16, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+26, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir0, inst+34, unloaded +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .CompleteClass = %import_ref.2 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref ir0, inst+6, loaded [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref ir0, inst+13, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref ir0, inst+51, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = constants.%T] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref ir0, inst+16, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+26, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref ir0, inst+34, unloaded -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, %import_ref.2 [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc8_24.2: type = converted %int.make_type_32, %.loc8_24.1 [template = i32] @@ -245,9 +251,9 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class @CompleteClass { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .n = file.%import_ref.5 -// CHECK:STDOUT: .F = file.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .n = imports.%import_ref.5 +// CHECK:STDOUT: .F = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -284,45 +290,48 @@ class Class(U:! type) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = %import_ref.1 -// CHECK:STDOUT: .CompleteClass = %import_ref.2 -// CHECK:STDOUT: .F = %import_ref.3 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Use = %Use.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+6, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref ir1, inst+13, loaded [template = constants.%CompleteClass.1] // CHECK:STDOUT: %import_ref.3: %F.type.1 = import_ref ir1, inst+51, loaded [template = constants.%F.1] -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { -// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32 [template = i32] -// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32, %.loc5_13.1 [template = i32] -// CHECK:STDOUT: @Use.%return: ref i32 = var -// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+16, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+26, unloaded // CHECK:STDOUT: %import_ref.7: %F.type.2 = import_ref ir1, inst+34, loaded [template = constants.%F.2] // CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Class = imports.%import_ref.1 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} +// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { +// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] +// CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32 [template = i32] +// CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32, %.loc5_13.1 [template = i32] +// CHECK:STDOUT: @Use.%return: ref i32 = var +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @CompleteClass { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 -// CHECK:STDOUT: .n = file.%import_ref.6 -// CHECK:STDOUT: .F = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .n = imports.%import_ref.6 +// CHECK:STDOUT: .F = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, file.%import_ref.2 [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_32, %.loc6_23.1 [template = i32] @@ -331,12 +340,12 @@ class Class(U:! type) { // CHECK:STDOUT: %.loc6_27.2: type = converted %.loc6_23.3, %.loc6_27.1 [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var -// CHECK:STDOUT: %F.ref.loc6: %F.type.1 = name_ref F, file.%import_ref.3 [template = constants.%F.1] +// CHECK:STDOUT: %F.ref.loc6: %F.type.1 = name_ref F, imports.%import_ref.3 [template = constants.%F.1] // CHECK:STDOUT: %.loc6_7: ref %CompleteClass.3 = splice_block %v.var {} // CHECK:STDOUT: %F.call.loc6: init %CompleteClass.3 = call %F.ref.loc6() to %.loc6_7 // CHECK:STDOUT: assign %v.var, %F.call.loc6 // CHECK:STDOUT: %v.ref: ref %CompleteClass.3 = name_ref v, %v -// CHECK:STDOUT: %F.ref.loc7: %F.type.2 = name_ref F, file.%import_ref.7 [template = constants.%F.2] +// CHECK:STDOUT: %F.ref.loc7: %F.type.2 = name_ref F, imports.%import_ref.7 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc7: init i32 = call %F.ref.loc7() // CHECK:STDOUT: %.loc7_15.1: i32 = value_of_initializer %F.call.loc7 // CHECK:STDOUT: %.loc7_15.2: i32 = converted %F.call.loc7, %.loc7_15.1 @@ -367,45 +376,48 @@ class Class(U:! type) { // CHECK:STDOUT: %.4: type = unbound_element_type %CompleteClass.2, i32 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+6, unloaded +// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref ir1, inst+13, loaded [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref ir1, inst+51, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+16, unloaded +// CHECK:STDOUT: %import_ref.6: %.4 = import_ref ir1, inst+26, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+34, unloaded +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = %import_ref.1 -// CHECK:STDOUT: .CompleteClass = %import_ref.2 -// CHECK:STDOUT: .F = %import_ref.3 +// CHECK:STDOUT: .Class = imports.%import_ref.1 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Use = %Use.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+6, unloaded -// CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref ir1, inst+13, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref ir1, inst+51, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc5_13.2: type = converted %int.make_type_32, %.loc5_13.1 [template = i32] // CHECK:STDOUT: @Use.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+16, unloaded -// CHECK:STDOUT: %import_ref.6: %.4 = import_ref ir1, inst+26, loaded [template = imports.%.1] -// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+34, unloaded -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @CompleteClass { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 -// CHECK:STDOUT: .n = file.%import_ref.6 -// CHECK:STDOUT: .F = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .n = imports.%import_ref.6 +// CHECK:STDOUT: .F = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() -> i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, file.%import_ref.2 [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_23.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc6_23.2: type = converted %int.make_type_32, %.loc6_23.1 [template = i32] @@ -414,12 +426,12 @@ class Class(U:! type) { // CHECK:STDOUT: %.loc6_27.2: type = converted %.loc6_23.3, %.loc6_27.1 [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.3 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] // CHECK:STDOUT: %.loc6_7: ref %CompleteClass.3 = splice_block %v.var {} // CHECK:STDOUT: %F.call: init %CompleteClass.3 = call %F.ref() to %.loc6_7 // CHECK:STDOUT: assign %v.var, %F.call // CHECK:STDOUT: %v.ref: ref %CompleteClass.3 = name_ref v, %v -// CHECK:STDOUT: %n.ref: %.4 = name_ref n, file.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %n.ref: %.4 = name_ref n, imports.%import_ref.6 [template = imports.%.1] // CHECK:STDOUT: %.loc12: i32 = class_element_access , element0 [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -447,37 +459,40 @@ class Class(U:! type) { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = %import_ref.1 -// CHECK:STDOUT: .CompleteClass = %import_ref.2 -// CHECK:STDOUT: .F = %import_ref.3 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Use = %Use.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+6, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref ir1, inst+13, loaded [template = constants.%CompleteClass.1] // CHECK:STDOUT: %import_ref.3: %F.type = import_ref ir1, inst+51, loaded [template = constants.%F] -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {} // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+16, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+26, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+34, unloaded // CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Class = imports.%import_ref.1 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} +// CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @CompleteClass { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .n = file.%import_ref.5 -// CHECK:STDOUT: .F = file.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .n = imports.%import_ref.5 +// CHECK:STDOUT: .F = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, file.%import_ref.2 [template = constants.%CompleteClass.1] +// CHECK:STDOUT: %CompleteClass.ref: %CompleteClass.type = name_ref CompleteClass, imports.%import_ref.2 [template = constants.%CompleteClass.1] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32, %.loc11_27.1 [template = i32] @@ -487,7 +502,7 @@ class Class(U:! type) { // CHECK:STDOUT: %.loc11_28.2: type = converted %.loc11_23, %.loc11_28.1 [template = constants.%CompleteClass.3] // CHECK:STDOUT: %v.var: ref %CompleteClass.3 = var v // CHECK:STDOUT: %v: ref %CompleteClass.3 = bind_name v, %v.var -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.3 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] // CHECK:STDOUT: %.loc11_33: ref %CompleteClass.4 = temporary_storage // CHECK:STDOUT: %F.call: init %CompleteClass.4 = call %F.ref() to %.loc11_33 // CHECK:STDOUT: assign %v.var, @@ -512,19 +527,22 @@ class Class(U:! type) { // CHECK:STDOUT: %.3: type = class_type @.1, (%U) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref ir0, inst+6, loaded [template = constants.%Class.1] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+13, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir0, inst+51, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = %import_ref.1 -// CHECK:STDOUT: .CompleteClass = %import_ref.2 -// CHECK:STDOUT: .F = %import_ref.3 +// CHECK:STDOUT: .Class = imports.%import_ref.1 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1: %Class.type = import_ref ir0, inst+6, loaded [template = constants.%Class.1] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+13, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir0, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %U.loc9_13.1: type = param U diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 61bdf8051467..f6bc54f3d4cd 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -172,6 +172,10 @@ class E(U:! type) {} // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -179,7 +183,6 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: %B.type = class_decl @B [template = constants.%B.1] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -224,6 +227,10 @@ class E(U:! type) {} // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -235,7 +242,6 @@ class E(U:! type) {} // CHECK:STDOUT: %T.loc4_9.1: type = param T // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = constants.%T] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %T.loc12_9.1: type = param T // CHECK:STDOUT: %T.loc12_9.2: type = bind_symbolic_name T 0, %T.loc12_9.1 [symbolic = constants.%T] @@ -275,6 +281,10 @@ class E(U:! type) {} // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -286,7 +296,6 @@ class E(U:! type) {} // CHECK:STDOUT: %T.loc4_9.1: type = param T // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = constants.%T.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index d2ceb0f77f31..b2af1ac0d788 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -69,6 +69,10 @@ fn Run() { // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -81,7 +85,6 @@ fn Run() { // CHECK:STDOUT: %Core: = namespace %Core.import, [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: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %ForwardDeclared.decl.loc11: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} // CHECK:STDOUT: %ForwardDeclared.decl.loc13: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} @@ -160,26 +163,14 @@ fn Run() { // CHECK:STDOUT: %.10: type = ptr_type %Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Empty = %import_ref.1 -// 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.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%Empty] // CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+6, loaded [template = constants.%Field] // CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+22, loaded [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %import_ref.4: type = import_ref ir1, inst+40, loaded [template = constants.%Incomplete] -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+4, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %import_ref.7: %.7 = import_ref ir1, inst+18, loaded [template = imports.%.1] +// CHECK:STDOUT: %import_ref.7: %.7 = import_ref ir1, inst+18, loaded [template = %.1] // CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+23, unloaded // CHECK:STDOUT: %import_ref.9: %F.type = import_ref ir1, inst+28, loaded [template = constants.%F] // CHECK:STDOUT: %import_ref.10: %G.type = import_ref ir1, inst+37, loaded [template = constants.%G] @@ -188,43 +179,58 @@ fn Run() { // CHECK:STDOUT: %import_ref.13 = import_ref ir1, inst+37, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Empty = imports.%import_ref.1 +// CHECK:STDOUT: .Field = imports.%import_ref.2 +// CHECK:STDOUT: .ForwardDeclared = imports.%import_ref.3 +// CHECK:STDOUT: .Incomplete = imports.%import_ref.4 +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @Empty { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Field { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .x = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .x = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.8 -// CHECK:STDOUT: .F = file.%import_ref.9 -// CHECK:STDOUT: .G = file.%import_ref.10 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .F = imports.%import_ref.9 +// CHECK:STDOUT: .G = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.2 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.11 -// CHECK:STDOUT: .F = file.%import_ref.12 -// CHECK:STDOUT: .G = file.%import_ref.13 +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: .F = imports.%import_ref.12 +// CHECK:STDOUT: .G = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%import_ref.1 [template = constants.%Empty] +// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%import_ref.1 [template = constants.%Empty] // CHECK:STDOUT: %a.var: ref %Empty = var a // CHECK:STDOUT: %a: ref %Empty = bind_name a, %a.var // CHECK:STDOUT: %.loc7_19.1: %.2 = struct_literal () // CHECK:STDOUT: %.loc7_19.2: init %Empty = class_init (), %a.var [template = constants.%struct.1] // CHECK:STDOUT: %.loc7_20: init %Empty = converted %.loc7_19.1, %.loc7_19.2 [template = constants.%struct.1] // CHECK:STDOUT: assign %a.var, %.loc7_20 -// CHECK:STDOUT: %Field.ref: type = name_ref Field, file.%import_ref.2 [template = constants.%Field] +// CHECK:STDOUT: %Field.ref: type = name_ref Field, imports.%import_ref.2 [template = constants.%Field] // CHECK:STDOUT: %b.var: ref %Field = var b // CHECK:STDOUT: %b: ref %Field = bind_name b, %b.var // CHECK:STDOUT: %.loc9_24: i32 = int_literal 1 [template = constants.%.6] @@ -235,11 +241,11 @@ fn Run() { // CHECK:STDOUT: %.loc9_26: init %Field = converted %.loc9_25.1, %.loc9_25.4 [template = constants.%struct.2] // CHECK:STDOUT: assign %b.var, %.loc9_26 // CHECK:STDOUT: %b.ref: ref %Field = name_ref b, %b -// CHECK:STDOUT: %x.ref: %.7 = name_ref x, file.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.7 = name_ref x, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc10_4: ref i32 = class_element_access %b.ref, element0 // CHECK:STDOUT: %.loc10_9: i32 = int_literal 2 [template = constants.%.8] // CHECK:STDOUT: assign %.loc10_4, %.loc10_9 -// CHECK:STDOUT: %ForwardDeclared.ref.loc12: type = name_ref ForwardDeclared, file.%import_ref.3 [template = constants.%ForwardDeclared.1] +// CHECK:STDOUT: %ForwardDeclared.ref.loc12: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %c.var: ref %ForwardDeclared.1 = var c // CHECK:STDOUT: %c: ref %ForwardDeclared.1 = bind_name c, %c.var // CHECK:STDOUT: %.loc12_29.1: %.2 = struct_literal () @@ -247,23 +253,23 @@ fn Run() { // CHECK:STDOUT: %.loc12_30: init %ForwardDeclared.1 = converted %.loc12_29.1, %.loc12_29.2 [template = constants.%struct.3] // CHECK:STDOUT: assign %c.var, %.loc12_30 // CHECK:STDOUT: %c.ref.loc13: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.9 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.9 [template = constants.%F] // CHECK:STDOUT: %.loc13_4: = bound_method %c.ref.loc13, %F.ref // CHECK:STDOUT: %.loc13_3: %ForwardDeclared.1 = bind_value %c.ref.loc13 // CHECK:STDOUT: %F.call: init %.1 = call %.loc13_4(%.loc13_3) // CHECK:STDOUT: %c.ref.loc14: ref %ForwardDeclared.1 = name_ref c, %c -// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%import_ref.10 [template = constants.%G] +// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.10 [template = constants.%G] // CHECK:STDOUT: %.loc14_4: = bound_method %c.ref.loc14, %G.ref // CHECK:STDOUT: %.loc14_3: %.9 = addr_of %c.ref.loc14 // CHECK:STDOUT: %G.call: init %.1 = call %.loc14_4(%.loc14_3) -// CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, file.%import_ref.3 [template = constants.%ForwardDeclared.1] +// CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %.loc16_25: type = ptr_type %ForwardDeclared.1 [template = constants.%.9] // CHECK:STDOUT: %d.var: ref %.9 = var d // CHECK:STDOUT: %d: ref %.9 = bind_name d, %d.var // CHECK:STDOUT: %c.ref.loc16: ref %ForwardDeclared.1 = name_ref c, %c // CHECK:STDOUT: %.loc16_29: %.9 = addr_of %c.ref.loc16 // CHECK:STDOUT: assign %d.var, %.loc16_29 -// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, file.%import_ref.4 [template = constants.%Incomplete] +// CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.4 [template = constants.%Incomplete] // CHECK:STDOUT: %.loc18: type = ptr_type %Incomplete [template = constants.%.10] // CHECK:STDOUT: %e.var: ref %.10 = var e // CHECK:STDOUT: %e: ref %.10 = bind_name e, %e.var diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index ef56c19ac099..39c3de0c19c7 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -55,6 +55,11 @@ fn Run() { // CHECK:STDOUT: %.6: type = struct_type {.base: %Base} [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -64,8 +69,6 @@ fn Run() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// 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: %Child.decl: type = class_decl @Child [template = constants.%Child] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -138,47 +141,50 @@ fn Run() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// 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.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+38, loaded [template = constants.%Child] -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+4, unloaded // CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir1, inst+8, loaded [template = constants.%F] // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6: %.11 = import_ref ir1, inst+27, loaded [template = imports.%.1] +// CHECK:STDOUT: %import_ref.6: %.11 = import_ref ir1, inst+27, loaded [template = %.1] // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+34, unloaded // CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+39, unloaded // CHECK:STDOUT: %import_ref.9 = import_ref ir1, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Base = imports.%import_ref.1 +// CHECK:STDOUT: .Child = imports.%import_ref.2 +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// 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: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .base = imports.%import_ref.9 // CHECK:STDOUT: extend name_scope2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .F = file.%import_ref.4 -// CHECK:STDOUT: .Unused = file.%import_ref.5 -// CHECK:STDOUT: .x = file.%import_ref.6 -// CHECK:STDOUT: .unused = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: .Unused = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: .unused = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Child.ref: type = name_ref Child, file.%import_ref.2 [template = constants.%Child] +// CHECK:STDOUT: %Child.ref: type = name_ref Child, imports.%import_ref.2 [template = constants.%Child] // CHECK:STDOUT: %a.var: ref %Child = var a // CHECK:STDOUT: %a: ref %Child = bind_name a, %a.var // CHECK:STDOUT: %.loc7_33: i32 = int_literal 0 [template = constants.%.8] @@ -196,14 +202,14 @@ fn Run() { // CHECK:STDOUT: %.loc7_49: init %Child = converted %.loc7_48.1, %.loc7_48.4 [template = constants.%struct.2] // CHECK:STDOUT: assign %a.var, %.loc7_49 // CHECK:STDOUT: %a.ref.loc8: ref %Child = name_ref a, %a -// CHECK:STDOUT: %x.ref: %.11 = name_ref x, file.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.11 = name_ref x, imports.%import_ref.6 [template = imports.%.1] // CHECK:STDOUT: %.loc8_4.1: ref %Base = class_element_access %a.ref.loc8, element0 // CHECK:STDOUT: %.loc8_4.2: ref %Base = converted %a.ref.loc8, %.loc8_4.1 // CHECK:STDOUT: %.loc8_4.3: ref i32 = class_element_access %.loc8_4.2, element0 // CHECK:STDOUT: %.loc8_9: i32 = int_literal 2 [template = constants.%.12] // CHECK:STDOUT: assign %.loc8_4.3, %.loc8_9 // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.4 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc9_4: = bound_method %a.ref.loc9, %F.ref // CHECK:STDOUT: %.loc9_6.1: ref %Base = class_element_access %a.ref.loc9, element0 // CHECK:STDOUT: %.loc9_6.2: ref %Base = converted %a.ref.loc9, %.loc9_6.1 diff --git a/toolchain/check/testdata/class/import_forward_decl.carbon b/toolchain/check/testdata/class/import_forward_decl.carbon index 023d21317a62..cc4f7ef5f9c0 100644 --- a/toolchain/check/testdata/class/import_forward_decl.carbon +++ b/toolchain/check/testdata/class/import_forward_decl.carbon @@ -46,6 +46,10 @@ class ForwardDecl { // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+3, loaded [template = constants.%ForwardDecl] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .ForwardDecl = %ForwardDecl.decl @@ -54,7 +58,6 @@ class ForwardDecl { // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+3, loaded [template = constants.%ForwardDecl] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %ForwardDecl.decl: type = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index e63997bee33d..4595e512e888 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -133,9 +133,14 @@ var ptr: E* = &val; // CHECK:STDOUT: %.4: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .D = %D // CHECK:STDOUT: .b_val = %b_val @@ -143,12 +148,10 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %D: type = bind_alias D, %import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %D: type = bind_alias D, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, imports.%import_ref.1 [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: %D.ref: type = name_ref D, %D [template = constants.%C] @@ -159,7 +162,7 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -185,9 +188,14 @@ var ptr: E* = &val; // CHECK:STDOUT: %.4: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .E = %E // CHECK:STDOUT: .c_val = %c_val @@ -195,12 +203,10 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded -// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %E: type = bind_alias E, %import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %E: type = bind_alias E, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, imports.%import_ref.1 [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: %E.ref: type = name_ref E, %E [template = constants.%C] @@ -211,7 +217,7 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -237,28 +243,31 @@ var ptr: E* = &val; // CHECK:STDOUT: %.4: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+10, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+15, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+25, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .D = %import_ref.2 -// CHECK:STDOUT: .b_val = %import_ref.3 -// CHECK:STDOUT: .b_ptr = %import_ref.4 +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .D = imports.%import_ref.2 +// CHECK:STDOUT: .b_val = imports.%import_ref.3 +// CHECK:STDOUT: .b_ptr = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+15, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+25, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+4, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var -// CHECK:STDOUT: %D.ref: type = name_ref D, %import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] // CHECK:STDOUT: %ptr.var: ref %.4 = var ptr // CHECK:STDOUT: %ptr: ref %.4 = bind_name ptr, %ptr.var @@ -266,7 +275,7 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -292,28 +301,31 @@ var ptr: E* = &val; // CHECK:STDOUT: %.4: type = ptr_type %C [template] // 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+25, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .D = %import_ref.1 -// CHECK:STDOUT: .b_val = %import_ref.2 -// CHECK:STDOUT: .b_ptr = %import_ref.3 -// CHECK:STDOUT: .C = %import_ref.4 +// CHECK:STDOUT: .D = imports.%import_ref.1 +// CHECK:STDOUT: .b_val = imports.%import_ref.2 +// CHECK:STDOUT: .b_ptr = imports.%import_ref.3 +// CHECK:STDOUT: .C = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// 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+25, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+4, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.4 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var -// CHECK:STDOUT: %D.ref: type = name_ref D, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] // CHECK:STDOUT: %ptr.var: ref %.4 = var ptr // CHECK:STDOUT: %ptr: ref %.4 = bind_name ptr, %ptr.var @@ -321,7 +333,7 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -347,32 +359,35 @@ var ptr: E* = &val; // CHECK:STDOUT: %.4: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .D = %import_ref.1 -// CHECK:STDOUT: .b_val = %import_ref.2 -// CHECK:STDOUT: .b_ptr = %import_ref.3 -// CHECK:STDOUT: .E = %import_ref.4 -// CHECK:STDOUT: .c_val = %import_ref.5 -// CHECK:STDOUT: .c_ptr = %import_ref.6 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .val = %val -// CHECK:STDOUT: .ptr = %ptr -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// 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+25, unloaded // CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+10, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+15, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+25, unloaded -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+8, unloaded -// CHECK:STDOUT: %D.ref: type = name_ref D, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .D = imports.%import_ref.1 +// CHECK:STDOUT: .b_val = imports.%import_ref.2 +// CHECK:STDOUT: .b_ptr = imports.%import_ref.3 +// CHECK:STDOUT: .E = imports.%import_ref.4 +// CHECK:STDOUT: .c_val = imports.%import_ref.5 +// CHECK:STDOUT: .c_ptr = imports.%import_ref.6 +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .val = %val +// CHECK:STDOUT: .ptr = %ptr +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var -// CHECK:STDOUT: %E.ref: type = name_ref E, %import_ref.4 [template = constants.%C] +// CHECK:STDOUT: %E.ref: type = name_ref E, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] // CHECK:STDOUT: %ptr.var: ref %.4 = var ptr // CHECK:STDOUT: %ptr: ref %.4 = bind_name ptr, %ptr.var @@ -380,7 +395,7 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -406,32 +421,35 @@ var ptr: E* = &val; // CHECK:STDOUT: %.4: type = ptr_type %C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .E = %import_ref.1 -// CHECK:STDOUT: .c_val = %import_ref.2 -// CHECK:STDOUT: .c_ptr = %import_ref.3 -// CHECK:STDOUT: .D = %import_ref.4 -// CHECK:STDOUT: .b_val = %import_ref.5 -// CHECK:STDOUT: .b_ptr = %import_ref.6 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .val = %val -// CHECK:STDOUT: .ptr = %ptr -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// 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+25, unloaded // CHECK:STDOUT: %import_ref.4: type = import_ref ir2, inst+10, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5 = import_ref ir2, inst+15, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+25, unloaded -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+8, unloaded -// CHECK:STDOUT: %D.ref: type = name_ref D, %import_ref.4 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .E = imports.%import_ref.1 +// CHECK:STDOUT: .c_val = imports.%import_ref.2 +// CHECK:STDOUT: .c_ptr = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .b_val = imports.%import_ref.5 +// CHECK:STDOUT: .b_ptr = imports.%import_ref.6 +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .val = %val +// CHECK:STDOUT: .ptr = %ptr +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var -// CHECK:STDOUT: %E.ref: type = name_ref E, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %E.ref: type = name_ref E, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %.loc8: type = ptr_type %C [template = constants.%.4] // CHECK:STDOUT: %ptr.var: ref %.4 = var ptr // CHECK:STDOUT: %ptr: ref %.4 = bind_name ptr, %ptr.var @@ -439,7 +457,7 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index 1c311d3c5f55..d1f213e8b022 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -66,30 +66,33 @@ fn Run() { // CHECK:STDOUT: %.3: type = struct_type {.a: %.2} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%Cycle] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+9, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Cycle = %import_ref.1 +// CHECK:STDOUT: .Cycle = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%Cycle] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .a = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .a = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, file.%import_ref.1 [template = constants.%Cycle] +// CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, imports.%import_ref.1 [template = constants.%Cycle] // CHECK:STDOUT: %.loc7: type = ptr_type %Cycle [template = constants.%.2] // CHECK:STDOUT: %a.var: ref %.2 = var a // CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index f30a6ba34c41..645869dd10da 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -83,38 +83,41 @@ fn Run() { // CHECK:STDOUT: %.6: type = unbound_element_type %Cycle, %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2: ref %.3 = import_ref ir1, inst+13, loaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4: %.6 = import_ref ir1, inst+20, loaded [template = %.1] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Cycle = %import_ref.1 -// CHECK:STDOUT: .a = %import_ref.2 +// CHECK:STDOUT: .Cycle = imports.%import_ref.1 +// CHECK:STDOUT: .a = imports.%import_ref.2 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: ref %.3 = import_ref ir1, inst+13, loaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: %.6 = import_ref ir1, inst+20, loaded [template = imports.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .c = file.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .c = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref.loc7_3: ref %.3 = name_ref a, file.%import_ref.2 +// CHECK:STDOUT: %a.ref.loc7_3: ref %.3 = name_ref a, imports.%import_ref.2 // CHECK:STDOUT: %.loc7_4: ref %.2 = struct_access %a.ref.loc7_3, element0 -// CHECK:STDOUT: %a.ref.loc7_11: ref %.3 = name_ref a, file.%import_ref.2 +// CHECK:STDOUT: %a.ref.loc7_11: ref %.3 = name_ref a, imports.%import_ref.2 // CHECK:STDOUT: %.loc7_12.1: ref %.2 = struct_access %a.ref.loc7_11, element0 // CHECK:STDOUT: %.loc7_12.2: %.2 = bind_value %.loc7_12.1 // CHECK:STDOUT: %.loc7_10: ref %Cycle = deref %.loc7_12.2 -// CHECK:STDOUT: %c.ref: %.6 = name_ref c, file.%import_ref.4 [template = imports.%.1] +// CHECK:STDOUT: %c.ref: %.6 = name_ref c, imports.%import_ref.4 [template = imports.%.1] // CHECK:STDOUT: %.loc7_15: ref %.3 = class_element_access %.loc7_10, element0 // CHECK:STDOUT: %.loc7_17.1: ref %.2 = struct_access %.loc7_15, element0 // CHECK:STDOUT: %.loc7_17.2: %.2 = bind_value %.loc7_17.1 diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 099e0a3f1bd6..14c1c249416c 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -40,6 +40,12 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %.7: type = struct_type {.next: %.3, .n: i32} [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -50,8 +56,6 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_12.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] @@ -65,7 +69,6 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %Class.ref.loc16_34: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: @Make.%return: ref %Class = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %MakeReorder.decl: %MakeReorder.type = fn_decl @MakeReorder [template = constants.%MakeReorder] { // CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_19.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index 6e5cf28fcfc9..4f7941863461 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -99,6 +99,11 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %MakeAdaptC: %MakeAdaptC.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -115,8 +120,6 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// 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: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %AdaptC.ref.loc15: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] @@ -229,6 +232,11 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %MakeAdaptC: %MakeAdaptC.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -245,8 +253,6 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// 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: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %AdaptC.ref.loc21: type = name_ref AdaptC, %AdaptC.decl [template = constants.%AdaptC] diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 211f0ece0883..a2573e3b1aa0 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -34,6 +34,12 @@ fn F() -> i32 { // CHECK:STDOUT: %struct: %Class = struct_value (%.4, %.5) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,9 +49,6 @@ fn F() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %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: %.loc16_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index 17ba0002d7c5..e10ac9e0ea89 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -46,6 +46,11 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: %.9: type = ptr_type %.6 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -57,8 +62,6 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} -// 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: %MakeInner.decl: %MakeInner.type = fn_decl @MakeInner [template = constants.%MakeInner] { // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner.decl [template = constants.%Inner] // CHECK:STDOUT: @MakeInner.%return: ref %Inner = var diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 373792ab0843..62b165346b0f 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -95,6 +95,21 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %CallGOnInitializingExpr: %CallGOnInitializingExpr.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -112,10 +127,6 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc20_12.1: %Class = param self @@ -125,7 +136,6 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc20_29.2: type = converted %int.make_type_32.loc20, %.loc20_29.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %Class.ref.loc24: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.loc24_9.1: %Class = param c @@ -135,7 +145,6 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc24_22.2: type = converted %int.make_type_32.loc24, %.loc24_22.1 [template = i32] // CHECK:STDOUT: @Call.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %CallAlias.decl: %CallAlias.type = fn_decl @CallAlias [template = constants.%CallAlias] { // CHECK:STDOUT: %Class.ref.loc30: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %c.loc30_14.1: %Class = param c @@ -145,21 +154,18 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc30_27.2: type = converted %int.make_type_32.loc30, %.loc30_27.1 [template = i32] // CHECK:STDOUT: @CallAlias.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %CallOnConstBoundMethod.decl: %CallOnConstBoundMethod.type = fn_decl @CallOnConstBoundMethod [template = constants.%CallOnConstBoundMethod] { // CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc34_32.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] // CHECK:STDOUT: %.loc34_32.2: type = converted %int.make_type_32.loc34, %.loc34_32.1 [template = i32] // CHECK:STDOUT: @CallOnConstBoundMethod.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %CallWithAddr.decl: %CallWithAddr.type = fn_decl @CallWithAddr [template = constants.%CallWithAddr] { // CHECK:STDOUT: %int.make_type_32.loc38: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc38_22.1: type = value_of_initializer %int.make_type_32.loc38 [template = i32] // CHECK:STDOUT: %.loc38_22.2: type = converted %int.make_type_32.loc38, %.loc38_22.1 [template = i32] // CHECK:STDOUT: @CallWithAddr.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %CallFThroughPointer.decl: %CallFThroughPointer.type = fn_decl @CallFThroughPointer [template = constants.%CallFThroughPointer] { // CHECK:STDOUT: %Class.ref.loc43: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc43_32: type = ptr_type %Class [template = constants.%.2] @@ -170,7 +176,6 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc43_38.2: type = converted %int.make_type_32.loc43, %.loc43_38.1 [template = i32] // CHECK:STDOUT: @CallFThroughPointer.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %CallGThroughPointer.decl: %CallGThroughPointer.type = fn_decl @CallGThroughPointer [template = constants.%CallGThroughPointer] { // CHECK:STDOUT: %Class.ref.loc47: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %.loc47_32: type = ptr_type %Class [template = constants.%.2] @@ -185,14 +190,12 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Class.ref.loc51: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: @Make.%return: ref %Class = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %CallFOnInitializingExpr.decl: %CallFOnInitializingExpr.type = fn_decl @CallFOnInitializingExpr [template = constants.%CallFOnInitializingExpr] { // CHECK:STDOUT: %int.make_type_32.loc53: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc53_33.1: type = value_of_initializer %int.make_type_32.loc53 [template = i32] // CHECK:STDOUT: %.loc53_33.2: type = converted %int.make_type_32.loc53, %.loc53_33.1 [template = i32] // CHECK:STDOUT: @CallFOnInitializingExpr.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %CallGOnInitializingExpr.decl: %CallGOnInitializingExpr.type = fn_decl @CallGOnInitializingExpr [template = constants.%CallGOnInitializingExpr] { // CHECK:STDOUT: %int.make_type_32.loc57: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc57_33.1: type = value_of_initializer %int.make_type_32.loc57 [template = i32] diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 02d5a973bea1..0a412c46f7ff 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -41,6 +41,11 @@ fn G(o: Outer) { // CHECK:STDOUT: %.6: type = ptr_type %.4 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -51,8 +56,6 @@ fn G(o: Outer) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Outer.ref.loc17: type = name_ref Outer, %Outer.decl [template = constants.%Outer] // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, @Outer.%Inner.decl [template = constants.%Inner] diff --git a/toolchain/check/testdata/class/no_prelude/export_name.carbon b/toolchain/check/testdata/class/no_prelude/export_name.carbon index 07ffb87ca355..69ade4fe2a2d 100644 --- a/toolchain/check/testdata/class/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/class/no_prelude/export_name.carbon @@ -64,19 +64,22 @@ var c: C = {}; // CHECK:STDOUT: %.1: type = struct_type {} [template] // 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+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_export.carbon @@ -89,22 +92,25 @@ var c: C = {}; // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+7, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index b946e441af21..7783d5ce1889 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -108,13 +108,16 @@ class B {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -149,20 +152,23 @@ class B {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+2, unloaded // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- redef_after_def.carbon @@ -192,20 +198,23 @@ class B {} // CHECK:STDOUT: %.2: type = class_type @.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+2, unloaded // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { @@ -239,15 +248,18 @@ class B {} // CHECK:STDOUT: %.2: type = struct_type {} [template] // 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+4, loaded [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .B = %import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref ir0, inst+4, loaded [template = constants.%C] // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 709170b354c1..50efe378cb49 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -199,23 +199,26 @@ private class Redecl {} // CHECK:STDOUT: %struct: %Def = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%Def] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Def [private] = %import_ref.1 +// CHECK:STDOUT: .Def [private] = imports.%import_ref.1 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%Def] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+2, unloaded -// CHECK:STDOUT: %Def.ref: type = name_ref Def, %import_ref.1 [template = constants.%Def] +// CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%import_ref.1 [template = constants.%Def] // CHECK:STDOUT: %c.var: ref %Def = var c // CHECK:STDOUT: %c: ref %Def = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Def { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -286,23 +289,26 @@ private class Redecl {} // CHECK:STDOUT: %struct: %ForwardWithDef = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%ForwardWithDef] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .ForwardWithDef [private] = %import_ref.1 +// CHECK:STDOUT: .ForwardWithDef [private] = imports.%import_ref.1 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%ForwardWithDef] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+2, unloaded -// CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, %import_ref.1 [template = constants.%ForwardWithDef] +// CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%import_ref.1 [template = constants.%ForwardWithDef] // CHECK:STDOUT: %c.var: ref %ForwardWithDef = var c // CHECK:STDOUT: %c: ref %ForwardWithDef = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardWithDef { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -374,6 +380,10 @@ private class Redecl {} // CHECK:STDOUT: %.3: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+1, loaded [template = constants.%Forward] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Forward [private] = %Forward.decl @@ -381,9 +391,8 @@ private class Redecl {} // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+1, loaded [template = constants.%Forward] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Forward.ref: type = name_ref Forward, %import_ref [template = constants.%Forward] +// CHECK:STDOUT: %Forward.ref: type = name_ref Forward, imports.%import_ref [template = constants.%Forward] // CHECK:STDOUT: %.loc4: type = ptr_type %Forward [template = constants.%.1] // CHECK:STDOUT: %c.loc4_6.1: %.1 = param c // CHECK:STDOUT: @F.%c: %.1 = bind_name c, %c.loc4_6.1 diff --git a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon index b3d4e5346020..bc51a1ab827c 100644 --- a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +++ b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon @@ -132,12 +132,15 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- c.carbon @@ -147,31 +150,37 @@ var x: () = D.C.F(); // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .F = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- d.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+8, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- e.carbon @@ -182,21 +191,24 @@ var x: () = D.C.F(); // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @D { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %C: type = bind_alias C, file.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = bind_alias C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%D @@ -205,18 +217,21 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .F = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- f.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .D = %import_ref +// CHECK:STDOUT: .D = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_b.carbon @@ -229,33 +244,36 @@ var x: () = D.C.F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.3: %F.type = import_ref ir2, inst+3, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %x.var: ref %.1 = var x +// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .F = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.3 [template = constants.%F] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return @@ -271,33 +289,36 @@ var x: () = D.C.F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded // CHECK:STDOUT: %import_ref.3: %F.type = import_ref ir1, inst+7, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %x.var: ref %.1 = var x +// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .F = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.3 [template = constants.%F] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return @@ -313,33 +334,36 @@ var x: () = D.C.F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded // CHECK:STDOUT: %import_ref.3: %F.type = import_ref ir2, inst+7, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %x.var: ref %.1 = var x +// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .F = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.3 [template = constants.%F] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return @@ -356,42 +380,45 @@ var x: () = D.C.F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .D = %import_ref.1 -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+3, loaded [template = constants.%D] -// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded // CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+11, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+8, unloaded // CHECK:STDOUT: %import_ref.5: %F.type = import_ref ir1, inst+9, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .D = imports.%import_ref.1 +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %x.var: ref %.1 = var x +// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .C = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .F = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .F = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%import_ref.1 [template = constants.%D] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%import_ref.3 [template = constants.%C] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.5 [template = constants.%F] +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%D] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.3 [template = constants.%C] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.5 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return @@ -408,42 +435,45 @@ var x: () = D.C.F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .D = %import_ref.1 -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+3, loaded [template = constants.%D] -// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () -// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %x.var: ref %.1 = var x -// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+4, unloaded // CHECK:STDOUT: %import_ref.3: type = import_ref ir2, inst+11, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+8, unloaded // CHECK:STDOUT: %import_ref.5: %F.type = import_ref ir2, inst+9, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .D = imports.%import_ref.1 +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () +// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] +// CHECK:STDOUT: %x.var: ref %.1 = var x +// CHECK:STDOUT: %x: ref %.1 = bind_name x, %x.var +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .C = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .F = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .F = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %D.ref: type = name_ref D, file.%import_ref.1 [template = constants.%D] -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%import_ref.3 [template = constants.%C] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.5 [template = constants.%F] +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%D] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.3 [template = constants.%C] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.5 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon index 200cf7ae25e0..922c97f965ca 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon @@ -93,13 +93,16 @@ class D; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl.loc4: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.decl.loc6: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: } @@ -117,13 +120,16 @@ class D; // CHECK:STDOUT: // CHECK:STDOUT: --- use_decl_in_api.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %import_ref +// CHECK:STDOUT: .A = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- decl_only_in_api.carbon @@ -143,13 +149,16 @@ class D; // CHECK:STDOUT: // CHECK:STDOUT: --- decl_only_in_api.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir0, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .B = %import_ref +// CHECK:STDOUT: .B = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref = import_ref ir0, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- decl_in_api_decl_in_impl.carbon @@ -173,13 +182,16 @@ class D; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 39b7668c613b..42b98eb5c1da 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -42,6 +42,18 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %.8: type = ptr_type %.4 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -50,12 +62,6 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc17_27: type = ptr_type %Class [template = constants.%.1] @@ -68,9 +74,6 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %self.loc17_30.1: i32 = param r#self // CHECK:STDOUT: @F.%self.loc17_30: i32 = bind_name r#self, %self.loc17_30.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Self.ref.loc21: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc21_12.1: %Class = param self diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index 40d54925e8ee..8137dd160c83 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -29,6 +29,11 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,8 +43,6 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl.loc11: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Class.decl.loc13: type = class_decl @Class [template = constants.%Class] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc17_12.1: %Class = param self diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index 9c17ba8df7a7..ac47f9edeacc 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -32,6 +32,12 @@ fn Class.F() -> i32 { // CHECK:STDOUT: %.2: type = struct_type {} [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,9 +46,6 @@ fn Class.F() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %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: %.loc16_17.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index 18a8c25e7f8c..a66f16ece7b0 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -33,6 +33,11 @@ class Class { // CHECK:STDOUT: %.3: i32 = int_literal 1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,8 +46,6 @@ class Class { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 8dcf8076c8ce..4216daa94f66 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -88,6 +88,13 @@ class A { // CHECK:STDOUT: %struct.4: %D = struct_value (%.17) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -96,10 +103,6 @@ class A { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 77c734e471ee..8bdfbaa9a07f 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -47,6 +47,14 @@ fn Run() { // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -57,9 +65,6 @@ fn Run() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -67,8 +72,6 @@ fn Run() { // CHECK:STDOUT: @F.2.%return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: class @Class { diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 928f188edf4e..08a7ee811d2f 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -40,6 +40,14 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: %.5: type = ptr_type %.4 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -48,10 +56,6 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc18_12.1: %Class = param self @@ -61,7 +65,6 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: %.loc18_29.2: type = converted %int.make_type_32.loc18, %.loc18_29.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Self.ref.loc22: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %.loc22_27: type = ptr_type %Class [template = constants.%.2] diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index c448b75e5c63..92d3938ddc47 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -58,6 +58,13 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %.11: type = ptr_type %.7 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -68,10 +75,7 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} -// 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: %SelfBase.decl: %SelfBase.type = fn_decl @SelfBase [template = constants.%SelfBase] { // CHECK:STDOUT: %Base.ref.loc22: type = name_ref Base, %Base.decl [template = constants.%Base] // CHECK:STDOUT: %self.loc22_21.1: %Base = param self @@ -88,7 +92,6 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: @AddrSelfBase.%self: %.6 = bind_name self, %self.loc26_30.1 // CHECK:STDOUT: @AddrSelfBase.%.loc26: %.6 = addr_pattern @AddrSelfBase.%self // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] { // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, %Derived.decl [template = constants.%Derived] // CHECK:STDOUT: %.loc30_19: type = ptr_type %Derived [template = constants.%.9] diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 795329f0023c..59568d01b5ca 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -39,6 +39,11 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %.5: type = ptr_type %.4 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -47,8 +52,6 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] // CHECK:STDOUT: %self.loc21_12.1: %Class = param self diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index f48295ab6b6a..a650040063f0 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -32,6 +32,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,8 +46,6 @@ fn Run() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} -// 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: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/const/basic.carbon b/toolchain/check/testdata/const/basic.carbon index 20839d78e367..2a58370cfc25 100644 --- a/toolchain/check/testdata/const/basic.carbon +++ b/toolchain/check/testdata/const/basic.carbon @@ -33,6 +33,13 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %B: %B.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,8 +48,6 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc11_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_15 [template = i32] @@ -60,8 +65,6 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: %.loc11_35: type = ptr_type %.3 [template = constants.%.4] // CHECK:STDOUT: @A.%return: ref %.4 = var // CHECK:STDOUT: } -// 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: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc15_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_32.loc15_16 [template = i32] diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 4fef36d16101..1638a28c80de 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -29,6 +29,11 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -36,8 +41,6 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc15_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15_15 [template = i32] diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index a2166699612c..53a04abf784f 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -34,6 +34,11 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,8 +46,6 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index 05e1b3c13fb4..a9b4e32ea282 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -38,6 +38,12 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -47,7 +53,6 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] @@ -55,14 +60,12 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %.loc4_11.3: type = const_type i32 [template = constants.%.2] // CHECK:STDOUT: @F.%return: ref %.2 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_12.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_12.2: type = converted %int.make_type_32.loc6, %.loc6_12.1 [template = i32] // CHECK:STDOUT: %.loc6_12.3: type = const_type i32 [template = constants.%.2] // CHECK:STDOUT: %a_ref.var: ref %.2 = var a_ref // CHECK:STDOUT: %a_ref: ref %.2 = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_32.loc7, %.loc7_16.1 [template = i32] @@ -97,11 +100,19 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+15, unloaded +// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref ir0, inst+24, loaded +// CHECK:STDOUT: %import_ref.3: ref %.3 = import_ref ir0, inst+36, loaded +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .F = %import_ref.1 -// CHECK:STDOUT: .a_ref = %import_ref.2 -// CHECK:STDOUT: .a_ptr_ref = %import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.1 +// CHECK:STDOUT: .a_ref = imports.%import_ref.2 +// CHECK:STDOUT: .a_ptr_ref = imports.%import_ref.3 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .a_ptr = %a_ptr @@ -109,11 +120,7 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+15, unloaded -// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref ir0, inst+24, loaded -// CHECK:STDOUT: %import_ref.3: ref %.3 = import_ref ir0, inst+36, loaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] @@ -121,7 +128,6 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: %.loc6_17: type = ptr_type %.2 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_12.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_12.2: type = converted %int.make_type_32.loc7, %.loc7_12.1 [template = i32] @@ -135,10 +141,10 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, file.%import_ref.2 +// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, imports.%import_ref.2 // CHECK:STDOUT: %.loc6: %.3 = addr_of %a_ref.ref // CHECK:STDOUT: assign file.%a.var, %.loc6 -// CHECK:STDOUT: %a_ptr_ref.ref: ref %.3 = name_ref a_ptr_ref, file.%import_ref.3 +// CHECK:STDOUT: %a_ptr_ref.ref: ref %.3 = name_ref a_ptr_ref, imports.%import_ref.3 // CHECK:STDOUT: %.loc7: %.3 = bind_value %a_ptr_ref.ref // CHECK:STDOUT: assign file.%a_ptr.var, %.loc7 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index 2ae0b3732b6d..7f0fe06fc7b3 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -52,6 +52,23 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %struct.3: %.22 = struct_value (%.9, %.5) [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -62,9 +79,7 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_18: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_26.1: %.2 = tuple_literal (%int.make_type_32.loc11_18, %int.make_type_32.loc11_23) // CHECK:STDOUT: %.loc11_26.2: type = value_of_initializer %int.make_type_32.loc11_18 [template = i32] @@ -74,27 +89,18 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc11_26.6: type = converted %.loc11_26.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %tuple_copy.var: ref %.3 = var tuple_copy // CHECK:STDOUT: %tuple_copy: ref %.3 = bind_name tuple_copy, %tuple_copy.var -// 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: %int.make_type_32.loc13_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_23.1: type = value_of_initializer %int.make_type_32.loc13_23 [template = i32] // CHECK:STDOUT: %.loc13_23.2: type = converted %int.make_type_32.loc13_23, %.loc13_23.1 [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_32.1: type = value_of_initializer %int.make_type_32.loc13_32 [template = i32] // CHECK:STDOUT: %.loc13_32.2: type = converted %int.make_type_32.loc13_32, %.loc13_32.1 [template = i32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13_41: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_41.1: type = value_of_initializer %int.make_type_32.loc13_41 [template = i32] // CHECK:STDOUT: %.loc13_41.2: type = converted %int.make_type_32.loc13_41, %.loc13_41.1 [template = i32] // CHECK:STDOUT: %.loc13_44: type = struct_type {.a: i32, .b: i32, .c: i32} [template = constants.%.7] // CHECK:STDOUT: %struct_copy.var: ref %.7 = var struct_copy // CHECK:STDOUT: %struct_copy: ref %.7 = bind_name struct_copy, %struct_copy.var -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_24: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %.loc15_19.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] @@ -102,8 +108,6 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc15_25: type = array_type %.loc15_24, i32 [template = constants.%.13] // CHECK:STDOUT: %tuple_index.var: ref %.13 = var tuple_index // CHECK:STDOUT: %tuple_index: ref %.13 = bind_name tuple_index, %tuple_index.var -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_26: i32 = int_literal 1 [template = constants.%.5] // CHECK:STDOUT: %.loc17_21.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] @@ -111,7 +115,6 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: %.loc17_27: type = array_type %.loc17_26, i32 [template = constants.%.13] // CHECK:STDOUT: %struct_access.var: ref %.13 = var struct_access // CHECK:STDOUT: %struct_access: ref %.13 = bind_name struct_access, %struct_access.var -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index 65eaa2c9b5a0..a90bfe82ee31 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -38,6 +38,12 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %array: %.12 = tuple_value (%.7, %.8, %.2, %.9) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -45,7 +51,6 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_24: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -53,8 +58,6 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: %.loc16_25: type = array_type %.loc16_24, i32 [template = constants.%.3] // CHECK:STDOUT: %array_index.var: ref %.3 = var array_index // CHECK:STDOUT: %array_index: ref %.3 = bind_name array_index, %array_index.var -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 69caa11ded47..9404e78ec40c 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -27,6 +27,11 @@ fn G(N:! i32) { // CHECK:STDOUT: %G: %G.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,7 +39,6 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -42,7 +46,6 @@ fn G(N:! i32) { // CHECK:STDOUT: %N.loc12_6.1: i32 = param N // CHECK:STDOUT: @G.%N: i32 = bind_symbolic_name N 0, %N.loc12_6.1 [symbolic = constants.%N] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; 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 c11ebce86f5a..425e1b96d294 100644 --- a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon @@ -38,6 +38,16 @@ fn H() -> i32 { // CHECK:STDOUT: %.5: i32 = int_literal 0 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -47,8 +57,6 @@ fn H() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %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] @@ -60,8 +68,6 @@ fn H() -> i32 { // CHECK:STDOUT: %.loc11_20.6: type = converted %.loc11_20.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc13_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc13_17: init type = call constants.%Int32() [template = i32] @@ -73,9 +79,6 @@ fn H() -> i32 { // CHECK:STDOUT: %.loc13_20.6: type = converted %.loc13_20.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: @G.%return: ref %.3 = var // CHECK:STDOUT: } -// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index ad7e2971968f..4f3596b5d037 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -27,6 +27,13 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %.6: type = ptr_type %.5 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,9 +42,6 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] @@ -54,7 +58,6 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32] // CHECK:STDOUT: @Add.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add] // CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.2] diff --git a/toolchain/check/testdata/function/builtin/definition.carbon b/toolchain/check/testdata/function/builtin/definition.carbon index 896f6da2c3a8..b3af25b76f73 100644 --- a/toolchain/check/testdata/function/builtin/definition.carbon +++ b/toolchain/check/testdata/function/builtin/definition.carbon @@ -20,6 +20,12 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -27,9 +33,6 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index 73b2464b758b..20794ed519cc 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -51,6 +51,27 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %C: %C.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -60,9 +81,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %A.decl.loc11: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -79,9 +97,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11_25, %.loc11_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc11: ref i32 = var // CHECK:STDOUT: } -// 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: %A.decl.loc19: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc19_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_32.loc19_9 [template = i32] @@ -98,9 +113,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32] // CHECK:STDOUT: @A.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl.loc21: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc21_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_9.1: type = value_of_initializer %int.make_type_32.loc21_9 [template = i32] @@ -117,9 +129,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %.loc21_25.2: type = converted %int.make_type_32.loc21_25, %.loc21_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc21: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl.loc29: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc29_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_9.1: type = value_of_initializer %int.make_type_32.loc29_9 [template = i32] @@ -136,9 +145,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %.loc29_25.2: type = converted %int.make_type_32.loc29_25, %.loc29_25.1 [template = i32] // CHECK:STDOUT: @B.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %C.decl.loc31: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %int.make_type_32.loc31_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc31_9.1: type = value_of_initializer %int.make_type_32.loc31_9 [template = i32] @@ -155,9 +161,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %.loc31_25.2: type = converted %int.make_type_32.loc31_25, %.loc31_25.1 [template = i32] // CHECK:STDOUT: %return.var.loc31: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %C.decl.loc38: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %int.make_type_32.loc38_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc38_9.1: type = value_of_initializer %int.make_type_32.loc38_9 [template = i32] diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 57fe62bf786b..a1185bfd48f5 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -41,6 +41,14 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: %.11: type = ptr_type %.10 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -50,17 +58,12 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32.loc15, %.loc15_6.1 [template = i32] // CHECK:STDOUT: %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.1] // CHECK:STDOUT: } -// 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: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_16: i32 = int_literal 1 [template = constants.%.6] // CHECK:STDOUT: %I.ref.loc19: type = name_ref I, %I.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index 4b74975e8285..5d1fc25d82e3 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -102,7 +102,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %.4: i32 = int_literal 1 [template] // CHECK:STDOUT: %.5: i32 = int_literal 2 [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Add, %Op.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, file.%import_ref.8 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %.8: = bound_method %.4, %Op.1 [template] // CHECK:STDOUT: %.9: i32 = int_literal 3 [template] // CHECK:STDOUT: %.10: type = array_type %.9, i32 [template] @@ -115,6 +115,18 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %array: %.10 = tuple_value (%.9, %.12, %.14) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+8, unloaded +// CHECK:STDOUT: %import_ref.4: %.6 = import_ref ir1, inst+28, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref ir1, inst+24, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+24, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref ir1, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -122,24 +134,16 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+6, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+8, unloaded -// CHECK:STDOUT: %import_ref.4: %.6 = import_ref ir1, inst+28, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref ir1, inst+24, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32.loc6, %.loc6_6.1 [template = i32] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.2 [template = constants.%.2] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.2 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.5] -// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+6, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+24, unloaded // CHECK:STDOUT: %.1: %Op.type.2 = interface_witness_access @impl.%.1, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc10_18: = bound_method %.loc10_16, %.1 [template = constants.%.8] // CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18(%.loc10_16, %.loc10_20) [template = constants.%.9] @@ -148,14 +152,13 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.10] // CHECK:STDOUT: %arr.var: ref %.10 = var arr // CHECK:STDOUT: %arr: ref %.10 = bind_name arr, %arr.var -// CHECK:STDOUT: %import_ref.9: type = import_ref ir1, inst+6, loaded [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .Op = file.%import_ref.4 -// CHECK:STDOUT: witness = (file.%import_ref.5) +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Op = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: i32 as %.2 { diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index 6931bdf85014..55d3e8b314d6 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -79,6 +79,11 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: %array: %.5 = tuple_value (%.2, %.3, %.4) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref ir1, inst+20, loaded [template = constants.%TestAdd] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -86,11 +91,9 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref ir1, inst+20, loaded [template = constants.%TestAdd] -// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, %import_ref.2 [template = constants.%TestAdd] +// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.2 [template = constants.%TestAdd] // CHECK:STDOUT: %.loc4_29: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc4_32: i32 = int_literal 2 [template = constants.%.3] // CHECK:STDOUT: %int.sadd: init i32 = call %TestAdd.ref(%.loc4_29, %.loc4_32) [template = constants.%.4] diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index 2001d5df5253..11f5383ac40f 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -27,6 +27,10 @@ fn Run() { // CHECK:STDOUT: %.3: String = string_literal "hello" [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,7 +39,6 @@ fn Run() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 58d73927b9f0..338d1e3a2fd3 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -82,6 +82,12 @@ fn Main() { // CHECK:STDOUT: %.3: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -93,7 +99,6 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Run0.decl: %Run0.type = fn_decl @Run0 [template = constants.%Run0] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Run1.decl: %Run1.type = fn_decl @Run1 [template = constants.%Run1] { // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_12.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] @@ -101,8 +106,6 @@ fn Main() { // CHECK:STDOUT: %a.loc12_9.1: i32 = param a // CHECK:STDOUT: @Run1.%a: i32 = bind_name a, %a.loc12_9.1 // CHECK:STDOUT: } -// 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: %Run2.decl: %Run2.type = fn_decl @Run2 [template = constants.%Run2] { // CHECK:STDOUT: %int.make_type_32.loc13_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32.loc13_12 [template = i32] diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 0ddd8d66e652..843ae67ac8fa 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -33,6 +33,10 @@ fn F() { // CHECK:STDOUT: %.2: f64 = float_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,7 +45,6 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] 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 2bd9b679bbe8..d3d5d194f9dd 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -33,6 +33,11 @@ fn Run() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,7 +46,6 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %.loc11_13.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64] @@ -50,7 +54,6 @@ fn Run() { // CHECK:STDOUT: @Foo.%return: ref f64 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type"; diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 160d9469ed20..647b93cf536b 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -29,6 +29,12 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,8 +43,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] @@ -51,7 +55,6 @@ fn Main() { // CHECK:STDOUT: @Echo.%return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index c404c8f2e7ec..63bc93e40bc5 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -34,6 +34,12 @@ fn Main() { // CHECK:STDOUT: %.6: i32 = int_literal 6 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -42,8 +48,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] @@ -57,7 +61,6 @@ fn Main() { // CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc11_16.1 // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index 189660b9ee43..4b6a36c5de32 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -27,6 +27,10 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,7 +39,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index d51596f03f5e..a93958e1d48b 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -28,6 +28,10 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -36,7 +40,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index 3f0e5b957bf2..66828677303c 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -28,6 +28,11 @@ fn Main() { // CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -36,8 +41,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index cd96682d52b3..c7d599b7a175 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -29,6 +29,11 @@ fn Main() { // CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,8 +42,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] 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 82c09a899a89..49d9d9ab3b72 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -23,6 +23,11 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,8 +35,6 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index 913e46c33004..11dfc35e9a83 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -26,6 +26,11 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,8 +38,6 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc17_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_9.1: type = value_of_initializer %int.make_type_32.loc17_9 [template = i32] diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 41e93cf44e2a..1166f7d447ce 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -388,6 +388,13 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -400,8 +407,6 @@ import library "extern_api"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} -// 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: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32] @@ -413,8 +418,6 @@ import library "extern_api"; // CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32] // CHECK:STDOUT: @B.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: %.2 = tuple_literal (%int.make_type_32.loc6_10) @@ -469,6 +472,13 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -481,8 +491,6 @@ import library "extern_api"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} -// 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: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc5_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_16.1: type = value_of_initializer %int.make_type_32.loc5_16 [template = i32] @@ -494,8 +502,6 @@ import library "extern_api"; // CHECK:STDOUT: %.loc5_24.2: type = converted %int.make_type_32.loc5_24, %.loc5_24.1 [template = i32] // CHECK:STDOUT: @B.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %int.make_type_32.loc6_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_21.1: %.2 = tuple_literal (%int.make_type_32.loc6_17) @@ -551,12 +557,22 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a @@ -567,27 +583,20 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] @@ -618,25 +627,25 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call -// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%import_ref.2 [template = constants.%B] +// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7) // CHECK:STDOUT: assign file.%b.var, %B.call -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%import_ref.3 [template = constants.%C] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc8_25: %.4 = tuple_literal (%.loc8_23) // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc8_23) [template = constants.%tuple] // CHECK:STDOUT: %.loc8_21: %.4 = converted %.loc8_25, %tuple [template = constants.%tuple] // CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc8_21) // CHECK:STDOUT: assign file.%c.var, %C.call -// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%import_ref.4 [template = constants.%D] +// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%d.var, %D.call // CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%import_ref.6 [template = constants.%E] +// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E] // CHECK:STDOUT: %E.call: init %.1 = call %E.ref() // CHECK:STDOUT: assign file.%e.var, %E.call // CHECK:STDOUT: return @@ -665,6 +674,20 @@ import library "extern_api"; // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl @@ -681,19 +704,12 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { // CHECK:STDOUT: .E = %E.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7_16 [template = i32] @@ -705,8 +721,6 @@ import library "extern_api"; // CHECK:STDOUT: %.loc7_24.2: type = converted %int.make_type_32.loc7_24, %.loc7_24.1 [template = i32] // CHECK:STDOUT: %return.var.loc7: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %int.make_type_32.loc8_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_21.1: %.2 = tuple_literal (%int.make_type_32.loc8_17) @@ -727,13 +741,11 @@ import library "extern_api"; // CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b.loc13: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14, %.loc14_13.1 [template = i32] @@ -811,6 +823,20 @@ import library "extern_api"; // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl @@ -827,19 +853,12 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { // CHECK:STDOUT: .E = %E.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7_16 [template = i32] @@ -851,8 +870,6 @@ import library "extern_api"; // CHECK:STDOUT: %.loc7_24.2: type = converted %int.make_type_32.loc7_24, %.loc7_24.1 [template = i32] // CHECK:STDOUT: %return.var.loc7: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %int.make_type_32.loc8_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_21.1: %.2 = tuple_literal (%int.make_type_32.loc8_17) @@ -873,13 +890,11 @@ import library "extern_api"; // CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b.loc13: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14, %.loc14_13.1 [template = i32] @@ -956,12 +971,27 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+22, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+44, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+47, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+51, unloaded +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32] +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a @@ -972,32 +1002,20 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+22, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+44, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+47, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc72_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc73: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc73_8.1: type = value_of_initializer %int.make_type_32.loc73 [template = i32] // CHECK:STDOUT: %.loc73_8.2: type = converted %int.make_type_32.loc73, %.loc73_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc74: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc74_13.1: type = value_of_initializer %int.make_type_32.loc74 [template = i32] // CHECK:STDOUT: %.loc74_13.2: type = converted %int.make_type_32.loc74, %.loc74_13.1 [template = i32] @@ -1028,25 +1046,25 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call -// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%import_ref.2 [template = constants.%B] +// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %.loc73: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc73) // CHECK:STDOUT: assign file.%b.var, %B.call -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%import_ref.3 [template = constants.%C] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %.loc74_23: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc74_25: %.4 = tuple_literal (%.loc74_23) // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc74_23) [template = constants.%tuple] // CHECK:STDOUT: %.loc74_21: %.4 = converted %.loc74_25, %tuple [template = constants.%tuple] // CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc74_21) // CHECK:STDOUT: assign file.%c.var, %C.call -// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%import_ref.4 [template = constants.%D] +// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%d.var, %D.call // CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%import_ref.6 [template = constants.%E] +// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E] // CHECK:STDOUT: %E.call: init %.1 = call %E.ref() // CHECK:STDOUT: assign file.%e.var, %E.call // CHECK:STDOUT: return @@ -1074,12 +1092,27 @@ import library "extern_api"; // CHECK:STDOUT: %E: %E.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+22, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+44, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+47, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+51, unloaded +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32] +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a @@ -1090,32 +1123,20 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E] -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+22, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+44, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+47, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc72_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc73: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc73_8.1: type = value_of_initializer %int.make_type_32.loc73 [template = i32] // CHECK:STDOUT: %.loc73_8.2: type = converted %int.make_type_32.loc73, %.loc73_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc74: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc74_13.1: type = value_of_initializer %int.make_type_32.loc74 [template = i32] // CHECK:STDOUT: %.loc74_13.2: type = converted %int.make_type_32.loc74, %.loc74_13.1 [template = i32] @@ -1146,25 +1167,25 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call -// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%import_ref.2 [template = constants.%B] +// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %.loc73: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc73) // CHECK:STDOUT: assign file.%b.var, %B.call -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%import_ref.3 [template = constants.%C] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %.loc74_23: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc74_25: %.4 = tuple_literal (%.loc74_23) // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc74_23) [template = constants.%tuple] // CHECK:STDOUT: %.loc74_21: %.4 = converted %.loc74_25, %tuple [template = constants.%tuple] // CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc74_21) // CHECK:STDOUT: assign file.%c.var, %C.call -// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%import_ref.4 [template = constants.%D] +// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%d.var, %D.call // CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%import_ref.6 [template = constants.%E] +// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E] // CHECK:STDOUT: %E.call: init %.1 = call %E.ref() // CHECK:STDOUT: assign file.%e.var, %E.call // CHECK:STDOUT: return @@ -1178,27 +1199,30 @@ import library "extern_api"; // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .D = %import_ref.4 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] @@ -1211,7 +1235,7 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: return @@ -1229,33 +1253,36 @@ import library "extern_api"; // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded +// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -1272,7 +1299,7 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: return @@ -1286,27 +1313,30 @@ import library "extern_api"; // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .D = %import_ref.4 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] @@ -1319,7 +1349,7 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call // CHECK:STDOUT: return @@ -1327,81 +1357,90 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: --- unloaded.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- unloaded_extern.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_loaded_merge.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+22, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+44, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+47, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+51, unloaded +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { -// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+50, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .E = imports.%import_ref.5 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+22, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+44, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+47, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon index a95f3674f50d..fc6eaab4f0ad 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon @@ -63,13 +63,16 @@ var f: () = F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .F = %F // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %F: %F.type = export F, %import_ref [template = constants.%F] +// CHECK:STDOUT: %F: %F.type = export F, imports.%import_ref [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -82,13 +85,16 @@ var f: () = F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+7, loaded [template = constants.%F] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .F = %import_ref +// CHECK:STDOUT: .F = imports.%import_ref // CHECK:STDOUT: .f = %f // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+7, loaded [template = constants.%F] // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -99,7 +105,7 @@ var f: () = F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: assign file.%f.var, %F.call // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index af2a98398146..6cb84ded9e1b 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -170,18 +170,7 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %ReturnDUsed: %ReturnDUsed.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .D = %import_ref.2 -// CHECK:STDOUT: .ReturnCUnused = %import_ref.3 -// CHECK:STDOUT: .ReturnCUsed = %import_ref.4 -// CHECK:STDOUT: .ReturnDUnused = %import_ref.5 -// CHECK:STDOUT: .ReturnDUsed = %import_ref.6 -// CHECK:STDOUT: .Call = %import_ref.7 -// CHECK:STDOUT: .CallFAndGIncomplete = %CallFAndGIncomplete.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %import_ref.3: %ReturnCUnused.type = import_ref ir1, inst+7, loaded [template = constants.%ReturnCUnused] @@ -189,28 +178,42 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %import_ref.5: %ReturnDUnused.type = import_ref ir1, inst+18, loaded [template = constants.%ReturnDUnused] // CHECK:STDOUT: %import_ref.6: %ReturnDUsed.type = import_ref ir1, inst+23, loaded [template = constants.%ReturnDUsed] // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+26, unloaded -// CHECK:STDOUT: %CallFAndGIncomplete.decl: %CallFAndGIncomplete.type = fn_decl @CallFAndGIncomplete [template = constants.%CallFAndGIncomplete] {} // CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .D = imports.%import_ref.2 +// CHECK:STDOUT: .ReturnCUnused = imports.%import_ref.3 +// CHECK:STDOUT: .ReturnCUsed = imports.%import_ref.4 +// CHECK:STDOUT: .ReturnDUnused = imports.%import_ref.5 +// CHECK:STDOUT: .ReturnDUsed = imports.%import_ref.6 +// CHECK:STDOUT: .Call = imports.%import_ref.7 +// CHECK:STDOUT: .CallFAndGIncomplete = %CallFAndGIncomplete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %CallFAndGIncomplete.decl: %CallFAndGIncomplete.type = fn_decl @CallFAndGIncomplete [template = constants.%CallFAndGIncomplete] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @C; // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.8 +// CHECK:STDOUT: .Self = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallFAndGIncomplete() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %ReturnCUnused.ref: %ReturnCUnused.type = name_ref ReturnCUnused, file.%import_ref.3 [template = constants.%ReturnCUnused] +// CHECK:STDOUT: %ReturnCUnused.ref: %ReturnCUnused.type = name_ref ReturnCUnused, imports.%import_ref.3 [template = constants.%ReturnCUnused] // CHECK:STDOUT: %ReturnCUnused.call: init = call %ReturnCUnused.ref() -// CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, file.%import_ref.4 [template = constants.%ReturnCUsed] +// CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, imports.%import_ref.4 [template = constants.%ReturnCUsed] // CHECK:STDOUT: %ReturnCUsed.call: init = call %ReturnCUsed.ref() -// CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, file.%import_ref.5 [template = constants.%ReturnDUnused] +// CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, imports.%import_ref.5 [template = constants.%ReturnDUnused] // CHECK:STDOUT: %.loc24_16.1: ref %D = temporary_storage // CHECK:STDOUT: %ReturnDUnused.call: init %D = call %ReturnDUnused.ref() to %.loc24_16.1 // CHECK:STDOUT: %.loc24_16.2: ref %D = temporary %.loc24_16.1, %ReturnDUnused.call -// CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, file.%import_ref.6 [template = constants.%ReturnDUsed] +// CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%import_ref.6 [template = constants.%ReturnDUsed] // CHECK:STDOUT: %ReturnDUsed.call: init = call %ReturnDUsed.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon index 4ac81730bd98..ac764e2648c2 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon @@ -92,13 +92,16 @@ extern fn A(); // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -132,13 +135,16 @@ extern fn A(); // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,13 +175,16 @@ extern fn A(); // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon index 32a35cf6f3da..243ca89faea8 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon @@ -96,13 +96,16 @@ fn D(); // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl.loc4 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl.loc4: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.decl.loc6: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } @@ -120,13 +123,16 @@ fn D(); // CHECK:STDOUT: // CHECK:STDOUT: --- use_decl_in_api.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %import_ref +// CHECK:STDOUT: .A = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- decl_only_in_api.carbon @@ -148,13 +154,16 @@ fn D(); // CHECK:STDOUT: // CHECK:STDOUT: --- decl_only_in_api.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir0, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .B = %import_ref +// CHECK:STDOUT: .B = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref = import_ref ir0, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- decl_in_api_decl_in_impl.carbon @@ -182,13 +191,16 @@ fn D(); // CHECK:STDOUT: %C: %C.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %C.type = import_ref ir0, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %C.type = import_ref ir0, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/param_same_name.carbon b/toolchain/check/testdata/function/declaration/param_same_name.carbon index 7055948e5dd7..eaa109895657 100644 --- a/toolchain/check/testdata/function/declaration/param_same_name.carbon +++ b/toolchain/check/testdata/function/declaration/param_same_name.carbon @@ -24,6 +24,11 @@ fn G(a: i32); // CHECK:STDOUT: %G: %G.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -32,7 +37,6 @@ fn G(a: i32); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -40,7 +44,6 @@ fn G(a: i32); // CHECK:STDOUT: %a.loc11_6.1: i32 = param a // CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc11_6.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 859335112176..36f0e5b9ceca 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -114,6 +114,13 @@ fn D() {} // CHECK:STDOUT: %D: %D.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -125,8 +132,6 @@ fn D() {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} -// 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: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32] @@ -138,8 +143,6 @@ fn D() {} // CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32] // CHECK:STDOUT: @B.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: %.2 = tuple_literal (%int.make_type_32.loc6_10) @@ -221,12 +224,21 @@ fn D() {} // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+23, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+47, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+59, unloaded +// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b @@ -234,22 +246,16 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+23, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+47, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+59, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32] @@ -268,14 +274,14 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call -// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%import_ref.2 [template = constants.%B] +// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7) // CHECK:STDOUT: assign file.%b.var, %B.call -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%import_ref.3 [template = constants.%C] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C] // CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc8_25: %.4 = tuple_literal (%.loc8_23) // CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc8_23) [template = constants.%tuple] @@ -297,24 +303,27 @@ fn D() {} // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .D = %import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] // CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+23, loaded [template = constants.%B] // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+47, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+59, unloaded -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} +// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc27_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc27_9.1: type = value_of_initializer %int.make_type_32.loc27_9 [template = i32] @@ -345,6 +354,10 @@ fn D() {} // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl.loc6 @@ -352,7 +365,6 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl.loc6: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.decl.loc7: %A.type = fn_decl @A [template = constants.%A] {} @@ -371,20 +383,23 @@ fn D() {} // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+23, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+47, unloaded +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+59, loaded [template = constants.%D] +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 // CHECK:STDOUT: .D = %D.decl.loc13 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+23, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+47, unloaded -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+59, loaded [template = constants.%D] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %D.decl.loc6: %D.type = fn_decl @D [template = constants.%D] {} // CHECK:STDOUT: %D.decl.loc13: %D.type = fn_decl @D [template = constants.%D] {} diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index 6224323d9b2b..3432bd08a939 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -210,16 +210,19 @@ private fn Redecl() {} // CHECK:STDOUT: %Def: %Def.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Def.type = import_ref ir0, inst+3, loaded [template = constants.%Def] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Def [private] = %import_ref +// CHECK:STDOUT: .Def [private] = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .f = %f // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref: %Def.type = import_ref ir0, inst+3, loaded [template = constants.%Def] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] @@ -231,7 +234,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Def.ref: %Def.type = name_ref Def, file.%import_ref [template = constants.%Def] +// CHECK:STDOUT: %Def.ref: %Def.type = name_ref Def, imports.%import_ref [template = constants.%Def] // CHECK:STDOUT: %Def.call: init %.1 = call %Def.ref() // CHECK:STDOUT: assign file.%f.var, %Def.call // CHECK:STDOUT: return @@ -302,16 +305,19 @@ private fn Redecl() {} // CHECK:STDOUT: %ForwardWithDef: %ForwardWithDef.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %ForwardWithDef.type = import_ref ir0, inst+3, loaded [template = constants.%ForwardWithDef] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .ForwardWithDef [private] = %import_ref +// CHECK:STDOUT: .ForwardWithDef [private] = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .f = %f // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref: %ForwardWithDef.type = import_ref ir0, inst+3, loaded [template = constants.%ForwardWithDef] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] @@ -323,7 +329,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %ForwardWithDef.ref: %ForwardWithDef.type = name_ref ForwardWithDef, file.%import_ref [template = constants.%ForwardWithDef] +// CHECK:STDOUT: %ForwardWithDef.ref: %ForwardWithDef.type = name_ref ForwardWithDef, imports.%import_ref [template = constants.%ForwardWithDef] // CHECK:STDOUT: %ForwardWithDef.call: init %.1 = call %ForwardWithDef.ref() // CHECK:STDOUT: assign file.%f.var, %ForwardWithDef.call // CHECK:STDOUT: return @@ -394,6 +400,10 @@ private fn Redecl() {} // CHECK:STDOUT: %Forward: %Forward.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Forward.type = import_ref ir0, inst+3, loaded [template = constants.%Forward] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Forward [private] = %Forward.decl @@ -403,7 +413,6 @@ private fn Redecl() {} // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref: %Forward.type = import_ref ir0, inst+3, loaded [template = constants.%Forward] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] @@ -419,7 +428,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Forward.ref: %Forward.type = name_ref Forward, file.%import_ref [template = constants.%Forward] +// CHECK:STDOUT: %Forward.ref: %Forward.type = name_ref Forward, imports.%import_ref [template = constants.%Forward] // CHECK:STDOUT: %Forward.call: init %.1 = call %Forward.ref() // CHECK:STDOUT: assign file.%f.var, %Forward.call // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon index 9d4662280e3e..4f409a60881b 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon @@ -149,13 +149,16 @@ fn B() {} // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -189,13 +192,16 @@ fn B() {} // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -229,13 +235,16 @@ fn B() {} // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -272,13 +281,16 @@ fn B() {} // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -312,13 +324,16 @@ fn B() {} // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -357,15 +372,18 @@ fn B() {} // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+1, unloaded +// CHECK:STDOUT: %import_ref.2: %A.type = import_ref ir0, inst+6, loaded [template = constants.%A] +// 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: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: %A.type = import_ref ir0, inst+6, loaded [template = constants.%A] // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index ff00d7ad2242..1f8199244ba7 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -20,6 +20,10 @@ fn Foo(a: i32) {} // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -27,7 +31,6 @@ fn Foo(a: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/definition/params_one_comma.carbon b/toolchain/check/testdata/function/definition/params_one_comma.carbon index cff14d0dd29e..b67ec6fccf9c 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -20,6 +20,10 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -27,7 +31,6 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index e2f661daa3cb..0da6b65a4cf3 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -20,6 +20,11 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -27,8 +32,6 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/definition/params_two_comma.carbon b/toolchain/check/testdata/function/definition/params_two_comma.carbon index aff2d73bdb0a..67a780628eb0 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -20,6 +20,11 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -27,8 +32,6 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] 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 54c98eb4851c..4a1a59160c17 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 @@ -24,6 +24,11 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -31,8 +36,6 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc14_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14_10 [template = i32] diff --git a/toolchain/check/testdata/global/decl.carbon b/toolchain/check/testdata/global/decl.carbon index 37bdb3400b3a..fd33c419349c 100644 --- a/toolchain/check/testdata/global/decl.carbon +++ b/toolchain/check/testdata/global/decl.carbon @@ -17,6 +17,10 @@ var a: i32; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -24,7 +28,6 @@ var a: i32; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32] diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index ead8b1f7264e..9215ceae62a9 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -18,6 +18,10 @@ var a: i32 = 0; // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -25,7 +29,6 @@ var a: i32 = 0; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32] diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index eda06aca82c7..e3b795c4d9be 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -25,6 +25,11 @@ var a: i32 = test_a(); // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,14 +38,12 @@ var a: i32 = test_a(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %test_a.decl: %test_a.type = fn_decl @test_a [template = constants.%test_a] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_16.2: type = converted %int.make_type_32.loc11, %.loc11_16.1 [template = i32] // CHECK:STDOUT: @test_a.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/if/else.carbon b/toolchain/check/testdata/if/else.carbon index 08a8a0a2f59f..83a0344ca916 100644 --- a/toolchain/check/testdata/if/else.carbon +++ b/toolchain/check/testdata/if/else.carbon @@ -37,6 +37,10 @@ fn If(b: bool) { // CHECK:STDOUT: %If: %If.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -50,7 +54,6 @@ fn If(b: bool) { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc15_10.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index ab4c4f7c11a4..3b4e730c52f4 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -57,6 +57,15 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %If3: %If3.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -66,8 +75,6 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %If1.decl: %If1.type = fn_decl @If1 [template = constants.%If1] { // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] @@ -79,8 +86,6 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %.loc11_20.2: type = converted %int.make_type_32.loc11, %.loc11_20.1 [template = i32] // CHECK:STDOUT: @If1.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %If2.decl: %If2.type = fn_decl @If2 [template = constants.%If2] { // CHECK:STDOUT: %bool.make_type.loc22: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc22_11.1: type = value_of_initializer %bool.make_type.loc22 [template = bool] @@ -92,8 +97,6 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: %.loc22_20.2: type = converted %int.make_type_32.loc22, %.loc22_20.1 [template = i32] // CHECK:STDOUT: @If2.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %If3.decl: %If3.type = fn_decl @If3 [template = constants.%If3] { // CHECK:STDOUT: %bool.make_type.loc33: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc33_11.1: type = value_of_initializer %bool.make_type.loc33 [template = bool] diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 10adbcbe9a92..dacae25f040a 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -32,6 +32,12 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %.2: i32 = int_literal 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,8 +45,6 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %VarScope.decl: %VarScope.type = fn_decl @VarScope [template = constants.%VarScope] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %bool.make_type [template = bool] @@ -52,7 +56,6 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32, %.loc11_25.1 [template = i32] // CHECK:STDOUT: @VarScope.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/if/no_else.carbon b/toolchain/check/testdata/if/no_else.carbon index 8eaeaaf6ec32..740db8c5317c 100644 --- a/toolchain/check/testdata/if/no_else.carbon +++ b/toolchain/check/testdata/if/no_else.carbon @@ -32,6 +32,10 @@ fn If(b: bool) { // CHECK:STDOUT: %If: %If.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,7 +47,6 @@ fn If(b: bool) { // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index edcd1ca9d3dc..85d53fc478db 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -31,6 +31,11 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,8 +43,6 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index c184de5fe64e..f0e0c7237edc 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -31,6 +31,14 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %array: %.3 = tuple_value (%.5) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,10 +46,6 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] @@ -63,7 +67,6 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %.loc11_34.2: type = converted %int.make_type_32.loc11_34, %.loc11_34.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index b9d1898e953d..3be623bb9fd4 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -56,6 +56,21 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %PartiallyConstant: %PartiallyConstant.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -68,46 +83,36 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] // CHECK:STDOUT: @A.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12, %.loc12_11.1 [template = i32] // CHECK:STDOUT: @B.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32.loc14, %.loc14_11.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_11.2: type = converted %int.make_type_32.loc18, %.loc18_11.1 [template = i32] // CHECK:STDOUT: @G.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] { // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_18.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] // CHECK:STDOUT: %.loc22_18.2: type = converted %int.make_type_32.loc22, %.loc22_18.1 [template = i32] // CHECK:STDOUT: @Constant.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %PartiallyConstant.decl: %PartiallyConstant.type = fn_decl @PartiallyConstant [template = constants.%PartiallyConstant] { // CHECK:STDOUT: %t.loc28_22.1: type = param t // CHECK:STDOUT: @PartiallyConstant.%t: type = bind_name t, %t.loc28_22.1 @@ -116,8 +121,6 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %.loc28_34.2: type = converted %int.make_type_32.loc28, %.loc28_34.1 [template = i32] // CHECK:STDOUT: @PartiallyConstant.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index f03219a1f846..6de4d6466252 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -33,6 +33,13 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -42,22 +49,18 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] // CHECK:STDOUT: @A.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_11.2: type = converted %int.make_type_32.loc12, %.loc12_11.1 [template = i32] // CHECK:STDOUT: @B.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %bool.make_type [template = bool] 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 a6ae65c9d1ca..0653948d1eab 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -54,6 +54,12 @@ class C { // CHECK:STDOUT: %.7: type = struct_type {.n: i32} [template] // 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: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -62,13 +68,10 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32, %.loc23_8.1 [template = i32] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index d23ed83926e8..306a27888518 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -52,6 +52,12 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -59,7 +65,6 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %ConditionIsNonConstant.decl: %ConditionIsNonConstant.type = fn_decl @ConditionIsNonConstant [template = constants.%ConditionIsNonConstant] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_30.1: type = value_of_initializer %bool.make_type [template = bool] @@ -67,8 +72,6 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %b.loc4_27.1: bool = param b // CHECK:STDOUT: @ConditionIsNonConstant.%b: bool = bind_name b, %b.loc4_27.1 // CHECK:STDOUT: } -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; @@ -114,6 +117,11 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %.4: bool = bool_literal false [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -125,8 +133,6 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: %t.loc4_30.1: type = param t // CHECK:STDOUT: @ChosenBranchIsNonConstant.%t: type = bind_name t, %t.loc4_30.1 // CHECK:STDOUT: } -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ChosenBranchIsNonConstant(%t: type) { diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index cfe55850e8ce..f0f54f793fb3 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -28,6 +28,13 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: %.5: i32 = int_literal 4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,10 +42,6 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type.loc11_9: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type.loc11_9 [template = bool] diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 9815c2c16327..765a3f597915 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -34,6 +34,14 @@ fn F(cond: bool) { // CHECK:STDOUT: %struct: %.2 = struct_value (%.4, %.5) [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -42,8 +50,6 @@ fn F(cond: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] @@ -55,7 +61,6 @@ fn F(cond: bool) { // CHECK:STDOUT: %s.loc11_6.1: %.2 = param s // CHECK:STDOUT: @G.%s: %.2 = bind_name s, %s.loc11_6.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %bool.make_type [template = bool] @@ -63,8 +68,6 @@ fn F(cond: bool) { // CHECK:STDOUT: %cond.loc13_6.1: bool = param cond // CHECK:STDOUT: @F.%cond: bool = bind_name cond, %cond.loc13_6.1 // CHECK:STDOUT: } -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index 77c470a826e1..2fedd309afba 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -66,6 +66,15 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %InstanceCallIndirect: %InstanceCallIndirect.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -78,15 +87,12 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] // CHECK:STDOUT: %.loc16_6.2: type = converted %int.make_type_32.loc16, %.loc16_6.1 [template = i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] // CHECK:STDOUT: } -// 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: %NonInstanceCall.decl: %NonInstanceCall.type = fn_decl @NonInstanceCall [template = constants.%NonInstanceCall] { // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_23.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] @@ -94,7 +100,6 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %n.loc21_20.1: i32 = param n // CHECK:STDOUT: @NonInstanceCall.%n: i32 = bind_name n, %n.loc21_20.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { // CHECK:STDOUT: %int.make_type_32.loc25: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc25_20.1: type = value_of_initializer %int.make_type_32.loc25 [template = i32] @@ -102,7 +107,6 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %n.loc25_17.1: i32 = param n // CHECK:STDOUT: @InstanceCall.%n: i32 = bind_name n, %n.loc25_17.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %NonInstanceCallIndirect.decl: %NonInstanceCallIndirect.type = fn_decl @NonInstanceCallIndirect [template = constants.%NonInstanceCallIndirect] { // CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_34.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] @@ -111,7 +115,6 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: %p.loc29_28.1: %.8 = param p // CHECK:STDOUT: @NonInstanceCallIndirect.%p: %.8 = bind_name p, %p.loc29_28.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %InstanceCallIndirect.decl: %InstanceCallIndirect.type = fn_decl @InstanceCallIndirect [template = constants.%InstanceCallIndirect] { // CHECK:STDOUT: %int.make_type_32.loc33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc33_31.1: type = value_of_initializer %int.make_type_32.loc33 [template = i32] diff --git a/toolchain/check/testdata/impl/declaration.carbon b/toolchain/check/testdata/impl/declaration.carbon index 727fd5591047..09e0d6f5faca 100644 --- a/toolchain/check/testdata/impl/declaration.carbon +++ b/toolchain/check/testdata/impl/declaration.carbon @@ -22,6 +22,10 @@ impl i32 as I; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,7 +34,6 @@ impl i32 as I; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/impl/empty.carbon b/toolchain/check/testdata/impl/empty.carbon index 5d882af3cb32..f67cb7a81565 100644 --- a/toolchain/check/testdata/impl/empty.carbon +++ b/toolchain/check/testdata/impl/empty.carbon @@ -25,6 +25,10 @@ impl i32 as Empty { // CHECK:STDOUT: %.3: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,7 +37,6 @@ impl i32 as Empty { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_6.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 0bc541af15e7..8af872c0786f 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -41,6 +41,11 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %InstanceCall: %InstanceCall.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -50,14 +55,12 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32.loc15, %.loc15_6.1 [template = i32] // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %InstanceCall.decl: %InstanceCall.type = fn_decl @InstanceCall [template = constants.%InstanceCall] { // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_20.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index c667cf2f20fe..a89ad2f9f5be 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -26,6 +26,10 @@ extend impl i32 as I {} // CHECK:STDOUT: %.3: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,7 +38,6 @@ extend impl i32 as I {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32 [template = i32] 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 b452aa85d58f..a80a00815fd9 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -54,6 +54,10 @@ class E { // CHECK:STDOUT: %E: type = class_type @E [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -66,7 +70,6 @@ class E { // CHECK:STDOUT: %Core: = namespace %Core.import, [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: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: %E.decl: type = class_decl @E [template = constants.%E] {} // 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 23b549a178e1..a3363d6aad14 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -25,6 +25,10 @@ class C { // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,7 +37,6 @@ class C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as i32; 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 3b7e0bdc583a..fc03ea5f14c1 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon @@ -27,6 +27,10 @@ impl bool as I {} // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,7 +39,6 @@ impl bool as I {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %bool.make_type [template = bool] 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 d324b25f8bfe..1efeddeb3175 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -300,6 +300,33 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %.27: type = array_type %.14, %SelfNestedBadReturnType [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.11: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.14: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.15: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.16: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.17: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.18: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.19: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.20: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -331,43 +358,19 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %PossiblyF.decl: %PossiblyF.type = fn_decl @PossiblyF [template = constants.%PossiblyF] {} // CHECK:STDOUT: %FAlias.decl: type = class_decl @FAlias [template = constants.%FAlias] {} // CHECK:STDOUT: %FExtraParam.decl: type = class_decl @FExtraParam [template = constants.%FExtraParam] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %FExtraImplicitParam.decl: type = class_decl @FExtraImplicitParam [template = constants.%FExtraImplicitParam] {} // CHECK:STDOUT: %FExtraReturnType.decl: type = class_decl @FExtraReturnType [template = constants.%FExtraReturnType] {} -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %J.decl: type = interface_decl @J [template = constants.%.6] {} -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %FMissingParam.decl: type = class_decl @FMissingParam [template = constants.%FMissingParam] {} -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %FMissingImplicitParam.decl: type = class_decl @FMissingImplicitParam [template = constants.%FMissingImplicitParam] {} -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %FMissingReturnType.decl: type = class_decl @FMissingReturnType [template = constants.%FMissingReturnType] {} -// CHECK:STDOUT: %import_ref.10: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.11: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %FDifferentParamType.decl: type = class_decl @FDifferentParamType [template = constants.%FDifferentParamType] {} -// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %FDifferentImplicitParamType.decl: type = class_decl @FDifferentImplicitParamType [template = constants.%FDifferentImplicitParamType] {} -// CHECK:STDOUT: %import_ref.14: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.15: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %FDifferentReturnType.decl: type = class_decl @FDifferentReturnType [template = constants.%FDifferentReturnType] {} -// CHECK:STDOUT: %import_ref.16: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.17: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %FDifferentParamName.decl: type = class_decl @FDifferentParamName [template = constants.%FDifferentParamName] {} -// CHECK:STDOUT: %import_ref.18: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.19: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.20: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %SelfNested.decl: type = interface_decl @SelfNested [template = constants.%.9] {} -// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %SelfNestedBadParam.decl: type = class_decl @SelfNestedBadParam [template = constants.%SelfNestedBadParam] {} -// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %SelfNestedBadReturnType.decl: type = class_decl @SelfNestedBadReturnType [template = constants.%SelfNestedBadReturnType] {} -// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index 1d77cf203a89..6c4598e466b3 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -26,13 +26,16 @@ impl i32 as false {} // CHECK:STDOUT: %.2: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_6.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index cb7dd7836826..c5b4564238b2 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -31,6 +31,11 @@ impl i32 as I {} // CHECK:STDOUT: %.3: = interface_witness () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,14 +44,12 @@ impl i32 as I {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_6.2: type = converted %int.make_type_32.loc13, %.loc13_6.1 [template = i32] // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, %I.decl [template = constants.%.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_6.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] 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 d77c1d83fd2c..6a6b7ea3c9d4 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -27,6 +27,10 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,7 +39,6 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_6.1: type = value_of_initializer %bool.make_type [template = bool] 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 41b09d8c1f74..2ea16de994b2 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -49,6 +49,10 @@ impl C as I { // CHECK:STDOUT: %.6: = interface_witness (%F.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -60,7 +64,6 @@ impl C as I { // CHECK:STDOUT: %Core: = namespace %Core.import, [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: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index a72623811aa3..d776b1392b80 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -110,12 +110,23 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @HasF, %F.type.1 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, file.%import_ref.8 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir8, inst+15, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir8, inst+5, unloaded +// CHECK:STDOUT: %import_ref.3: %.5 = import_ref ir8, inst+12, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.4 = import_ref ir8, inst+7, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir8, inst+23, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: type = import_ref ir8, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir8, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.8 = import_ref ir8, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -126,43 +137,35 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %Impl.import = import Impl // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Impl: = namespace %Impl.import, [template] {} -// CHECK:STDOUT: %import_ref.1 = import_ref ir8, inst+15, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir8, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.5 = import_ref ir8, inst+12, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.4 = import_ref ir8, inst+7, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir8, inst+23, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: type = import_ref ir8, inst+14, loaded [template = constants.%C] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // 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.ref: type = name_ref C, imports.%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 ir8, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.8 = import_ref ir8, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .F = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.1 +// CHECK:STDOUT: .Self = imports.%import_ref.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %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: %.5 = name_ref F, file.%import_ref.3 [template = constants.%.6] -// CHECK:STDOUT: %.1: %F.type.1 = interface_witness_access file.%import_ref.5, element0 [template = constants.%F.2] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.2] +// CHECK:STDOUT: %F.ref: %.5 = name_ref F, imports.%import_ref.3 [template = constants.%.6] +// CHECK:STDOUT: %.1: %F.type.1 = interface_witness_access imports.%import_ref.5, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %.3 = 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 5b9fed957b65..b1847b0de715 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -46,6 +46,12 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %.7: type = ptr_type %.6 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -57,10 +63,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl.loc11: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %C.decl.loc17: type = class_decl @C [template = constants.%C] {} -// 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: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl.loc11 [template = constants.%C] // CHECK:STDOUT: %c.loc23_6.1: %C = param c diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index 1f52c775bb1e..347dadd6ed4f 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -107,12 +107,23 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @HasF, %F.type.1 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, file.%import_ref.8 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.7: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: %.5 = import_ref ir1, inst+10, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+5, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+21, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+5, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Impl = %Impl @@ -120,43 +131,35 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: %Impl.import = import Impl // CHECK:STDOUT: %Impl: = namespace %Impl.import, [template] {} -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.5 = import_ref ir1, inst+10, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+5, unloaded -// CHECK:STDOUT: %import_ref.5: = import_ref ir1, inst+21, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: type = import_ref ir1, inst+12, loaded [template = constants.%C] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // 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.ref: type = name_ref C, imports.%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 ir1, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+5, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .F = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.1 +// CHECK:STDOUT: .Self = imports.%import_ref.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %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: %.5 = name_ref F, file.%import_ref.3 [template = constants.%.6] -// CHECK:STDOUT: %.1: %F.type.1 = interface_witness_access file.%import_ref.5, element0 [template = constants.%F.2] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.2] +// CHECK:STDOUT: %F.ref: %.5 = name_ref F, imports.%import_ref.3 [template = constants.%.6] +// CHECK:STDOUT: %.1: %F.type.1 = interface_witness_access imports.%import_ref.5, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %.3 = call %.1() // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/no_prelude/import_self.carbon b/toolchain/check/testdata/impl/no_prelude/import_self.carbon index ca7207535e4e..791686337c90 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_self.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_self.carbon @@ -93,23 +93,27 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: %.4: type = assoc_entity_type @Add, %Op.type.2 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, file.%import_ref.5 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Add = %import_ref.1 -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %import_ref.3: %.4 = import_ref ir1, inst+24, loaded [template = constants.%.5] // CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir1, inst+19, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+19, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Add = imports.%import_ref.1 +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %.loc6_7.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %.loc10_10.1: %.1 = tuple_literal () @@ -124,14 +128,13 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: %.loc10_24.2: type = converted %.loc10_24.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: @F.%return: ref %.1 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+19, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %.1 as %.2 { @@ -165,8 +168,8 @@ fn F(x: (), y: ()) -> () { // CHECK:STDOUT: fn @F(%x: %.1, %y: %.1) -> %.1 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.ref: %.1 = name_ref x, %x -// CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%import_ref.1 [template = constants.%.2] -// CHECK:STDOUT: %Op.ref: %.4 = name_ref Op, file.%import_ref.3 [template = constants.%.5] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Op.ref: %.4 = name_ref Op, imports.%import_ref.3 [template = constants.%.5] // CHECK:STDOUT: %.1: %Op.type.2 = interface_witness_access @impl.%.1, element0 [template = constants.%Op.1] // CHECK:STDOUT: %.loc11_11: = bound_method %x.ref, %.1 // CHECK:STDOUT: %y.ref: %.1 = name_ref y, %y diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon index c70c61947ab0..e0fdfbf3111a 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon @@ -118,29 +118,32 @@ impl () as D; // CHECK:STDOUT: %.3: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %import_ref.1 +// CHECK:STDOUT: .A = imports.%import_ref.1 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+3, unloaded // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %.loc4_7.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_7.2: type = converted %.loc4_7.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %A.ref.loc4: type = name_ref A, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %A.ref.loc4: type = name_ref A, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %.loc6_7.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %A.ref.loc6: type = name_ref A, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %A.ref.loc6: type = name_ref A, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @A { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: @@ -165,19 +168,22 @@ impl () as D; // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %import_ref.1 -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc2_6.1 = import -// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import.loc2_6.1 = import +// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: interface @A { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: @@ -221,19 +227,22 @@ impl () as D; // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .B = %import_ref.1 -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc2_6.1 = import -// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+1, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .B = imports.%import_ref.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import.loc2_6.1 = import +// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: interface @B { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: @@ -277,24 +286,27 @@ impl () as D; // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+3, unloaded // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %.loc8_7.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index d53ba8c35adc..69e43d31eca3 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -31,6 +31,12 @@ impl i32 as I {} // CHECK:STDOUT: %.4: = interface_witness () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,7 +46,6 @@ impl i32 as I {} // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_6.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] @@ -48,8 +53,6 @@ impl i32 as I {} // CHECK:STDOUT: %I.ref.loc13: type = name_ref I, %I.decl [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} -// 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: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 9155c4467bd4..b30b7438e000 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -30,6 +30,13 @@ var d: i32 = a[b]; // CHECK:STDOUT: %array: %.3 = tuple_value (%.5, %.6) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,7 +47,6 @@ var d: i32 = a[b]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 2 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -48,19 +54,16 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] // CHECK:STDOUT: %c.var: ref i32 = var c // CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] // CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_32.loc14, %.loc14_8.1 [template = i32] diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index e48eca8ff4aa..8bc6e54d9c88 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -52,6 +52,15 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %ValueBinding: %ValueBinding.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -61,7 +70,6 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17: i32 = int_literal 3 [template = constants.%.2] @@ -70,7 +78,6 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.3] // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15: i32 = int_literal 3 [template = constants.%.2] @@ -80,9 +87,6 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %b.loc13_6.1: %.3 = param b // CHECK:STDOUT: @G.%b: %.3 = bind_name b, %b.loc13_6.1 // CHECK:STDOUT: } -// 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: %ValueBinding.decl: %ValueBinding.type = fn_decl @ValueBinding [template = constants.%ValueBinding] { // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_26: i32 = int_literal 3 [template = constants.%.2] @@ -92,7 +96,6 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: %b.loc21_17.1: %.3 = param b // CHECK:STDOUT: @ValueBinding.%b: %.3 = bind_name b, %b.loc21_17.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index f6e304341cb8..d23006c9852f 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -37,6 +37,12 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %.8: i32 = int_literal 2147483647 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -46,7 +52,6 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -54,13 +59,11 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_8.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] // CHECK:STDOUT: %.loc22_8.2: type = converted %int.make_type_32.loc22, %.loc22_8.1 [template = i32] 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 4da867bfc301..3076765839a3 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -30,6 +30,11 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.8: f64 = float_literal 2.6000000000000001 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,7 +43,6 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -46,7 +50,6 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] 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 e3547c28de29..b3632d7412c8 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 @@ -29,6 +29,11 @@ var b: i32 = a[1]; // CHECK:STDOUT: %array: %.3 = tuple_value (%.5) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,7 +42,6 @@ var b: i32 = a[1]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -45,7 +49,6 @@ var b: i32 = a[1]; // CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 6942a51d0a6c..ae0e1c843408 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -54,6 +54,13 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.7: i32 = int_literal 4 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -62,7 +69,6 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17: i32 = int_literal 3 [template = constants.%.2] @@ -71,7 +77,6 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.3] // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_15: i32 = int_literal 3 [template = constants.%.2] @@ -81,8 +86,6 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: %b.loc13_6.1: %.3 = param b // CHECK:STDOUT: @G.%b: %.3 = bind_name b, %b.loc13_6.1 // CHECK:STDOUT: } -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index c3ed060ff763..cc0d5ba1dea3 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -49,6 +49,15 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: %struct: %.5 = struct_value (%.3, %.4) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -62,33 +71,27 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %N: = namespace [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] // CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32.loc23 [template = i32] // CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32.loc23, %.loc23_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc29_8.1: type = value_of_initializer %int.make_type_32.loc29 [template = i32] // CHECK:STDOUT: %.loc29_8.2: type = converted %int.make_type_32.loc29, %.loc29_8.1 [template = i32] // CHECK:STDOUT: %c.var: ref i32 = var c // CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc34_8.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32] // CHECK:STDOUT: %.loc34_8.2: type = converted %int.make_type_32.loc34, %.loc34_8.1 [template = i32] // CHECK:STDOUT: %d.var: ref i32 = var d // CHECK:STDOUT: %d: ref i32 = bind_name d, %d.var -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index bdb6ccbb92ac..f1237ebe8918 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -26,6 +26,10 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,7 +38,6 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index e7d3180f5485..70fc42e8c64f 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -32,7 +32,18 @@ var b: i32 = a[-10]; // CHECK:STDOUT: %Op.type: type = fn_type @Op [template] // CHECK:STDOUT: %Op: %Op.type = struct_value () [template] // CHECK:STDOUT: %.9: type = assoc_entity_type @Negate, %Op.type [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, file.%import_ref.8 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.8 [template] +// 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: type = import_ref ir4, inst+67, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.5 = import_ref ir4, inst+69, unloaded +// CHECK:STDOUT: %import_ref.6: %.9 = import_ref ir4, inst+84, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.7 = import_ref ir4, inst+80, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref ir4, inst+80, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -43,9 +54,7 @@ var b: i32 = a[-10]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) // CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -55,24 +64,18 @@ var b: i32 = a[-10]; // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.4: type = import_ref ir4, inst+67, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.5 = import_ref ir4, inst+69, unloaded -// CHECK:STDOUT: %import_ref.6: %.9 = import_ref ir4, inst+84, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.7 = import_ref ir4, inst+80, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref ir4, inst+80, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Negate { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 -// CHECK:STDOUT: .Op = file.%import_ref.6 -// CHECK:STDOUT: witness = (file.%import_ref.7) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .Op = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon index 05e419743fcc..de137b145690 100644 --- a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon @@ -30,6 +30,13 @@ var c: i32 = a[b]; // CHECK:STDOUT: %.7: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,9 +46,7 @@ var c: i32 = a[b]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) // CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -51,13 +56,11 @@ var c: i32 = a[b]; // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] // CHECK:STDOUT: %.loc16_8.2: type = converted %int.make_type_32.loc16, %.loc16_8.1 [template = i32] 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 15b11b4a9765..039154ed17a7 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 @@ -31,6 +31,12 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %struct: %.8 = struct_value (%.7) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,9 +45,7 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) // CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -51,7 +55,6 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/index/fail_tuple_index_error.carbon b/toolchain/check/testdata/index/fail_tuple_index_error.carbon index 6e844a6a72ab..6b624499962c 100644 --- a/toolchain/check/testdata/index/fail_tuple_index_error.carbon +++ b/toolchain/check/testdata/index/fail_tuple_index_error.carbon @@ -28,6 +28,12 @@ var b: i32 = a[oops]; // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5, %.6) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -36,9 +42,7 @@ var b: i32 = a[oops]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) // CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -48,7 +52,6 @@ var b: i32 = a[oops]; // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/index/fail_tuple_large_index.carbon b/toolchain/check/testdata/index/fail_tuple_large_index.carbon index 583b1541d737..5541f996cd7c 100644 --- a/toolchain/check/testdata/index/fail_tuple_large_index.carbon +++ b/toolchain/check/testdata/index/fail_tuple_large_index.carbon @@ -34,6 +34,13 @@ var d: i32 = b[0x7FFF_FFFF]; // CHECK:STDOUT: %.6: i32 = int_literal 2147483647 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -44,7 +51,6 @@ var d: i32 = b[0x7FFF_FFFF]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: %.2 = tuple_literal (%int.make_type_32.loc11) // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -52,7 +58,6 @@ var d: i32 = b[0x7FFF_FFFF]; // CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: %.2 = tuple_literal (%int.make_type_32.loc12) // CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_32.loc12 [template = i32] @@ -60,13 +65,11 @@ var d: i32 = b[0x7FFF_FFFF]; // CHECK:STDOUT: %.loc12_13.4: type = converted %.loc12_13.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %b.var: ref %.3 = var b // CHECK:STDOUT: %b: ref %.3 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_8.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] // CHECK:STDOUT: %.loc17_8.2: type = converted %int.make_type_32.loc17, %.loc17_8.1 [template = i32] // CHECK:STDOUT: %c.var: ref i32 = var c // CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_8.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_8.2: type = converted %int.make_type_32.loc21, %.loc21_8.1 [template = i32] 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 e6480c33678c..c4f1a715de87 100644 --- a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon @@ -29,6 +29,12 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.7: f64 = float_literal 2.6000000000000001 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,9 +43,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) // CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -49,7 +53,6 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] 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 1f8eb84be49a..d0416affb0eb 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 @@ -29,6 +29,12 @@ var b: i32 = a[2]; // CHECK:STDOUT: %.7: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,9 +43,7 @@ var b: i32 = a[2]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) // CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -49,7 +53,6 @@ var b: i32 = a[2]; // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/index/index_not_literal.carbon b/toolchain/check/testdata/index/index_not_literal.carbon index 62689be0c1f2..b22b01fe1280 100644 --- a/toolchain/check/testdata/index/index_not_literal.carbon +++ b/toolchain/check/testdata/index/index_not_literal.carbon @@ -28,6 +28,12 @@ var b: i32 = a[{.index = 1}.index]; // CHECK:STDOUT: %struct: %.8 = struct_value (%.7) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -36,9 +42,7 @@ var b: i32 = a[{.index = 1}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) // CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -48,7 +52,6 @@ var b: i32 = a[{.index = 1}.index]; // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] diff --git a/toolchain/check/testdata/index/tuple_element_access.carbon b/toolchain/check/testdata/index/tuple_element_access.carbon index 83a39c99b61e..9da4ce3d7bbe 100644 --- a/toolchain/check/testdata/index/tuple_element_access.carbon +++ b/toolchain/check/testdata/index/tuple_element_access.carbon @@ -25,6 +25,12 @@ var c: i32 = b[0]; // CHECK:STDOUT: %.5: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,7 +40,6 @@ var c: i32 = b[0]; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: %.2 = tuple_literal (%int.make_type_32.loc11) // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -42,7 +47,6 @@ var c: i32 = b[0]; // CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: %.2 = tuple_literal (%int.make_type_32.loc12) // CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_32.loc12 [template = i32] @@ -50,7 +54,6 @@ var c: i32 = b[0]; // CHECK:STDOUT: %.loc12_13.4: type = converted %.loc12_13.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %b.var: ref %.3 = var b // CHECK:STDOUT: %b: ref %.3 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] diff --git a/toolchain/check/testdata/index/tuple_return_value_access.carbon b/toolchain/check/testdata/index/tuple_return_value_access.carbon index 8a091f61163f..42be5bdc1c87 100644 --- a/toolchain/check/testdata/index/tuple_return_value_access.carbon +++ b/toolchain/check/testdata/index/tuple_return_value_access.carbon @@ -30,6 +30,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,7 +43,6 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32.loc11) @@ -47,7 +51,6 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] diff --git a/toolchain/check/testdata/interface/assoc_const.carbon b/toolchain/check/testdata/interface/assoc_const.carbon index e8de654c8f80..1f45882b1e5a 100644 --- a/toolchain/check/testdata/interface/assoc_const.carbon +++ b/toolchain/check/testdata/interface/assoc_const.carbon @@ -27,6 +27,10 @@ interface I { // CHECK:STDOUT: %.6: %.5 = assoc_entity element1, @I.%N [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,7 +39,6 @@ interface I { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { 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 6e8409a48038..c22a31d1ae02 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -37,6 +37,12 @@ interface I { // CHECK:STDOUT: %.9: %.8 = assoc_entity element1, @I.%N [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -45,9 +51,6 @@ interface I { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { 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 621e3d2e8206..a8880bf523d7 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 @@ -39,6 +39,12 @@ interface Interface { // CHECK:STDOUT: %.6: %.5 = assoc_entity element1, @Interface.%G.decl [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -47,9 +53,6 @@ interface Interface { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Interface { 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 bbb0933d6779..03d44dd4915f 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 @@ -61,6 +61,15 @@ fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %.8: %.type.2 = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -69,13 +78,7 @@ fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} -// 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: %.decl.loc32: %.type.1 = fn_decl @.1 [template = constants.%.7] {} -// 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: %.decl.loc40: %.type.2 = fn_decl @.2 [template = constants.%.8] { // CHECK:STDOUT: %int.make_type_32.loc40_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc40_19.1: type = value_of_initializer %int.make_type_32.loc40_19 [template = i32] diff --git a/toolchain/check/testdata/interface/no_prelude/export_name.carbon b/toolchain/check/testdata/interface/no_prelude/export_name.carbon index 369899aad1e4..85785004f62f 100644 --- a/toolchain/check/testdata/interface/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/interface/no_prelude/export_name.carbon @@ -67,19 +67,22 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .I = %I // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %I: type = export I, %import_ref.1 [template = constants.%.1] +// CHECK:STDOUT: %I: type = export I, imports.%import_ref.1 [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: @@ -93,16 +96,19 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: %UseEmpty: %UseEmpty.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+7, loaded [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .I = %import_ref.1 +// CHECK:STDOUT: .I = imports.%import_ref.1 // CHECK:STDOUT: .UseEmpty = %UseEmpty.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+7, loaded [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded // CHECK:STDOUT: %UseEmpty.decl: %UseEmpty.type = fn_decl @UseEmpty [template = constants.%UseEmpty] { -// CHECK:STDOUT: %I.ref: type = name_ref I, %import_ref.1 [template = constants.%.1] +// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.1 [template = constants.%.1] // CHECK:STDOUT: %i.loc6_13.1: %.1 = param i // CHECK:STDOUT: @UseEmpty.%i: %.1 = bind_name i, %i.loc6_13.1 // CHECK:STDOUT: } @@ -110,7 +116,7 @@ fn UseEmpty(i: I) {} // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon index 587d2694bbf3..a0e45fb471e5 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_import.carbon @@ -86,22 +86,25 @@ impl C as AddWith(C) { // CHECK:STDOUT: %.5: = interface_witness (%F.1) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .AddWith = %import_ref.1 -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %AddWith.type = import_ref ir1, inst+4, loaded [template = constants.%AddWith] -// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+15, unloaded // CHECK:STDOUT: %import_ref.4: %F.type.2 = import_ref ir1, inst+11, loaded [template = constants.%F.2] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .AddWith = imports.%import_ref.1 +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %.loc7_20.1: type = value_of_initializer %.loc7_18 [template = constants.%.4] // CHECK:STDOUT: %.loc7_20.2: type = converted %.loc7_18, %.loc7_20.1 [template = constants.%.4] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc7_6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %AddWith.ref: %AddWith.type = name_ref AddWith, %import_ref.1 [template = constants.%AddWith] +// CHECK:STDOUT: %AddWith.ref: %AddWith.type = name_ref AddWith, imports.%import_ref.1 [template = constants.%AddWith] // CHECK:STDOUT: %C.ref.loc7_19: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc7_18: init type = call %AddWith.ref(%C.ref.loc7_19) [template = constants.%.4] // CHECK:STDOUT: } @@ -109,9 +112,9 @@ impl C as AddWith(C) { // CHECK:STDOUT: // CHECK:STDOUT: interface @AddWith { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .F = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.4 { diff --git a/toolchain/check/testdata/interface/no_prelude/import.carbon b/toolchain/check/testdata/interface/no_prelude/import.carbon index dd60f05da9de..9ae96e4caa77 100644 --- a/toolchain/check/testdata/interface/no_prelude/import.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import.carbon @@ -149,28 +149,50 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: %UseForwardDeclared.type: type = fn_type @UseForwardDeclared [template] // CHECK:STDOUT: %UseForwardDeclared: %UseForwardDeclared.type = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @Basic, type [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, file.%import_ref.16 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.16 [template] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template] // CHECK:STDOUT: %.7: type = assoc_entity_type @Basic, %F.type.1 [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, file.%import_ref.17 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.17 [template] // CHECK:STDOUT: %.9: type = assoc_entity_type @ForwardDeclared, type [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, file.%import_ref.18 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.18 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.11: type = assoc_entity_type @ForwardDeclared, %F.type.2 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element1, file.%import_ref.19 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element1, imports.%import_ref.19 [template] // CHECK:STDOUT: %.13: type = ptr_type %.4 [template] // CHECK:STDOUT: %.14: type = struct_type {.f: %.4} [template] // CHECK:STDOUT: %.15: type = struct_type {.f: %.2} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+20, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.4: ref %.14 = import_ref ir1, inst+42, loaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: %import_ref.7: %.5 = import_ref ir1, inst+11, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.8: %.7 = import_ref ir1, inst+18, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.9 = import_ref ir1, inst+9, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref ir1, inst+22, unloaded +// CHECK:STDOUT: %import_ref.12: %.9 = import_ref ir1, inst+26, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.13: %.11 = import_ref ir1, inst+32, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.14 = import_ref ir1, inst+24, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref ir1, inst+28, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref ir1, inst+9, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.18 = import_ref ir1, inst+24, unloaded +// CHECK:STDOUT: %import_ref.19 = import_ref ir1, inst+28, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Empty = %import_ref.1 -// CHECK:STDOUT: .Basic = %import_ref.2 -// CHECK:STDOUT: .ForwardDeclared = %import_ref.3 -// CHECK:STDOUT: .f_ref = %import_ref.4 +// CHECK:STDOUT: .Empty = imports.%import_ref.1 +// CHECK:STDOUT: .Basic = imports.%import_ref.2 +// CHECK:STDOUT: .ForwardDeclared = imports.%import_ref.3 +// CHECK:STDOUT: .f_ref = imports.%import_ref.4 // CHECK:STDOUT: .UseEmpty = %UseEmpty.decl // CHECK:STDOUT: .UseBasic = %UseBasic.decl // CHECK:STDOUT: .UseForwardDeclared = %UseForwardDeclared.decl @@ -181,53 +203,34 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: .f = %f.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+5, loaded [template = constants.%.3] -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+20, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.4: ref %.14 = import_ref ir1, inst+42, loaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+3, unloaded // CHECK:STDOUT: %UseEmpty.decl: %UseEmpty.type = fn_decl @UseEmpty [template = constants.%UseEmpty] { -// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, %import_ref.1 [template = constants.%.1] +// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%import_ref.1 [template = constants.%.1] // CHECK:STDOUT: %e.loc6_13.1: %.1 = param e // CHECK:STDOUT: @UseEmpty.%e: %.1 = bind_name e, %e.loc6_13.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %import_ref.7: %.5 = import_ref ir1, inst+11, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.8: %.7 = import_ref ir1, inst+18, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.9 = import_ref ir1, inst+9, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir1, inst+13, unloaded // CHECK:STDOUT: %UseBasic.decl: %UseBasic.type = fn_decl @UseBasic [template = constants.%UseBasic] { -// CHECK:STDOUT: %Basic.ref.loc7: type = name_ref Basic, %import_ref.2 [template = constants.%.3] +// CHECK:STDOUT: %Basic.ref.loc7: type = name_ref Basic, imports.%import_ref.2 [template = constants.%.3] // CHECK:STDOUT: %e.loc7_13.1: %.3 = param e // CHECK:STDOUT: @UseBasic.%e: %.3 = bind_name e, %e.loc7_13.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11 = import_ref ir1, inst+22, unloaded -// CHECK:STDOUT: %import_ref.12: %.9 = import_ref ir1, inst+26, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.13: %.11 = import_ref ir1, inst+32, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.14 = import_ref ir1, inst+24, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref ir1, inst+28, unloaded // CHECK:STDOUT: %UseForwardDeclared.decl: %UseForwardDeclared.type = fn_decl @UseForwardDeclared [template = constants.%UseForwardDeclared] { -// CHECK:STDOUT: %ForwardDeclared.ref.loc8: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4] +// CHECK:STDOUT: %ForwardDeclared.ref.loc8: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%.4] // CHECK:STDOUT: %f.loc8_23.1: %.4 = param f // CHECK:STDOUT: @UseForwardDeclared.%f: %.4 = 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 ir1, inst+9, unloaded -// CHECK:STDOUT: %T.ref.loc10: %.5 = name_ref T, %import_ref.7 [template = constants.%.6] -// CHECK:STDOUT: %UseBasicT: %.5 = bind_alias UseBasicT, %import_ref.7 [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 ir1, inst+13, unloaded -// CHECK:STDOUT: %F.ref.loc11: %.7 = name_ref F, %import_ref.8 [template = constants.%.8] -// CHECK:STDOUT: %UseBasicF: %.7 = bind_alias UseBasicF, %import_ref.8 [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 ir1, inst+24, unloaded -// CHECK:STDOUT: %T.ref.loc13: %.9 = name_ref T, %import_ref.12 [template = constants.%.10] -// CHECK:STDOUT: %UseForwardDeclaredT: %.9 = bind_alias UseForwardDeclaredT, %import_ref.12 [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 ir1, inst+28, unloaded -// CHECK:STDOUT: %F.ref.loc14: %.11 = name_ref F, %import_ref.13 [template = constants.%.12] -// CHECK:STDOUT: %UseForwardDeclaredF: %.11 = bind_alias UseForwardDeclaredF, %import_ref.13 [template = constants.%.12] -// CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, %import_ref.3 [template = constants.%.4] +// CHECK:STDOUT: %Basic.ref.loc10: type = name_ref Basic, imports.%import_ref.2 [template = constants.%.3] +// CHECK:STDOUT: %T.ref.loc10: %.5 = name_ref T, imports.%import_ref.7 [template = constants.%.6] +// CHECK:STDOUT: %UseBasicT: %.5 = bind_alias UseBasicT, imports.%import_ref.7 [template = constants.%.6] +// CHECK:STDOUT: %Basic.ref.loc11: type = name_ref Basic, imports.%import_ref.2 [template = constants.%.3] +// CHECK:STDOUT: %F.ref.loc11: %.7 = name_ref F, imports.%import_ref.8 [template = constants.%.8] +// CHECK:STDOUT: %UseBasicF: %.7 = bind_alias UseBasicF, imports.%import_ref.8 [template = constants.%.8] +// CHECK:STDOUT: %ForwardDeclared.ref.loc13: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%.4] +// CHECK:STDOUT: %T.ref.loc13: %.9 = name_ref T, imports.%import_ref.12 [template = constants.%.10] +// CHECK:STDOUT: %UseForwardDeclaredT: %.9 = bind_alias UseForwardDeclaredT, imports.%import_ref.12 [template = constants.%.10] +// CHECK:STDOUT: %ForwardDeclared.ref.loc14: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%.4] +// CHECK:STDOUT: %F.ref.loc14: %.11 = name_ref F, imports.%import_ref.13 [template = constants.%.12] +// CHECK:STDOUT: %UseForwardDeclaredF: %.11 = bind_alias UseForwardDeclaredF, imports.%import_ref.13 [template = constants.%.12] +// CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%.4] // CHECK:STDOUT: %.loc16: type = ptr_type %.4 [template = constants.%.13] // CHECK:STDOUT: %f.var: ref %.13 = var f // CHECK:STDOUT: %f.loc16: ref %.13 = bind_name f, %f.var @@ -235,24 +238,24 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: // CHECK:STDOUT: interface @Empty { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Basic { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .T = file.%import_ref.7 -// CHECK:STDOUT: .F = file.%import_ref.8 -// CHECK:STDOUT: witness = (file.%import_ref.9, file.%import_ref.10) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .T = imports.%import_ref.7 +// CHECK:STDOUT: .F = imports.%import_ref.8 +// CHECK:STDOUT: witness = (imports.%import_ref.9, imports.%import_ref.10) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @ForwardDeclared { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.11 -// CHECK:STDOUT: .T = file.%import_ref.12 -// CHECK:STDOUT: .F = file.%import_ref.13 -// CHECK:STDOUT: witness = (file.%import_ref.14, file.%import_ref.15) +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: .T = imports.%import_ref.12 +// CHECK:STDOUT: .F = imports.%import_ref.13 +// CHECK:STDOUT: witness = (imports.%import_ref.14, imports.%import_ref.15) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @UseEmpty(%e: %.1) { @@ -276,7 +279,7 @@ var f: ForwardDeclared* = &f_ref.f; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %f_ref.ref: ref %.14 = name_ref f_ref, file.%import_ref.4 +// CHECK:STDOUT: %f_ref.ref: ref %.14 = name_ref f_ref, imports.%import_ref.4 // CHECK:STDOUT: %.loc16_33: ref %.4 = struct_access %f_ref.ref, element0 // CHECK:STDOUT: %.loc16_27: %.13 = addr_of %.loc16_33 // CHECK:STDOUT: assign file.%f.var, %.loc16_27 diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index fcc174c5fcec..1b4de0693649 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -201,17 +201,20 @@ private interface Redecl {} // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Def [private] = %import_ref.1 +// CHECK:STDOUT: .Def [private] = imports.%import_ref.1 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+3, unloaded // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Def.ref: type = name_ref Def, %import_ref.1 [template = constants.%.1] +// CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%import_ref.1 [template = constants.%.1] // CHECK:STDOUT: %i.loc4_6.1: %.1 = param i // CHECK:STDOUT: @F.%i: %.1 = bind_name i, %i.loc4_6.1 // CHECK:STDOUT: } @@ -219,7 +222,7 @@ private interface Redecl {} // CHECK:STDOUT: // CHECK:STDOUT: interface @Def { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: @@ -291,17 +294,20 @@ private interface Redecl {} // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%.1] +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .ForwardWithDef [private] = %import_ref.1 +// CHECK:STDOUT: .ForwardWithDef [private] = imports.%import_ref.1 // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+1, loaded [template = constants.%.1] -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+4, unloaded // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, %import_ref.1 [template = constants.%.1] +// CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%import_ref.1 [template = constants.%.1] // CHECK:STDOUT: %i.loc4_6.1: %.1 = param i // CHECK:STDOUT: @F.%i: %.1 = bind_name i, %i.loc4_6.1 // CHECK:STDOUT: } @@ -309,7 +315,7 @@ private interface Redecl {} // CHECK:STDOUT: // CHECK:STDOUT: interface @ForwardWithDef { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: witness = () // 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 ef115db2cc53..fb737a742eee 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -44,6 +44,15 @@ interface I { // CHECK:STDOUT: %.13: %.12 = assoc_entity element3, @I.%N [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -52,12 +61,6 @@ interface I { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 6f6fcd665e16..93cab32071ee 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -23,6 +23,11 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %.4: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -31,8 +36,6 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A() { diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 35453078973f..f98c28913a8c 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -32,6 +32,16 @@ fn F() -> i32 { // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5, %.6, %.7) [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,19 +49,12 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // 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_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 32f14cc0d94e..b71cd0859714 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -31,6 +31,11 @@ fn F() { // CHECK:STDOUT: %.3: i32 = int_literal 2 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,8 +44,6 @@ fn F() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 5b9786aa0e6d..c19f73387012 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -34,6 +34,12 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %.2: i32 = int_literal 5 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,8 +47,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc12_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_32.loc12_9 [template = i32] @@ -54,7 +58,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %.loc12_17.2: type = converted %int.make_type_32.loc12_17, %.loc12_17.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 5855ca43b49e..f04f74d6c204 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -33,6 +33,10 @@ let a: T = 0; // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,7 +44,6 @@ let a: T = 0; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -61,18 +64,21 @@ let a: T = 0; // CHECK:STDOUT: %.1: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+3, loaded [symbolic = constants.%T] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .T = %import_ref +// CHECK:STDOUT: .T = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = @__global_init.%a // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+3, loaded [symbolic = constants.%T] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %T.ref: type = name_ref T, %import_ref [symbolic = constants.%T] +// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%import_ref [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index 04077872525e..255ad13ec704 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -31,6 +31,11 @@ fn F() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,13 +44,11 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32, %.loc15_8.1 [template = i32] // CHECK:STDOUT: %n: i32 = bind_name n, // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 1c0947730249..fb2b939e29f3 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -92,6 +92,17 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -106,35 +117,27 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_18.2: type = converted %int.make_type_32.loc15, %.loc15_18.1 [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_16.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] // CHECK:STDOUT: %.loc21_16.2: type = converted %int.make_type_32.loc21, %.loc21_16.1 [template = i32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc27_14.1: type = value_of_initializer %int.make_type_32.loc27 [template = i32] // CHECK:STDOUT: %.loc27_14.2: type = converted %int.make_type_32.loc27, %.loc27_14.1 [template = i32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc33: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc33_16.1: type = value_of_initializer %int.make_type_32.loc33 [template = i32] // CHECK:STDOUT: %.loc33_16.2: type = converted %int.make_type_32.loc33, %.loc33_16.1 [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc46: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc46_22.1: type = value_of_initializer %int.make_type_32.loc46 [template = i32] // CHECK:STDOUT: %.loc46_22.2: type = converted %int.make_type_32.loc46, %.loc46_22.1 [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc59: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc59_24.1: type = value_of_initializer %int.make_type_32.loc59 [template = i32] // CHECK:STDOUT: %.loc59_24.2: type = converted %int.make_type_32.loc59, %.loc59_24.1 [template = i32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc72: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc72_26.1: type = value_of_initializer %int.make_type_32.loc72 [template = i32] // CHECK:STDOUT: %.loc72_26.2: type = converted %int.make_type_32.loc72, %.loc72_26.1 [template = i32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc84: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc84_28.1: type = value_of_initializer %int.make_type_32.loc84 [template = i32] // CHECK:STDOUT: %.loc84_28.2: type = converted %int.make_type_32.loc84, %.loc84_28.1 [template = i32] diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index 4b5ae8582f4d..298f71f56abb 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -25,6 +25,10 @@ fn F() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,7 +37,6 @@ fn F() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index 24ef890ea5ee..edfdf973eee2 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -26,6 +26,10 @@ fn F() { // CHECK:STDOUT: %.2: type = ptr_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,7 +38,6 @@ fn F() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index c150e69ad3cc..6b98034d49c3 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -30,6 +30,10 @@ var b: T = *a; // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,7 +41,6 @@ var b: T = *a; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -58,9 +61,13 @@ var b: T = *a; // CHECK:STDOUT: %.1: type = ptr_type %T [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+3, loaded [symbolic = constants.%T] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .T = %import_ref +// CHECK:STDOUT: .T = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b @@ -68,13 +75,12 @@ var b: T = *a; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref: type = import_ref ir0, inst+3, loaded [symbolic = constants.%T] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %import_ref [symbolic = constants.%T] +// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, imports.%import_ref [symbolic = constants.%T] // CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var -// CHECK:STDOUT: %T.ref.loc5: type = name_ref T, %import_ref [symbolic = constants.%T] +// CHECK:STDOUT: %T.ref.loc5: type = name_ref T, imports.%import_ref [symbolic = constants.%T] // 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 7cc0be0561ae..2cdf78d783af 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -23,6 +23,11 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -31,11 +36,9 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index 1fda97821ad3..828ac15e6c26 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -23,6 +23,12 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,8 +36,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -43,7 +47,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/let/no_prelude/import.carbon b/toolchain/check/testdata/let/no_prelude/import.carbon index cbfd984f5b20..b725859c0724 100644 --- a/toolchain/check/testdata/let/no_prelude/import.carbon +++ b/toolchain/check/testdata/let/no_prelude/import.carbon @@ -65,21 +65,24 @@ let b:! () = Other.a; // CHECK:STDOUT: %b: %.1 = bind_symbolic_name b 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %.1 = import_ref ir0, inst+4, loaded [symbolic = constants.%a] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a = %import_ref +// CHECK:STDOUT: .a = imports.%import_ref // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %.1 = import_ref ir0, inst+4, loaded [symbolic = constants.%a] // CHECK:STDOUT: %.loc4_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: %.1 = name_ref a, file.%import_ref [symbolic = constants.%a] +// CHECK:STDOUT: %a.ref: %.1 = name_ref a, imports.%import_ref [symbolic = constants.%a] // CHECK:STDOUT: %b: %.1 = bind_symbolic_name b 0, %a.ref [symbolic = constants.%b] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -117,6 +120,10 @@ let b:! () = Other.a; // CHECK:STDOUT: %b: %.1 = bind_symbolic_name b 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %.1 = import_ref ir1, inst+4, loaded [symbolic = constants.%a] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -126,13 +133,12 @@ let b:! () = Other.a; // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %.loc4_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%.1 [template = constants.%.1] -// CHECK:STDOUT: %import_ref: %.1 = import_ref ir1, inst+4, loaded [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Other.ref: = name_ref Other, file.%Other [template = file.%Other] -// CHECK:STDOUT: %a.ref: %.1 = name_ref a, file.%import_ref [symbolic = constants.%a] +// CHECK:STDOUT: %a.ref: %.1 = name_ref a, imports.%import_ref [symbolic = constants.%a] // CHECK:STDOUT: %b: %.1 = bind_symbolic_name b 0, %a.ref [symbolic = constants.%b] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index e4dc7684ffdb..746004d7ec7a 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -81,21 +81,24 @@ let v2: () = Test.v; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %.1 = import_ref ir0, inst+4, loaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .v [private] = %import_ref +// CHECK:STDOUT: .v [private] = imports.%import_ref // CHECK:STDOUT: .v2 = @__global_init.%v2 // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %.1 = import_ref ir0, inst+4, loaded // CHECK:STDOUT: %.loc4_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v.ref: %.1 = name_ref v, file.%import_ref +// CHECK:STDOUT: %v.ref: %.1 = name_ref v, imports.%import_ref // CHECK:STDOUT: %v2: %.1 = bind_name v2, %v.ref // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index 0070f1262239..5c14edcf5c53 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -25,6 +25,12 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -32,8 +38,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -45,7 +49,6 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index 1987cef537b9..e4eaa86556ba 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -45,6 +45,11 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS @@ -54,19 +59,17 @@ var a: i32 = NS.A(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1: = import_ref ir0, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: %import_ref: = import_ref ir0, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_14.2: type = converted %int.make_type_32.loc4, %.loc4_14.1 [template = i32] // CHECK:STDOUT: @A.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index 32949b515b93..f8615c3c49b1 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -35,6 +35,12 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %D: %D.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -51,14 +57,12 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: } // CHECK:STDOUT: %NS.ref.loc13: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %ns: = bind_alias ns, %NS [template = %NS] -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_14.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_14.2: type = converted %int.make_type_32.loc15, %.loc15_14.1 [template = i32] // CHECK:STDOUT: @A.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %int.make_type_32.loc17 [template = i32] @@ -68,7 +72,6 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: %NS.ref.loc19: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %C: %A.type = bind_alias C, %A.decl [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] { // CHECK:STDOUT: %int.make_type_32.loc21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32.loc21 [template = i32] 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 c0191d68b001..127c4454b0c6 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -73,14 +73,17 @@ fn NS.Foo(); // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %NS.type = import_ref ir1, inst+3, loaded [template = constants.%NS] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %import_ref +// CHECK:STDOUT: .NS = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %NS.type = import_ref ir1, inst+3, loaded [template = constants.%NS] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc16: = namespace [template] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} 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 69e66a303dd5..fb528676aa4c 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 @@ -99,6 +99,11 @@ fn NS.Bar() {} // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+4, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS @@ -106,13 +111,11 @@ fn NS.Bar() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: = import_ref ir1, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { -// CHECK:STDOUT: .Foo = %import_ref.2 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .Foo = imports.%import_ref.1 // CHECK:STDOUT: .Bar = %Bar.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} // 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 a09bf01c7415..d13485fafb20 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 @@ -99,6 +99,11 @@ fn NS.Bar() {} // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS @@ -106,13 +111,11 @@ fn NS.Bar() {} // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: = import_ref ir2, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .Foo = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir2, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .Foo = imports.%import_ref.2 // CHECK:STDOUT: .Bar = %Bar.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+4, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} // 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 8c4aad84d522..6528dd81f577 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -32,6 +32,10 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %.3: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,7 +47,6 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %ns: = bind_alias ns, %NS [template = %NS] -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index de3cf8ec8ad9..c6a94a17e0ba 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -51,6 +51,10 @@ fn D(T:! type).F() {} // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -65,7 +69,6 @@ fn D(T:! type).F() {} // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc24_16.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc24_16.2: type = converted %int.make_type_32, %.loc24_16.1 [template = i32] diff --git a/toolchain/check/testdata/namespace/imported.carbon b/toolchain/check/testdata/namespace/imported.carbon index f77ea0118963..44ef86ffc181 100644 --- a/toolchain/check/testdata/namespace/imported.carbon +++ b/toolchain/check/testdata/namespace/imported.carbon @@ -70,6 +70,11 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir0, inst+5, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir0, inst+9, loaded [template = constants.%B] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS @@ -84,15 +89,13 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %import_ref.1: = import_ref ir0, inst+3, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { -// CHECK:STDOUT: .A = %import_ref.2 +// CHECK:STDOUT: .A = imports.%import_ref.1 // CHECK:STDOUT: .ChildNS = %ChildNS // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %A.type = import_ref ir0, inst+5, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: = import_ref ir0, inst+4, loaded -// CHECK:STDOUT: %ChildNS: = namespace %import_ref.3, [template] { -// CHECK:STDOUT: .B = %import_ref.4 +// CHECK:STDOUT: %import_ref.2: = import_ref ir0, inst+4, loaded +// CHECK:STDOUT: %ChildNS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .B = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %B.type = import_ref ir0, inst+9, loaded [template = constants.%B] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] @@ -119,23 +122,23 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %NS.ref.loc4: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %A.ref.loc4: %A.type = name_ref A, file.%import_ref.2 [template = constants.%A] +// CHECK:STDOUT: %A.ref.loc4: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call.loc4: init %.1 = call %A.ref.loc4() // CHECK:STDOUT: assign file.%a.var, %A.call.loc4 // CHECK:STDOUT: %NS.ref.loc5: = name_ref NS, file.%NS [template = file.%NS] // CHECK:STDOUT: %ChildNS.ref.loc5: = name_ref ChildNS, file.%ChildNS [template = file.%ChildNS] -// CHECK:STDOUT: %B.ref.loc5: %B.type = name_ref B, file.%import_ref.4 [template = constants.%B] +// CHECK:STDOUT: %B.ref.loc5: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %B.call.loc5: init %.1 = call %B.ref.loc5() // CHECK:STDOUT: assign file.%b.var, %B.call.loc5 // CHECK:STDOUT: %package.ref.loc7: = name_ref package, package [template = package] // CHECK:STDOUT: %NS.ref.loc7: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %A.ref.loc7: %A.type = name_ref A, file.%import_ref.2 [template = constants.%A] +// CHECK:STDOUT: %A.ref.loc7: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call.loc7: init %.1 = call %A.ref.loc7() // CHECK:STDOUT: assign file.%package_a.var, %A.call.loc7 // CHECK:STDOUT: %package.ref.loc8: = name_ref package, package [template = package] // CHECK:STDOUT: %NS.ref.loc8: = name_ref NS, file.%NS [template = file.%NS] // CHECK:STDOUT: %ChildNS.ref.loc8: = name_ref ChildNS, file.%ChildNS [template = file.%ChildNS] -// CHECK:STDOUT: %B.ref.loc8: %B.type = name_ref B, file.%import_ref.4 [template = constants.%B] +// CHECK:STDOUT: %B.ref.loc8: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] // CHECK:STDOUT: %B.call.loc8: init %.1 = call %B.ref.loc8() // CHECK:STDOUT: assign file.%package_b.var, %B.call.loc8 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index 1cc54929f66b..8f4de5b98e5d 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -136,6 +136,10 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %D.type = import_ref ir1, inst+10, loaded [template = constants.%D] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .A = %A @@ -154,9 +158,8 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.3: = import_ref ir1, inst+8, loaded // CHECK:STDOUT: %C: = namespace %import_ref.3, [template] { -// CHECK:STDOUT: .D = %import_ref.4 +// CHECK:STDOUT: .D = imports.%import_ref // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+10, loaded [template = constants.%D] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc5_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc5_9.2: type = converted %.loc5_9.1, constants.%.1 [template = constants.%.1] @@ -171,7 +174,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: %A.ref: = name_ref A, file.%A [template = file.%A] // CHECK:STDOUT: %B.ref: = name_ref B, file.%B [template = file.%B] // CHECK:STDOUT: %C.ref: = name_ref C, file.%C [template = file.%C] -// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%import_ref.4 [template = constants.%D] +// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%e.var, %D.call // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/namespace/merging.carbon b/toolchain/check/testdata/namespace/merging.carbon index f1f39715328d..db916ea03510 100644 --- a/toolchain/check/testdata/namespace/merging.carbon +++ b/toolchain/check/testdata/namespace/merging.carbon @@ -124,6 +124,12 @@ fn Run() { // CHECK:STDOUT: %B2: %B2.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+4, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.2: %B1.type = import_ref ir2, inst+4, loaded [template = constants.%B1] +// CHECK:STDOUT: %import_ref.3: %B2.type = import_ref ir2, inst+10, loaded [template = constants.%B2] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS @@ -132,16 +138,13 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: = import_ref ir1, inst+3, 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: %import_ref: = import_ref ir1, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B1 = imports.%import_ref.2 +// CHECK:STDOUT: .B2 = imports.%import_ref.3 // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %A.type = import_ref ir1, inst+4, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.3: %B1.type = import_ref ir2, inst+4, loaded [template = constants.%B1] -// CHECK:STDOUT: %import_ref.4: %B2.type = import_ref ir2, inst+10, loaded [template = constants.%B2] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc7: = namespace [template] {} // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} @@ -156,13 +159,13 @@ fn Run() { // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %NS.ref.loc12: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.2 [template = constants.%A] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() // CHECK:STDOUT: %NS.ref.loc13: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %B1.ref: %B1.type = name_ref B1, file.%import_ref.3 [template = constants.%B1] +// CHECK:STDOUT: %B1.ref: %B1.type = name_ref B1, imports.%import_ref.2 [template = constants.%B1] // CHECK:STDOUT: %B1.call: init %.1 = call %B1.ref() // CHECK:STDOUT: %NS.ref.loc14: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %B2.ref: %B2.type = name_ref B2, file.%import_ref.4 [template = constants.%B2] +// CHECK:STDOUT: %B2.ref: %B2.type = name_ref B2, imports.%import_ref.3 [template = constants.%B2] // CHECK:STDOUT: %B2.call: init %.1 = call %B2.ref() // CHECK:STDOUT: %NS.ref.loc15: = name_ref NS, file.%NS [template = file.%NS] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 7b6e1e90e066..28b3f0cd3a7e 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -43,6 +43,11 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %.3: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -60,14 +65,12 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %M: = namespace [template] { // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_15.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_15.2: type = converted %int.make_type_32, %.loc18_15.1 [template = i32] // CHECK:STDOUT: @B.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A.1(); diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index 82e0532ee1c0..6dc23614ef9a 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -47,6 +47,18 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %PartialConstant: %PartialConstant.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -58,21 +70,18 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] // CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11, %.loc11_11.1 [template = bool] // CHECK:STDOUT: @F.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] // CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type.loc12, %.loc12_11.1 [template = bool] // CHECK:STDOUT: @G.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { // CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] @@ -80,11 +89,6 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: @And.%return: ref bool = var // CHECK:STDOUT: } // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] { // CHECK:STDOUT: %bool.make_type.loc25: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc25_23.1: type = value_of_initializer %bool.make_type.loc25 [template = bool] @@ -92,7 +96,6 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %x.loc25_20.1: bool = param x // CHECK:STDOUT: @PartialConstant.%x: bool = bind_name x, %x.loc25_20.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index b4d31fd020cf..eff643d3aec5 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -54,6 +54,15 @@ fn Main() { // CHECK:STDOUT: %.17: i32 = int_literal 10 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -62,12 +71,6 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { 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 9019147dde39..479e71b763d7 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 @@ -58,8 +58,14 @@ var or_: F(true or true); // CHECK:STDOUT: %.4: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%.3] +// CHECK:STDOUT: %.loc42_17: bool = block_arg [template = constants.%.3] // CHECK:STDOUT: %F.call: init type = call (%.loc42_17) // CHECK:STDOUT: %.loc42_24.1: type = value_of_initializer %F.call // CHECK:STDOUT: %.loc42_24.2: type = converted %F.call, %.loc42_24.1 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 3f3a2613cef0..ca87c2035349 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 @@ -55,6 +55,12 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %.3: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -62,7 +68,6 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %bool.make_type [template = bool] @@ -70,8 +75,6 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %x.loc4_20.1: bool = param x // CHECK:STDOUT: @PartialConstant.%x: bool = bind_name x, %x.loc4_20.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; @@ -148,6 +151,12 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %.3: bool = bool_literal true [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -155,7 +164,6 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %KnownValueButNonConstantCondition.decl: %KnownValueButNonConstantCondition.type = fn_decl @KnownValueButNonConstantCondition [template = constants.%KnownValueButNonConstantCondition] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %bool.make_type [template = bool] @@ -163,8 +171,6 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: %x.loc4_38.1: bool = param x // CHECK:STDOUT: @KnownValueButNonConstantCondition.%x: bool = bind_name x, %x.loc4_38.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; 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 f3ef05a04e62..e9e5d854de1f 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 @@ -84,6 +84,14 @@ fn Main() { // CHECK:STDOUT: %.13: i32 = int_literal 10 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -92,7 +100,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // 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_11.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -100,10 +107,6 @@ fn Main() { // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; 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 6e54da30f9ce..879dc20f809f 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -37,6 +37,11 @@ fn Main() { // CHECK:STDOUT: %.3: i32 = int_literal 3 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -45,7 +50,6 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // 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_11.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -53,7 +57,6 @@ fn Main() { // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 4d04142e3d57..9e9c87df9c58 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -26,6 +26,10 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 12 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,7 +38,6 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { 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 35007f02ef48..373f8727fed4 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -28,6 +28,10 @@ fn Main() { // CHECK:STDOUT: %.3: f64 = float_literal 5.6000000000000005 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -36,7 +40,6 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { 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 1a326ddc9e8d..ea00f1d840a8 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -36,7 +36,17 @@ fn Main() -> i32 { // CHECK:STDOUT: %Op.type: type = fn_type @Op [template] // CHECK:STDOUT: %Op: %Op.type = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @Add, %Op.type [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, file.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// 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: type = import_ref ir4, inst+1, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.3 = import_ref ir4, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref ir4, inst+24, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5 = import_ref ir4, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+19, unloaded +// CHECK:STDOUT: %import_ref.7: type = import_ref ir4, inst+1, loaded [template = constants.%.4] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -46,26 +56,19 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] // CHECK:STDOUT: @Main.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref ir4, inst+1, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.3 = import_ref ir4, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref ir4, inst+24, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5 = import_ref ir4, inst+19, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+19, unloaded -// CHECK:STDOUT: %import_ref.7: type = import_ref ir4, inst+1, loaded [template = constants.%.4] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .Op = file.%import_ref.4 -// CHECK:STDOUT: witness = (file.%import_ref.5) +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Op = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index 79662189dba9..ee8704e668ff 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -30,7 +30,16 @@ fn Main() -> i32 { // CHECK:STDOUT: %Op.type: type = fn_type @Op [template] // CHECK:STDOUT: %Op: %Op.type = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @Add, %Op.type [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, file.%import_ref.6 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.6 [template] +// 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: type = import_ref ir4, inst+1, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.3 = import_ref ir4, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref ir4, inst+24, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5 = import_ref ir4, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+19, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -40,25 +49,19 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32, %.loc11_14.1 [template = i32] // CHECK:STDOUT: @Main.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref ir4, inst+1, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.3 = import_ref ir4, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref ir4, inst+24, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5 = import_ref ir4, inst+19, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+19, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .Op = file.%import_ref.4 -// CHECK:STDOUT: witness = (file.%import_ref.5) +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Op = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index 49f18458f91d..a95b99550377 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -47,6 +47,18 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %PartialConstant: %PartialConstant.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -58,21 +70,18 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] // CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11, %.loc11_11.1 [template = bool] // CHECK:STDOUT: @F.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] // CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type.loc12, %.loc12_11.1 [template = bool] // CHECK:STDOUT: @G.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] { // CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_12.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] @@ -80,11 +89,6 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: @Or.%return: ref bool = var // CHECK:STDOUT: } // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] { // CHECK:STDOUT: %bool.make_type.loc25: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc25_23.1: type = value_of_initializer %bool.make_type.loc25 [template = bool] @@ -92,7 +96,6 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %x.loc25_20.1: bool = param x // CHECK:STDOUT: @PartialConstant.%x: bool = bind_name x, %x.loc25_20.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index 186d83824d61..9447fd0562d3 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -35,6 +35,15 @@ fn Constant() { // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -45,8 +54,6 @@ fn Constant() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Not.decl: %Not.type = fn_decl @Not [template = constants.%Not] { // CHECK:STDOUT: %bool.make_type.loc11_11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11_11 [template = bool] @@ -58,17 +65,13 @@ fn Constant() { // CHECK:STDOUT: %.loc11_20.2: type = converted %bool.make_type.loc11_20, %.loc11_20.1 [template = bool] // CHECK:STDOUT: @Not.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %bool.make_type.loc15: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc15_15.1: type = value_of_initializer %bool.make_type.loc15 [template = bool] // CHECK:STDOUT: %.loc15_15.2: type = converted %bool.make_type.loc15, %.loc15_15.1 [template = bool] -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_16.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] // CHECK:STDOUT: %.loc16_16.2: type = converted %bool.make_type.loc16, %.loc16_16.1 [template = bool] // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index cb4a3c42c6ea..f85d9448b2fe 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Add, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @AddAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+24, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+19, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+28, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+47, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+43, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir4, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+19, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+26, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+24, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+19, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+26, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+28, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+47, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+43, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir4, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+26, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @AddAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index e94f6043591f..097de142c152 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @BitAnd, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @BitAndAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+21, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+23, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+43, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+39, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+45, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+47, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+66, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+62, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir5, inst+21, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+39, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+45, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+62, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+21, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+23, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+43, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+39, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+45, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+47, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+66, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+62, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %BitAndAssign.ref: type = name_ref BitAndAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %BitAndAssign.ref: type = name_ref BitAndAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir5, inst+21, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+39, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+45, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+62, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitAnd { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitAndAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index 488f2218ca38..0a30f84b2b6b 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -42,7 +42,16 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @BitComplement, %Op.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, file.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir5, inst+19, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+14, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -54,14 +63,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir5, inst+19, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+14, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, %C.decl [template = constants.%C] @@ -70,15 +75,13 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C.ref.loc23_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 ir5, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+14, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitComplement { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index aae30f8a92bd..4e762fdc11fc 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @BitOr, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @BitOrAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+68, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+70, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+90, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+86, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+92, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+94, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+113, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+109, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir5, inst+68, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+86, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+92, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+109, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+68, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+70, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+90, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+86, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+92, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+94, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+113, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+109, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %BitOrAssign.ref: type = name_ref BitOrAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %BitOrAssign.ref: type = name_ref BitOrAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir5, inst+68, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+86, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+92, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+109, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitOr { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitOrAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index ce8fadfba53e..fad60815122e 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @BitXor, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @BitXorAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+115, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+117, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+137, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+133, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+139, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+141, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+160, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+156, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir5, inst+115, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+133, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+139, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+156, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+115, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+117, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+137, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+133, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+139, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+141, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+160, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+156, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %BitXorAssign.ref: type = name_ref BitXorAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %BitXorAssign.ref: type = name_ref BitXorAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir5, inst+115, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+133, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+139, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+156, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitXor { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @BitXorAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index c40ad4e75672..19b500304161 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -43,7 +43,16 @@ fn TestOp() { // CHECK:STDOUT: %.7: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Dec, %Op.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, file.%import_ref.6 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+133, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+135, unloaded +// CHECK:STDOUT: %import_ref.3: %.8 = import_ref ir4, inst+149, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+145, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+133, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+145, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -55,25 +64,19 @@ fn TestOp() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+133, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+135, unloaded -// CHECK:STDOUT: %import_ref.3: %.8 = import_ref ir4, inst+149, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+145, loaded [template = constants.%Op.2] // 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] -// CHECK:STDOUT: %Dec.ref: type = name_ref Dec, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Dec.ref: type = name_ref Dec, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+133, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+145, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Dec { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index e2d906d5708f..4923ab5de87c 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Div, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @DivAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+198, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+200, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+220, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+216, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+222, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+224, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+243, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+239, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir4, inst+198, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+216, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+222, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+239, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+198, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+200, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+220, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+216, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Div.ref: type = name_ref Div, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Div.ref: type = name_ref Div, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+222, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+224, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+243, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+239, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %DivAssign.ref: type = name_ref DivAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %DivAssign.ref: type = name_ref DivAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir4, inst+198, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+216, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+222, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+239, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Div { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @DivAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index d8f74634a51e..fa6198319d96 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -102,11 +102,28 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Eq, %Equal.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, file.%import_ref.11 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [template] // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template] // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Eq, %NotEqual.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, file.%import_ref.14 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.14 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir6, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir6, inst+5, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir6, inst+30, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %.8 = import_ref ir6, inst+50, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref ir6, inst+26, loaded [template = constants.%Equal.2] +// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref ir6, inst+46, loaded [template = constants.%NotEqual.2] +// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: type = import_ref ir6, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.11 = import_ref ir6, inst+26, unloaded +// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.13: type = import_ref ir6, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.14 = import_ref ir6, inst+46, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -119,20 +136,11 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir6, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir6, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir6, inst+30, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref ir6, inst+50, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref ir6, inst+26, loaded [template = constants.%Equal.2] -// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref ir6, inst+46, loaded [template = constants.%NotEqual.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Eq.ref: type = name_ref Eq, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { // CHECK:STDOUT: %C.ref.loc11_17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc11_14.1: %C = param a @@ -145,9 +153,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc11_29.2: type = converted %bool.make_type.loc11, %.loc11_29.1 [template = bool] // CHECK:STDOUT: @TestEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: type = import_ref ir6, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.11 = import_ref ir6, inst+26, unloaded -// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [template = constants.%TestNotEqual] { // CHECK:STDOUT: %C.ref.loc15_20: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc15_17.1: %C = param a @@ -160,16 +165,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc15_32.2: type = converted %bool.make_type.loc15, %.loc15_32.1 [template = bool] // CHECK:STDOUT: @TestNotEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: type = import_ref ir6, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.14 = import_ref ir6, inst+46, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Eq { // CHECK:STDOUT: !members: -// 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: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Equal = imports.%import_ref.3 +// CHECK:STDOUT: .NotEqual = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5, imports.%import_ref.6) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2 { @@ -260,13 +263,27 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [template] // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @Eq, %Equal.type [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, file.%import_ref.8 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template] // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [template] // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [template] // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [template] // CHECK:STDOUT: %.7: type = assoc_entity_type @Eq, %NotEqual.type [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, file.%import_ref.11 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.11 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir6, inst+3, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.3 = import_ref ir6, inst+5, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref ir6, inst+30, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: %.7 = import_ref ir6, inst+50, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.6 = import_ref ir6, inst+26, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref ir6, inst+46, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref ir6, inst+26, unloaded +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: type = import_ref ir6, inst+3, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.11 = import_ref ir6, inst+46, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -279,7 +296,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { // CHECK:STDOUT: %D.ref.loc6_17: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc6_14.1: %D = param a @@ -292,14 +308,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc6_29.2: type = converted %bool.make_type.loc6, %.loc6_29.1 [template = bool] // CHECK:STDOUT: @TestEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref ir6, inst+3, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.3 = import_ref ir6, inst+5, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref ir6, inst+30, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5: %.7 = import_ref ir6, inst+50, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.6 = import_ref ir6, inst+26, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir6, inst+46, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref ir6, inst+26, unloaded -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [template = constants.%TestNotEqual] { // CHECK:STDOUT: %D.ref.loc14_20: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc14_17.1: %D = param a @@ -312,16 +320,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc14_32.2: type = converted %bool.make_type.loc14, %.loc14_32.1 [template = bool] // CHECK:STDOUT: @TestNotEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: type = import_ref ir6, inst+3, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.11 = import_ref ir6, inst+46, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Eq { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .Equal = file.%import_ref.4 -// CHECK:STDOUT: .NotEqual = file.%import_ref.5 -// CHECK:STDOUT: witness = (file.%import_ref.6, file.%import_ref.7) +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Equal = imports.%import_ref.4 +// CHECK:STDOUT: .NotEqual = imports.%import_ref.5 +// CHECK:STDOUT: witness = (imports.%import_ref.6, imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { @@ -373,11 +379,28 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %TestRhsBad: %TestRhsBad.type = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Eq, %Equal.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, file.%import_ref.11 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [template] // CHECK:STDOUT: %TestLhsBad.type: type = fn_type @TestLhsBad [template] // CHECK:STDOUT: %TestLhsBad: %TestLhsBad.type = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Eq, %NotEqual.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, file.%import_ref.14 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.14 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir6, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir6, inst+5, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir6, inst+30, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %.8 = import_ref ir6, inst+50, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref ir6, inst+26, loaded [template = constants.%Equal.2] +// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref ir6, inst+46, loaded [template = constants.%NotEqual.2] +// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.10: type = import_ref ir6, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.11 = import_ref ir6, inst+26, unloaded +// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.13: type = import_ref ir6, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.14 = import_ref ir6, inst+46, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -392,20 +415,11 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %Core: = namespace %Core.import, [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 ir6, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir6, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir6, inst+30, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref ir6, inst+50, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref ir6, inst+26, loaded [template = constants.%Equal.2] -// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref ir6, inst+46, loaded [template = constants.%NotEqual.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Eq.ref: type = name_ref Eq, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [template = constants.%TestRhsBad] { // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc12_15.1: %C = param a @@ -418,9 +432,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc12_30.2: type = converted %bool.make_type.loc12, %.loc12_30.1 [template = bool] // CHECK:STDOUT: @TestRhsBad.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.10: type = import_ref ir6, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.11 = import_ref ir6, inst+26, unloaded -// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestLhsBad.decl: %TestLhsBad.type = fn_decl @TestLhsBad [template = constants.%TestLhsBad] { // CHECK:STDOUT: %D.ref.loc23: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc23_15.1: %D = param a @@ -433,16 +444,14 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %.loc23_30.2: type = converted %bool.make_type.loc23, %.loc23_30.1 [template = bool] // CHECK:STDOUT: @TestLhsBad.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.13: type = import_ref ir6, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.14 = import_ref ir6, inst+46, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Eq { // CHECK:STDOUT: !members: -// 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: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Equal = imports.%import_ref.3 +// CHECK:STDOUT: .NotEqual = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5, imports.%import_ref.6) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2 { 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 111469085c09..5eb4b09f69b5 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -67,11 +67,26 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %TestIncNonRef: %TestIncNonRef.type = struct_value () [template] // CHECK:STDOUT: %.10: type = ptr_type %.1 [template] // CHECK:STDOUT: %.11: type = assoc_entity_type @Inc, %Op.type.2 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAddAssignNonRef.type: type = fn_type @TestAddAssignNonRef [template] // CHECK:STDOUT: %TestAddAssignNonRef: %TestAddAssignNonRef.type = struct_value () [template] // CHECK:STDOUT: %.13: type = assoc_entity_type @AddAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+49, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+51, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref ir4, inst+65, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+61, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+26, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+28, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref ir4, inst+47, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+43, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir4, inst+49, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+61, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+26, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -84,31 +99,21 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+49, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+51, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref ir4, inst+65, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+61, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+26, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+28, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref ir4, inst+47, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+43, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc18: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, %import_ref.5 [template = constants.%.7] +// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestIncNonRef.decl: %TestIncNonRef.type = fn_decl @TestIncNonRef [template = constants.%TestIncNonRef] { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc22_18.1: %C = param a // CHECK:STDOUT: @TestIncNonRef.%a: %C = bind_name a, %a.loc22_18.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.9: type = import_ref ir4, inst+49, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+61, unloaded // CHECK:STDOUT: %TestAddAssignNonRef.decl: %TestAddAssignNonRef.type = fn_decl @TestAddAssignNonRef [template = constants.%TestAddAssignNonRef] { // CHECK:STDOUT: %C.ref.loc33_27: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc33_24.1: %C = param a @@ -117,22 +122,20 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %b.loc33_30.1: %C = param b // CHECK:STDOUT: @TestAddAssignNonRef.%b: %C = bind_name b, %b.loc33_30.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+26, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Inc { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @AddAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index 01e0d7c7e4c2..4ad2a82fe2b6 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -55,7 +55,7 @@ fn TestRef(b: C) { // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @Negate, %Op.type.1 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, file.%import_ref.5 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: %TestBinary.type: type = fn_type @TestBinary [template] // CHECK:STDOUT: %TestBinary: %TestBinary.type = struct_value () [template] // CHECK:STDOUT: %.7: type = interface_type @Add [template] @@ -63,7 +63,7 @@ fn TestRef(b: C) { // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Add, %Op.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestRef.type: type = fn_type @TestRef [template] // CHECK:STDOUT: %TestRef: %TestRef.type = struct_value () [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] @@ -73,14 +73,37 @@ fn TestRef(b: C) { // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.3 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @AddAssign, %Op.type.3 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.15 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.15 [template] // CHECK:STDOUT: %.14: type = interface_type @Inc [template] // CHECK:STDOUT: %Self.4: %.14 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: %.15: type = ptr_type %Self.4 [symbolic] // CHECK:STDOUT: %Op.type.4: type = fn_type @Op.4 [template] // CHECK:STDOUT: %Op.4: %Op.type.4 = struct_value () [template] // CHECK:STDOUT: %.16: type = assoc_entity_type @Inc, %Op.type.4 [template] -// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, file.%import_ref.20 [template] +// CHECK:STDOUT: %.17: %.16 = assoc_entity element0, imports.%import_ref.20 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+67, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+69, unloaded +// CHECK:STDOUT: %import_ref.3: %.5 = import_ref ir4, inst+84, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.4 = import_ref ir4, inst+80, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir4, inst+80, unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref ir4, inst+1, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.7 = import_ref ir4, inst+3, unloaded +// CHECK:STDOUT: %import_ref.8: %.8 = import_ref ir4, inst+24, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.9 = import_ref ir4, inst+19, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+19, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+26, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+28, unloaded +// CHECK:STDOUT: %import_ref.13: %.12 = import_ref ir4, inst+47, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.14 = import_ref ir4, inst+43, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref ir4, inst+43, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref ir4, inst+49, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.17 = import_ref ir4, inst+51, unloaded +// CHECK:STDOUT: %import_ref.18: %.16 = import_ref ir4, inst+65, loaded [template = constants.%.17] +// CHECK:STDOUT: %import_ref.19 = import_ref ir4, inst+61, unloaded +// CHECK:STDOUT: %import_ref.20 = import_ref ir4, inst+61, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -101,11 +124,6 @@ fn TestRef(b: C) { // CHECK:STDOUT: %C.ref.loc15_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 ir4, inst+67, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+69, unloaded -// CHECK:STDOUT: %import_ref.3: %.5 = import_ref ir4, inst+84, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.4 = import_ref ir4, inst+80, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir4, inst+80, unloaded // CHECK:STDOUT: %TestBinary.decl: %TestBinary.type = fn_decl @TestBinary [template = constants.%TestBinary] { // CHECK:STDOUT: %C.ref.loc23_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc23_15.1: %C = param a @@ -116,54 +134,39 @@ fn TestRef(b: C) { // CHECK:STDOUT: %C.ref.loc23_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 ir4, inst+1, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.7 = import_ref ir4, inst+3, unloaded -// CHECK:STDOUT: %import_ref.8: %.8 = import_ref ir4, inst+24, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.9 = import_ref ir4, inst+19, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+19, unloaded // CHECK:STDOUT: %TestRef.decl: %TestRef.type = fn_decl @TestRef [template = constants.%TestRef] { // CHECK:STDOUT: %C.ref.loc31: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %b.loc31_12.1: %C = param b // CHECK:STDOUT: @TestRef.%b: %C = bind_name b, %b.loc31_12.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+26, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+28, unloaded -// CHECK:STDOUT: %import_ref.13: %.12 = import_ref ir4, inst+47, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.14 = import_ref ir4, inst+43, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref ir4, inst+43, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref ir4, inst+49, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.17 = import_ref ir4, inst+51, unloaded -// CHECK:STDOUT: %import_ref.18: %.16 = import_ref ir4, inst+65, loaded [template = constants.%.17] -// CHECK:STDOUT: %import_ref.19 = import_ref ir4, inst+61, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref ir4, inst+61, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Negate { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.7 -// CHECK:STDOUT: .Op = file.%import_ref.8 -// CHECK:STDOUT: witness = (file.%import_ref.9) +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: .Op = imports.%import_ref.8 +// CHECK:STDOUT: witness = (imports.%import_ref.9) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @AddAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.12 -// CHECK:STDOUT: .Op = file.%import_ref.13 -// CHECK:STDOUT: witness = (file.%import_ref.14) +// CHECK:STDOUT: .Self = imports.%import_ref.12 +// CHECK:STDOUT: .Op = imports.%import_ref.13 +// CHECK:STDOUT: witness = (imports.%import_ref.14) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Inc { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.17 -// CHECK:STDOUT: .Op = file.%import_ref.18 -// CHECK:STDOUT: witness = (file.%import_ref.19) +// CHECK:STDOUT: .Self = imports.%import_ref.17 +// CHECK:STDOUT: .Op = imports.%import_ref.18 +// CHECK:STDOUT: witness = (imports.%import_ref.19) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { 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 585ef3fb18f8..8e38749f83c4 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 @@ -69,12 +69,27 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %.9: type = ptr_type %.1 [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Add, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @AddAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+24, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+19, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+26, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+28, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+47, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+43, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir4, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+19, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+26, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -89,23 +104,15 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Core: = namespace %Core.import, [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 ir4, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+24, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+19, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc16: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+26, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+28, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+47, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+43, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc19: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, %import_ref.5 [template = constants.%.5] +// CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.5] // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] { // CHECK:STDOUT: %C.ref.loc23_12: type = name_ref C, %C.decl [template = constants.%C] @@ -117,29 +124,25 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %C.ref.loc23_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 ir4, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+19, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %D.ref.loc34: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %b.loc34_15.1: %D = param b // CHECK:STDOUT: @TestAssign.%b: %D = bind_name b, %b.loc34_15.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+26, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+43, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Add { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @AddAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index b761891dde45..5c7db3272a5d 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -43,7 +43,16 @@ fn TestOp() { // CHECK:STDOUT: %.7: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Inc, %Op.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, file.%import_ref.6 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+49, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+51, unloaded +// CHECK:STDOUT: %import_ref.3: %.8 = import_ref ir4, inst+65, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+61, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+49, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+61, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -55,25 +64,19 @@ fn TestOp() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+49, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+51, unloaded -// CHECK:STDOUT: %import_ref.3: %.8 = import_ref ir4, inst+65, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+61, loaded [template = constants.%Op.2] // 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] -// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+49, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+61, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Inc { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index d377ce33e90c..019c29a49f60 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @LeftShift, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @LeftShiftAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+162, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+164, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+184, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+180, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+186, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+188, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+207, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+203, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir5, inst+162, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+180, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+186, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+203, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+162, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+164, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+184, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+180, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+186, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+188, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+207, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+203, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %LeftShiftAssign.ref: type = name_ref LeftShiftAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %LeftShiftAssign.ref: type = name_ref LeftShiftAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir5, inst+162, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+180, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+186, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+203, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @LeftShift { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @LeftShiftAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index 050fff869d04..f6922c6c2da5 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Mod, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @ModAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+245, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+247, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+267, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+263, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+269, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+271, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+290, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+286, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir4, inst+245, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+263, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+269, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+286, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+245, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+247, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+267, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+263, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Mod.ref: type = name_ref Mod, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Mod.ref: type = name_ref Mod, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+269, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+271, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+290, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+286, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %ModAssign.ref: type = name_ref ModAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %ModAssign.ref: type = name_ref ModAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir4, inst+245, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+263, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+269, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+286, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Mod { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @ModAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index fe97fdda8b79..86ad023d1d43 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Mul, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @MulAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+151, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+153, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+173, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+169, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+175, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+177, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+196, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+192, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir4, inst+151, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+169, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+175, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+192, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+151, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+153, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+173, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+169, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Mul.ref: type = name_ref Mul, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Mul.ref: type = name_ref Mul, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+175, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+177, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+196, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+192, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %MulAssign.ref: type = name_ref MulAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %MulAssign.ref: type = name_ref MulAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir4, inst+151, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+169, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+175, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+192, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Mul { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @MulAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index dd7b8d4befc5..547d651a919d 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -42,7 +42,16 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Negate, %Op.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, file.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+67, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+69, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir4, inst+84, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+80, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+67, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+80, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -54,14 +63,10 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+67, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+69, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir4, inst+84, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+80, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Negate.ref: type = name_ref Negate, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Negate.ref: type = name_ref Negate, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, %C.decl [template = constants.%C] @@ -70,15 +75,13 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %C.ref.loc23_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 ir4, inst+67, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+80, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Negate { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 4872ac2a0a30..790ce59748a8 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -105,19 +105,48 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Ordered, %Less.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, file.%import_ref.17 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.17 [template] // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [template] // CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Ordered, %LessOrEquivalent.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, file.%import_ref.20 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.20 [template] // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [template] // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Ordered, %Greater.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element2, file.%import_ref.23 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element2, imports.%import_ref.23 [template] // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [template] // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @Ordered, %GreaterOrEquivalent.type.2 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element3, file.%import_ref.26 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element3, imports.%import_ref.26 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir6, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir6, inst+54, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir6, inst+74, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %.8 = import_ref ir6, inst+94, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: %.10 = import_ref ir6, inst+114, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.6: %.12 = import_ref ir6, inst+134, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.7: %Less.type.2 = import_ref ir6, inst+70, loaded [template = constants.%Less.2] +// CHECK:STDOUT: %import_ref.8: %LessOrEquivalent.type.2 = import_ref ir6, inst+90, loaded [template = constants.%LessOrEquivalent.2] +// CHECK:STDOUT: %import_ref.9: %Greater.type.2 = import_ref ir6, inst+110, loaded [template = constants.%Greater.2] +// CHECK:STDOUT: %import_ref.10: %GreaterOrEquivalent.type.2 = import_ref ir6, inst+130, loaded [template = constants.%GreaterOrEquivalent.2] +// CHECK:STDOUT: %import_ref.11: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.14: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.15: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.16: type = import_ref ir6, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.17 = import_ref ir6, inst+70, unloaded +// CHECK:STDOUT: %import_ref.18: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.19: type = import_ref ir6, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.20 = import_ref ir6, inst+90, unloaded +// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.22: type = import_ref ir6, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.23 = import_ref ir6, inst+110, unloaded +// CHECK:STDOUT: %import_ref.24: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.25: type = import_ref ir6, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.26 = import_ref ir6, inst+130, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -132,26 +161,11 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir6, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir6, inst+54, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref ir6, inst+74, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref ir6, inst+94, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: %.10 = import_ref ir6, inst+114, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.6: %.12 = import_ref ir6, inst+134, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.7: %Less.type.2 = import_ref ir6, inst+70, loaded [template = constants.%Less.2] -// CHECK:STDOUT: %import_ref.8: %LessOrEquivalent.type.2 = import_ref ir6, inst+90, loaded [template = constants.%LessOrEquivalent.2] -// CHECK:STDOUT: %import_ref.9: %Greater.type.2 = import_ref ir6, inst+110, loaded [template = constants.%Greater.2] -// CHECK:STDOUT: %import_ref.10: %GreaterOrEquivalent.type.2 = import_ref ir6, inst+130, loaded [template = constants.%GreaterOrEquivalent.2] // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Ordered.ref: type = name_ref Ordered, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Ordered.ref: type = name_ref Ordered, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.14: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.15: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { // CHECK:STDOUT: %C.ref.loc13_16: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc13_13.1: %C = param a @@ -164,9 +178,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc13_28.2: type = converted %bool.make_type.loc13, %.loc13_28.1 [template = bool] // CHECK:STDOUT: @TestLess.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.16: type = import_ref ir6, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.17 = import_ref ir6, inst+70, unloaded -// CHECK:STDOUT: %import_ref.18: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [template = constants.%TestLessEqual] { // CHECK:STDOUT: %C.ref.loc17_21: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc17_18.1: %C = param a @@ -179,9 +190,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc17_33.2: type = converted %bool.make_type.loc17, %.loc17_33.1 [template = bool] // CHECK:STDOUT: @TestLessEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.19: type = import_ref ir6, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.20 = import_ref ir6, inst+90, unloaded -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [template = constants.%TestGreater] { // CHECK:STDOUT: %C.ref.loc21_19: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc21_16.1: %C = param a @@ -194,9 +202,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc21_31.2: type = converted %bool.make_type.loc21, %.loc21_31.1 [template = bool] // CHECK:STDOUT: @TestGreater.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.22: type = import_ref ir6, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.23 = import_ref ir6, inst+110, unloaded -// CHECK:STDOUT: %import_ref.24: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [template = constants.%TestGreaterEqual] { // CHECK:STDOUT: %C.ref.loc25_24: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %a.loc25_21.1: %C = param a @@ -209,18 +214,16 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc25_36.2: type = converted %bool.make_type.loc25, %.loc25_36.1 [template = bool] // CHECK:STDOUT: @TestGreaterEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.25: type = import_ref ir6, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.26 = import_ref ir6, inst+130, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Ordered { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Less = file.%import_ref.3 -// CHECK:STDOUT: .LessOrEquivalent = file.%import_ref.4 -// CHECK:STDOUT: .Greater = file.%import_ref.5 -// CHECK:STDOUT: .GreaterOrEquivalent = 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: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Less = imports.%import_ref.3 +// CHECK:STDOUT: .LessOrEquivalent = imports.%import_ref.4 +// CHECK:STDOUT: .Greater = imports.%import_ref.5 +// CHECK:STDOUT: .GreaterOrEquivalent = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7, imports.%import_ref.8, imports.%import_ref.9, imports.%import_ref.10) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %C as %.2 { @@ -369,25 +372,49 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %Less.type: type = fn_type @Less [template] // CHECK:STDOUT: %Less: %Less.type = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type @Ordered, %Less.type [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.12 [template] // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [template] // CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [template] // CHECK:STDOUT: %LessOrEquivalent.type: type = fn_type @LessOrEquivalent [template] // CHECK:STDOUT: %LessOrEquivalent: %LessOrEquivalent.type = struct_value () [template] // CHECK:STDOUT: %.7: type = assoc_entity_type @Ordered, %LessOrEquivalent.type [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, file.%import_ref.15 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.15 [template] // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [template] // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [template] // CHECK:STDOUT: %Greater.type: type = fn_type @Greater [template] // CHECK:STDOUT: %Greater: %Greater.type = struct_value () [template] // CHECK:STDOUT: %.9: type = assoc_entity_type @Ordered, %Greater.type [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element2, file.%import_ref.18 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element2, imports.%import_ref.18 [template] // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [template] // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [template] // CHECK:STDOUT: %GreaterOrEquivalent.type: type = fn_type @GreaterOrEquivalent [template] // CHECK:STDOUT: %GreaterOrEquivalent: %GreaterOrEquivalent.type = struct_value () [template] // CHECK:STDOUT: %.11: type = assoc_entity_type @Ordered, %GreaterOrEquivalent.type [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element3, file.%import_ref.21 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element3, imports.%import_ref.21 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir6, inst+52, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.3 = import_ref ir6, inst+54, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref ir6, inst+74, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: %.7 = import_ref ir6, inst+94, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.6: %.9 = import_ref ir6, inst+114, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.7: %.11 = import_ref ir6, inst+134, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.8 = import_ref ir6, inst+70, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref ir6, inst+90, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref ir6, inst+110, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref ir6, inst+130, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref ir6, inst+70, unloaded +// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.14: type = import_ref ir6, inst+52, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.15 = import_ref ir6, inst+90, unloaded +// CHECK:STDOUT: %import_ref.16: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.17: type = import_ref ir6, inst+52, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.18 = import_ref ir6, inst+110, unloaded +// CHECK:STDOUT: %import_ref.19: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.20: type = import_ref ir6, inst+52, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.21 = import_ref ir6, inst+130, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -402,7 +429,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { // CHECK:STDOUT: %D.ref.loc6_16: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc6_13.1: %D = param a @@ -415,18 +441,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc6_28.2: type = converted %bool.make_type.loc6, %.loc6_28.1 [template = bool] // CHECK:STDOUT: @TestLess.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref ir6, inst+52, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.3 = import_ref ir6, inst+54, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref ir6, inst+74, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5: %.7 = import_ref ir6, inst+94, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.6: %.9 = import_ref ir6, inst+114, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.7: %.11 = import_ref ir6, inst+134, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.8 = import_ref ir6, inst+70, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref ir6, inst+90, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref ir6, inst+110, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref ir6, inst+130, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref ir6, inst+70, unloaded -// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [template = constants.%TestLessEqual] { // CHECK:STDOUT: %D.ref.loc14_21: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc14_18.1: %D = param a @@ -439,9 +453,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc14_33.2: type = converted %bool.make_type.loc14, %.loc14_33.1 [template = bool] // CHECK:STDOUT: @TestLessEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.14: type = import_ref ir6, inst+52, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.15 = import_ref ir6, inst+90, unloaded -// CHECK:STDOUT: %import_ref.16: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [template = constants.%TestGreater] { // CHECK:STDOUT: %D.ref.loc22_19: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc22_16.1: %D = param a @@ -454,9 +465,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc22_31.2: type = converted %bool.make_type.loc22, %.loc22_31.1 [template = bool] // CHECK:STDOUT: @TestGreater.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.17: type = import_ref ir6, inst+52, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.18 = import_ref ir6, inst+110, unloaded -// CHECK:STDOUT: %import_ref.19: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [template = constants.%TestGreaterEqual] { // CHECK:STDOUT: %D.ref.loc30_24: type = name_ref D, %D.decl [template = constants.%D] // CHECK:STDOUT: %a.loc30_21.1: %D = param a @@ -469,18 +477,16 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %.loc30_36.2: type = converted %bool.make_type.loc30, %.loc30_36.1 [template = bool] // CHECK:STDOUT: @TestGreaterEqual.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.20: type = import_ref ir6, inst+52, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.21 = import_ref ir6, inst+130, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Ordered { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .Less = file.%import_ref.4 -// CHECK:STDOUT: .LessOrEquivalent = file.%import_ref.5 -// CHECK:STDOUT: .Greater = file.%import_ref.6 -// CHECK:STDOUT: .GreaterOrEquivalent = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8, file.%import_ref.9, file.%import_ref.10, file.%import_ref.11) +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Less = imports.%import_ref.4 +// CHECK:STDOUT: .LessOrEquivalent = imports.%import_ref.5 +// CHECK:STDOUT: .Greater = imports.%import_ref.6 +// CHECK:STDOUT: .GreaterOrEquivalent = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8, imports.%import_ref.9, imports.%import_ref.10, imports.%import_ref.11) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index f822df2fd844..52104a5fa271 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @RightShift, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @RightShiftAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+209, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+211, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+231, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+227, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+233, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+235, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+254, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+250, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir5, inst+209, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+227, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+233, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+250, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir5, inst+209, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir5, inst+211, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir5, inst+231, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir5, inst+227, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir5, inst+233, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+235, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir5, inst+254, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir5, inst+250, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %RightShiftAssign.ref: type = name_ref RightShiftAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %RightShiftAssign.ref: type = name_ref RightShiftAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir5, inst+209, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir5, inst+227, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir5, inst+233, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir5, inst+250, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @RightShift { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @RightShiftAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 21e59b020ecd..c49d4443c2c0 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -58,11 +58,26 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Sub, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, file.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @SubAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, file.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+86, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+88, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+108, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+104, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+110, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+112, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+131, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+127, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9: type = import_ref ir4, inst+86, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+104, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+110, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+127, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -75,23 +90,15 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// CHECK:STDOUT: %import_ref.1: type = import_ref ir4, inst+86, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref ir4, inst+88, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref ir4, inst+108, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref ir4, inst+104, loaded [template = constants.%Op.2] // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %Sub.ref: type = name_ref Sub, %import_ref.1 [template = constants.%.2] +// CHECK:STDOUT: %Sub.ref: type = name_ref Sub, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: type = import_ref ir4, inst+110, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref ir4, inst+112, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref ir4, inst+131, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref ir4, inst+127, loaded [template = constants.%Op.4] // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] -// CHECK:STDOUT: %SubAssign.ref: type = name_ref SubAssign, %import_ref.5 [template = constants.%.6] +// CHECK:STDOUT: %SubAssign.ref: type = name_ref SubAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { // CHECK:STDOUT: %C.ref.loc26_14: type = name_ref C, %C.decl [template = constants.%C] @@ -103,8 +110,6 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %C.ref.loc26_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 ir4, inst+86, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref ir4, inst+104, unloaded // CHECK:STDOUT: %TestAssign.decl: %TestAssign.type = fn_decl @TestAssign [template = constants.%TestAssign] { // CHECK:STDOUT: %C.ref.loc30_18: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: %.loc30: type = ptr_type %C [template = constants.%.7] @@ -114,22 +119,20 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %b.loc30_22.1: %C = param b // CHECK:STDOUT: @TestAssign.%b: %C = bind_name b, %b.loc30_22.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.11: type = import_ref ir4, inst+110, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref ir4, inst+127, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Sub { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .Op = file.%import_ref.3 -// CHECK:STDOUT: witness = (file.%import_ref.4) +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Op = imports.%import_ref.3 +// CHECK:STDOUT: witness = (imports.%import_ref.4) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @SubAssign { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .Op = file.%import_ref.7 -// CHECK:STDOUT: witness = (file.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Op = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C as %.2 { diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 535a165b45a1..a3446cefdfde 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -25,6 +25,10 @@ fn Main() { // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,7 +37,6 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 8f601b58b65a..88f2223155a2 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -50,6 +50,11 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -58,13 +63,11 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32.loc4, %.loc4_8.1 [template = i32] // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_8.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_8.2: type = converted %int.make_type_32.loc5, %.loc5_8.1 [template = i32] @@ -97,6 +100,12 @@ fn Main() { // CHECK:STDOUT: %.3: i32 = int_literal 1 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -105,15 +114,12 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] // CHECK:STDOUT: %x.var: ref i32 = var x // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index d24916bc6885..67a56e912d03 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -67,6 +67,10 @@ import library "var"; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -74,7 +78,6 @@ import library "var"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_10.2: type = converted %int.make_type_32, %.loc4_10.1 [template = i32] @@ -86,15 +89,18 @@ import library "var"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_conflict.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+13, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Foo = %import_ref.1 +// CHECK:STDOUT: .Foo = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+13, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [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 6bc39feeb716..1f8948344a51 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -80,12 +80,23 @@ var d: i32 = d_ref; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: ref = import_ref ir0, inst+5, loaded +// CHECK:STDOUT: %import_ref.2: ref = import_ref ir0, inst+10, loaded +// CHECK:STDOUT: %import_ref.3: ref = import_ref ir0, inst+14, loaded +// CHECK:STDOUT: %import_ref.4: ref = import_ref ir0, inst+18, loaded +// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = %import_ref.1 -// CHECK:STDOUT: .b_ref = %import_ref.2 -// CHECK:STDOUT: .c_ref = %import_ref.3 -// CHECK:STDOUT: .d_ref = %import_ref.4 +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .c_ref = imports.%import_ref.3 +// CHECK:STDOUT: .d_ref = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b @@ -95,30 +106,22 @@ var d: i32 = d_ref; // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1: ref = import_ref ir0, inst+5, loaded -// CHECK:STDOUT: %import_ref.2: ref = import_ref ir0, inst+10, loaded -// CHECK:STDOUT: %import_ref.3: ref = import_ref ir0, inst+14, loaded -// CHECK:STDOUT: %import_ref.4: ref = import_ref ir0, inst+18, loaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] // CHECK:STDOUT: %a.var: ref i32 = var a // CHECK:STDOUT: %a: ref i32 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32] // CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32] // CHECK:STDOUT: %b.var: ref i32 = var b // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_8.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] // CHECK:STDOUT: %.loc8_8.2: type = converted %int.make_type_32.loc8, %.loc8_8.1 [template = i32] // CHECK:STDOUT: %c.var: ref i32 = var c // CHECK:STDOUT: %c: ref i32 = bind_name c, %c.var -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc9_8.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32] // CHECK:STDOUT: %.loc9_8.2: type = converted %int.make_type_32.loc9, %.loc9_8.1 [template = i32] @@ -130,13 +133,13 @@ var d: i32 = d_ref; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref = name_ref a_ref, file.%import_ref.1 +// CHECK:STDOUT: %a_ref.ref: ref = name_ref a_ref, imports.%import_ref.1 // CHECK:STDOUT: assign file.%a.var, -// CHECK:STDOUT: %b_ref.ref: ref = name_ref b_ref, file.%import_ref.2 +// CHECK:STDOUT: %b_ref.ref: ref = name_ref b_ref, imports.%import_ref.2 // CHECK:STDOUT: assign file.%b.var, -// CHECK:STDOUT: %c_ref.ref: ref = name_ref c_ref, file.%import_ref.3 +// CHECK:STDOUT: %c_ref.ref: ref = name_ref c_ref, imports.%import_ref.3 // CHECK:STDOUT: assign file.%c.var, -// CHECK:STDOUT: %d_ref.ref: ref = name_ref d_ref, file.%import_ref.4 +// CHECK:STDOUT: %d_ref.ref: ref = name_ref d_ref, imports.%import_ref.4 // CHECK:STDOUT: assign file.%d.var, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index 0861e4e9fbe0..3bd0ebe7bc94 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -31,6 +31,10 @@ var b: i32 = a; // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,7 +42,6 @@ var b: i32 = a; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] @@ -63,18 +66,21 @@ var b: i32 = a; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: ref i32 = import_ref ir0, inst+13, loaded +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a = %import_ref.1 +// CHECK:STDOUT: .a = imports.%import_ref.1 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .b = %b // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1: ref i32 = import_ref ir0, inst+13, loaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] @@ -86,7 +92,7 @@ var b: i32 = a; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a.ref: ref i32 = name_ref a, file.%import_ref.1 +// CHECK:STDOUT: %a.ref: ref i32 = name_ref a, imports.%import_ref.1 // CHECK:STDOUT: %.loc4: i32 = bind_value %a.ref // CHECK:STDOUT: assign file.%b.var, %.loc4 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/packages/loaded_global.carbon b/toolchain/check/testdata/packages/loaded_global.carbon index 4e284752860e..8b742ee03e87 100644 --- a/toolchain/check/testdata/packages/loaded_global.carbon +++ b/toolchain/check/testdata/packages/loaded_global.carbon @@ -66,9 +66,13 @@ var package_b: () = package.B(); // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+3, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %import_ref +// CHECK:STDOUT: .A = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .package_a = %package_a @@ -76,7 +80,6 @@ var package_b: () = package.B(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+3, loaded [template = constants.%A] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] @@ -92,11 +95,11 @@ var package_b: () = package.B(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref.loc4: %A.type = name_ref A, file.%import_ref [template = constants.%A] +// CHECK:STDOUT: %A.ref.loc4: %A.type = name_ref A, imports.%import_ref [template = constants.%A] // CHECK:STDOUT: %A.call.loc4: init %.1 = call %A.ref.loc4() // CHECK:STDOUT: assign file.%a.var, %A.call.loc4 // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] -// CHECK:STDOUT: %A.ref.loc6: %A.type = name_ref A, file.%import_ref [template = constants.%A] +// CHECK:STDOUT: %A.ref.loc6: %A.type = name_ref A, imports.%import_ref [template = constants.%A] // CHECK:STDOUT: %A.call.loc6: init %.1 = call %A.ref.loc6() // CHECK:STDOUT: assign file.%package_a.var, %A.call.loc6 // CHECK:STDOUT: return @@ -130,16 +133,19 @@ var package_b: () = package.B(); // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %B.type = import_ref ir1, inst+3, loaded [template = constants.%B] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .B = %import_ref +// CHECK:STDOUT: .B = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .package_b = %package_b // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %B.type = import_ref ir1, inst+3, loaded [template = constants.%B] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] @@ -155,11 +161,11 @@ var package_b: () = package.B(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %B.ref.loc6: %B.type = name_ref B, file.%import_ref [template = constants.%B] +// CHECK:STDOUT: %B.ref.loc6: %B.type = name_ref B, imports.%import_ref [template = constants.%B] // CHECK:STDOUT: %B.call.loc6: init %.1 = call %B.ref.loc6() // CHECK:STDOUT: assign file.%b.var, %B.call.loc6 // CHECK:STDOUT: %package.ref: = name_ref package, package [template = package] -// CHECK:STDOUT: %B.ref.loc8: %B.type = name_ref B, file.%import_ref [template = constants.%B] +// CHECK:STDOUT: %B.ref.loc8: %B.type = name_ref B, imports.%import_ref [template = constants.%B] // CHECK:STDOUT: %B.call.loc8: init %.1 = call %B.ref.loc8() // CHECK:STDOUT: assign file.%package_b.var, %B.call.loc8 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index 59eb86cea61c..c21f1eafa709 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -249,32 +249,41 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: --- export_import.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_import_copy.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_import_indirect.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir2, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir2, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name.carbon @@ -285,21 +294,24 @@ alias C = Other.C; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // 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+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name_copy.carbon @@ -310,21 +322,24 @@ alias C = Other.C; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // 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+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name_indirect.carbon @@ -335,21 +350,24 @@ alias C = Other.C; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_export_import.carbon @@ -363,6 +381,12 @@ alias C = Other.C; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -371,18 +395,15 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -409,6 +430,12 @@ alias C = Other.C; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -417,18 +444,15 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -455,6 +479,12 @@ alias C = Other.C; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -463,18 +493,15 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -501,6 +528,12 @@ alias C = Other.C; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -509,18 +542,15 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -547,6 +577,12 @@ alias C = Other.C; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -555,18 +591,15 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -593,6 +626,12 @@ alias C = Other.C; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -601,18 +640,15 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -639,6 +675,12 @@ alias C = Other.C; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+9, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+10, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -647,18 +689,15 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+10, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -702,6 +741,11 @@ alias C = Other.C; // CHECK:STDOUT: %C: %C.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %C.type = import_ref ir2, inst+1, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -710,10 +754,8 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: %C.type = import_ref ir2, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+1, unloaded -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %C: %C.type = bind_alias C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: %C.type = bind_alias C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C(); @@ -726,6 +768,13 @@ alias C = Other.C; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -734,17 +783,13 @@ alias C = Other.C; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+1, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %C: type = bind_alias C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = bind_alias C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index e6353b3b645e..5255c5d12a09 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -310,19 +310,22 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .F = %import_ref +// CHECK:STDOUT: .F = imports.%import_ref // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -350,6 +353,11 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %F2: %F2.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: %F2.type = import_ref ir2, inst+1, loaded [template = constants.%F2] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -358,17 +366,15 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2: %F2.type = import_ref ir2, inst+1, loaded [template = constants.%F2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Other.ref.loc8: = name_ref Other, file.%Other [template = file.%Other] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.1 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: %Other.ref.loc9: = name_ref Other, file.%Other [template = file.%Other] -// CHECK:STDOUT: %F2.ref: %F2.type = name_ref F2, file.%import_ref.2 [template = constants.%F2] +// CHECK:STDOUT: %F2.ref: %F2.type = name_ref F2, imports.%import_ref.2 [template = constants.%F2] // CHECK:STDOUT: %F2.call: init %.1 = call %F2.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -387,6 +393,11 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -395,14 +406,12 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Other.ref: = name_ref Other, file.%Other [template = file.%Other] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.1 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -429,6 +438,11 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -437,14 +451,12 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+6, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Other.ref: = name_ref Other, file.%Other [template = file.%Other] -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.1 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -459,15 +471,18 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %F.type = import_ref ir2, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %import_ref.1: = import_ref ir1, inst+1, loaded -// CHECK:STDOUT: %Other: = namespace %import_ref.1, [template] {} -// CHECK:STDOUT: %import_ref.2: %F.type = import_ref ir2, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded +// CHECK:STDOUT: %Other: = namespace %import_ref, [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index af21e9d437e3..298a5b86ba00 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -194,52 +194,67 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: --- export.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_copy.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- non_export.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir2, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir2, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_export.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir2, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir2, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_then_export.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_in_impl.carbon @@ -259,24 +274,27 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -303,25 +321,28 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // 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+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -348,25 +369,28 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+2, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+2, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -393,24 +417,27 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -437,24 +464,27 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -481,24 +511,27 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -525,24 +558,27 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -569,24 +605,27 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -613,24 +652,27 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir3, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir3, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir3, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -668,24 +710,27 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -712,26 +757,29 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .c = %import_ref.1 -// CHECK:STDOUT: .C = %import_ref.2 -// CHECK:STDOUT: .indirect_c = %indirect_c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+14, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref ir2, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.2 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .c = imports.%import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.2 +// CHECK:STDOUT: .indirect_c = %indirect_c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %indirect_c.var: ref %C = var indirect_c // CHECK:STDOUT: %indirect_c: ref %C = bind_name indirect_c, %indirect_c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .x = file.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index 70de8b98e1fe..be5eae1fefcc 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -156,16 +156,19 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: --- export_import.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .D = %import_ref.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .D = imports.%import_ref.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- export_import_then_name.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -174,23 +177,26 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .D = %import_ref.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+11, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir2, inst+7, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C +// CHECK:STDOUT: .D = imports.%import_ref.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .x = file.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name.carbon @@ -201,33 +207,39 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .D = %import_ref.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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+11, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+2, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C +// CHECK:STDOUT: .D = imports.%import_ref.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .x = file.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name_then_import.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+12, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_export_import_then_name.carbon @@ -241,24 +253,27 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+12, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+10, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+11, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -285,24 +300,27 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+12, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+10, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+11, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -329,24 +347,27 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+12, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+10, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+11, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -369,13 +390,16 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.2: type = struct_type {.y: %.1} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+12, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: .d = %d // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+12, unloaded // CHECK:STDOUT: %D.ref: = name_ref D, [template = ] // CHECK:STDOUT: %d.var: ref = var d // CHECK:STDOUT: %d: ref = bind_name d, %d.var @@ -400,24 +424,27 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+12, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+10, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+11, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -448,38 +475,41 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %struct.2: %D = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .D = %import_ref.2 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+12, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: type = import_ref ir5, inst+11, loaded [template = constants.%D] // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+10, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+11, 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 // CHECK:STDOUT: %import_ref.5 = import_ref ir5, inst+12, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref ir5, inst+16, unloaded -// CHECK:STDOUT: %D.ref: type = name_ref D, %import_ref.2 [template = constants.%D] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .D = imports.%import_ref.2 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %c.var: ref %C = var c +// CHECK:STDOUT: %c: ref %C = bind_name c, %c.var +// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.2 [template = constants.%D] // CHECK:STDOUT: %d.var: ref %D = var d // CHECK:STDOUT: %d: ref %D = bind_name d, %d.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 -// CHECK:STDOUT: .x = file.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 -// CHECK:STDOUT: .y = file.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .y = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index b50873c0ba13..b5db76ea3445 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -258,52 +258,58 @@ private export C; // CHECK:STDOUT: %.3: type = struct_type {.y: %.1} [template] // 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: type = import_ref ir1, inst+12, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+17, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { // CHECK:STDOUT: .NSC = %NSC // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+12, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+17, unloaded -// CHECK:STDOUT: %NSC: type = export NSC, %import_ref.3 [template = constants.%NSC] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %NSC: type = export NSC, imports.%import_ref.2 [template = constants.%NSC] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .y = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .y = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- not_reexporting.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+14, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+14, unloaded -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+22, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_export.carbon @@ -316,36 +322,39 @@ private export C; // CHECK:STDOUT: %.3: type = struct_type {.y: %.1} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { // CHECK:STDOUT: .NSC = %NSC // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+21, unloaded -// CHECK:STDOUT: %NSC: type = export NSC, %import_ref.3 [template = constants.%NSC] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %NSC: type = export NSC, imports.%import_ref.2 [template = constants.%NSC] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .y = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .y = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_in_impl.carbon @@ -369,43 +378,46 @@ private export C; // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+21, unloaded -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %import_ref.3 [template = constants.%NSC] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .y = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .y = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -444,44 +456,47 @@ private export C; // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir0, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3 = import_ref ir0, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir0, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir0, inst+21, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir0, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir0, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref ir0, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref ir0, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+13, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %import_ref.6 = import_ref ir0, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir0, inst+21, unloaded -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %import_ref.3 [template = constants.%NSC] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .y = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .y = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -520,43 +535,46 @@ private export C; // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+21, unloaded -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %import_ref.3 [template = constants.%NSC] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .y = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .y = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -582,18 +600,21 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_export_ns.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+12, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_export_decl.carbon @@ -623,26 +644,29 @@ private export C; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // 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+12, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_both.carbon @@ -660,43 +684,46 @@ private export C; // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // 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: type = import_ref ir1, inst+12, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+17, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+12, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+17, unloaded -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %import_ref.3 [template = constants.%NSC] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .y = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .y = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -735,43 +762,46 @@ private export C; // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+20, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+20, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+21, unloaded -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %import_ref.3 [template = constants.%NSC] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.6 -// CHECK:STDOUT: .y = file.%import_ref.7 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .y = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -817,27 +847,30 @@ private export C; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // 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+12, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_repeat_export.carbon @@ -851,24 +884,27 @@ private export C; // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+14, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+12, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+13, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .x = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .x = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -892,26 +928,29 @@ private export C; // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template] // 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+12, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+7, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: = import_ref ir1, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .NSC = imports.%import_ref.2 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded -// CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 -// CHECK:STDOUT: .x = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index e734ad82657c..ce299a8aa418 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -70,19 +70,22 @@ export C.n; // CHECK:STDOUT: %.2: type = struct_type {.n: %.1} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// 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+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 -// CHECK:STDOUT: .n = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .n = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon index 71c91a506265..ec123f5c665c 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon @@ -75,18 +75,21 @@ export C2(T:! type); // CHECK:STDOUT: %C2.2: type = class_type @C2, (%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %C1.type = import_ref ir1, inst+4, loaded [template = constants.%C1.1] +// CHECK:STDOUT: %import_ref.2: %C2.type = import_ref ir1, inst+11, loaded [template = constants.%C2.1] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C1 = %C1 // CHECK:STDOUT: .C2 = %C2 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: %C1.type = import_ref ir1, inst+4, loaded [template = constants.%C1.1] -// CHECK:STDOUT: %import_ref.2: %C2.type = import_ref ir1, inst+11, loaded [template = constants.%C2.1] -// CHECK:STDOUT: %C1: %C1.type = export C1, %import_ref.1 [template = constants.%C1.1] +// CHECK:STDOUT: %C1: %C1.type = export C1, imports.%import_ref.1 [template = constants.%C1.1] // CHECK:STDOUT: %T.loc11_11.1: type = param T // CHECK:STDOUT: %T.loc11_11.2: type = bind_symbolic_name T 0, %T.loc11_11.1 [symbolic = constants.%T] -// CHECK:STDOUT: %C2: %C2.type = export C2, %import_ref.2 [template = constants.%C2.1] +// CHECK:STDOUT: %C2: %C2.type = export C2, imports.%import_ref.2 [template = constants.%C2.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C1; diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index c40d528f4736..dc9cce963fe5 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -291,12 +291,15 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: --- mix_current_package.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C1 = %import_ref +// CHECK:STDOUT: .C1 = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- mix_current_package.impl.carbon @@ -311,35 +314,38 @@ import Other library "O1"; // CHECK:STDOUT: %struct.2: %C2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+2, loaded [template = constants.%C1] +// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+1, loaded [template = constants.%C2] +// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C1 = %import_ref.1 -// CHECK:STDOUT: .C2 = %import_ref.2 +// CHECK:STDOUT: .C1 = imports.%import_ref.1 +// CHECK:STDOUT: .C2 = imports.%import_ref.2 // CHECK:STDOUT: .c1 = %c1 // CHECK:STDOUT: .c2 = %c2 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+2, loaded [template = constants.%C1] -// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+1, loaded [template = constants.%C2] -// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %C1.ref: type = name_ref C1, %import_ref.1 [template = constants.%C1] +// CHECK:STDOUT: %C1.ref: type = name_ref C1, imports.%import_ref.1 [template = constants.%C1] // CHECK:STDOUT: %c1.var: ref %C1 = var c1 // CHECK:STDOUT: %c1: ref %C1 = bind_name c1, %c1.var -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %C2.ref: type = name_ref C2, %import_ref.2 [template = constants.%C2] +// CHECK:STDOUT: %C2.ref: type = name_ref C2, imports.%import_ref.2 [template = constants.%C2] // CHECK:STDOUT: %c2.var: ref %C2 = var c2 // CHECK:STDOUT: %c2: ref %C2 = bind_name c2, %c2.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C2 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -357,12 +363,15 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: --- dup_c1.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C1 = %import_ref +// CHECK:STDOUT: .C1 = imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- dup_c1.impl.carbon @@ -375,23 +384,26 @@ import Other library "O1"; // CHECK:STDOUT: %struct: %C1 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+2, loaded [template = constants.%C1] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C1 = %import_ref.1 +// CHECK:STDOUT: .C1 = imports.%import_ref.1 // CHECK:STDOUT: .c1 = %c1 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+2, loaded [template = constants.%C1] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %C1.ref: type = name_ref C1, %import_ref.1 [template = constants.%C1] +// CHECK:STDOUT: %C1.ref: type = name_ref C1, imports.%import_ref.1 [template = constants.%C1] // CHECK:STDOUT: %c1.var: ref %C1 = var c1 // CHECK:STDOUT: %c1: ref %C1 = bind_name c1, %c1.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -405,16 +417,19 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: --- use_ns.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref.1: = import_ref ir1, inst+1, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { -// CHECK:STDOUT: .C = %import_ref.2 +// CHECK:STDOUT: %import_ref: = import_ref ir1, inst+1, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .C = imports.%import_ref // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_ns.impl.carbon @@ -427,6 +442,11 @@ import Other library "O1"; // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+4, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .NS = %NS @@ -434,21 +454,19 @@ import Other library "O1"; // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref.1: = import_ref ir0, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { -// CHECK:STDOUT: .C = %import_ref.2 +// CHECK:STDOUT: %import_ref: = import_ref ir0, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: type = import_ref ir0, inst+4, loaded [template = constants.%C] // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+3, unloaded -// CHECK:STDOUT: %C.ref: type = name_ref C, %import_ref.2 [template = constants.%C] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.3 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -482,6 +500,13 @@ import Other library "O1"; // CHECK:STDOUT: %struct.2: %O2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%O1] +// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+1, loaded [template = constants.%O2] +// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -493,27 +518,23 @@ import Other library "O1"; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref.loc6: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loaded [template = constants.%O1] -// CHECK:STDOUT: %import_ref.2 = import_ref ir2, inst+2, unloaded -// CHECK:STDOUT: %O1.ref: type = name_ref O1, %import_ref.1 [template = constants.%O1] +// CHECK:STDOUT: %O1.ref: type = name_ref O1, imports.%import_ref.1 [template = constants.%O1] // CHECK:STDOUT: %o1.var: ref %O1 = var o1 // CHECK:STDOUT: %o1: ref %O1 = bind_name o1, %o1.var // CHECK:STDOUT: %Other.ref.loc7: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+1, loaded [template = constants.%O2] -// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %O2.ref: type = name_ref O2, %import_ref.3 [template = constants.%O2] +// CHECK:STDOUT: %O2.ref: type = name_ref O2, imports.%import_ref.3 [template = constants.%O2] // CHECK:STDOUT: %o2.var: ref %O2 = var o2 // CHECK:STDOUT: %o2: ref %O2 = bind_name o2, %o2.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @O1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @O2 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -549,6 +570,11 @@ import Other library "O1"; // CHECK:STDOUT: %struct: %O1 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%O1] +// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -559,16 +585,14 @@ import Other library "O1"; // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] -// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%O1] -// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+2, unloaded -// CHECK:STDOUT: %O1.ref: type = name_ref O1, %import_ref.1 [template = constants.%O1] +// CHECK:STDOUT: %O1.ref: type = name_ref O1, imports.%import_ref.1 [template = constants.%O1] // CHECK:STDOUT: %o1.var: ref %O1 = var o1 // CHECK:STDOUT: %o1: ref %O1 = bind_name o1, %o1.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @O1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -592,29 +616,39 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_conflict.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc15_6.1 = import // CHECK:STDOUT: %default.import.loc15_6.2 = import -// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_conflict_reverse.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %import_ref -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%import_ref +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_conflict_reverse.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir0, inst+2, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Other = %Other @@ -622,7 +656,6 @@ import Other library "O1"; // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %import_ref = import_ref ir0, inst+2, unloaded // CHECK:STDOUT: %Other: = namespace %Other.import, [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/unused_lazy_import.carbon b/toolchain/check/testdata/packages/unused_lazy_import.carbon index f1fa14264690..a54dffa69efd 100644 --- a/toolchain/check/testdata/packages/unused_lazy_import.carbon +++ b/toolchain/check/testdata/packages/unused_lazy_import.carbon @@ -40,15 +40,18 @@ impl package Implicit; // CHECK:STDOUT: // CHECK:STDOUT: --- implicit.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref = import_ref ir0, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %import_ref +// CHECK:STDOUT: .A = imports.%import_ref // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref = import_ref ir0, inst+3, unloaded // CHECK:STDOUT: %Core: = namespace %Core.import, [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 69d014f90bb9..6f4ebc532bc6 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -25,6 +25,11 @@ fn F() -> i32 { // CHECK:STDOUT: %.3: type = ptr_type i32 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -32,14 +37,12 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // 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_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index bf6deff4b438..14dbb71e95c0 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -41,14 +41,7 @@ fn F() { // CHECK:STDOUT: %.10: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// 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] @@ -61,6 +54,16 @@ fn F() { // CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int.make_type_32.loc12_15: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index 1fabe276cf12..0088b8d14452 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -27,6 +27,12 @@ fn F() -> i32 { // CHECK:STDOUT: %.3: type = ptr_type i32 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,15 +40,12 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // 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_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index 6e366ce6df2c..81cd7bdfaddb 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -143,6 +143,15 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %AddressOfParam: %AddressOfParam.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -157,14 +166,12 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11, %.loc11_11.1 [template = i32] // CHECK:STDOUT: @G.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_16.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] @@ -176,10 +183,7 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %AddressOfOperator.decl: %AddressOfOperator.type = fn_decl @AddressOfOperator [template = constants.%AddressOfOperator] {} // CHECK:STDOUT: %AddressOfCall.decl: %AddressOfCall.type = fn_decl @AddressOfCall [template = constants.%AddressOfCall] {} // CHECK:STDOUT: %AddressOfType.decl: %AddressOfType.type = fn_decl @AddressOfType [template = constants.%AddressOfType] {} -// 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: %AddressOfTupleElementValue.decl: %AddressOfTupleElementValue.type = fn_decl @AddressOfTupleElementValue [template = constants.%AddressOfTupleElementValue] {} -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %AddressOfParam.decl: %AddressOfParam.type = fn_decl @AddressOfParam [template = constants.%AddressOfParam] { // CHECK:STDOUT: %int.make_type_32.loc95: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc95_26.1: type = value_of_initializer %int.make_type_32.loc95 [template = i32] @@ -187,7 +191,6 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: %param.loc95_19.1: i32 = param param // CHECK:STDOUT: @AddressOfParam.%param: i32 = bind_name param, %param.loc95_19.1 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index 65f5af19dcdf..9c055d341460 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -26,6 +26,11 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,11 +39,9 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32] // CHECK:STDOUT: %.loc19_9.2: type = converted %int.make_type_32.loc19, %.loc19_9.1 [template = i32] diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index 53c145d84a73..bd299e2c6741 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -53,6 +53,10 @@ fn Deref(n: i32) { // CHECK:STDOUT: %struct: %.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -60,7 +64,6 @@ fn Deref(n: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Deref.decl: %Deref.type = fn_decl @Deref [template = constants.%Deref] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index fc43489b0ae7..e9d0bf390bf0 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -29,6 +29,11 @@ var p2: i32->foo; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,14 +42,12 @@ var p2: i32->foo; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32.loc18, %.loc18_9.1 [template = i32] // CHECK:STDOUT: %.loc18_8: ref = deref %.loc18_9.2 // CHECK:STDOUT: %p.var: ref = var p // CHECK:STDOUT: %p: ref = bind_name p, %p.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc22_9.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32] // CHECK:STDOUT: %.loc22_9.2: type = converted %int.make_type_32.loc22, %.loc22_9.1 [template = i32] diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index c83915b3a996..5965473ae1dd 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -31,6 +31,11 @@ var a: i32* = a_ref; // CHECK:STDOUT: %.3: type = ptr_type i32 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,13 +44,11 @@ var a: i32* = a_ref; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_32.loc4, %.loc4_13.1 [template = i32] // 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: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32] // CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_32.loc5, %.loc5_15.1 [template = i32] @@ -75,20 +78,23 @@ var a: i32* = a_ref; // CHECK:STDOUT: %.2: type = ptr_type i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+13, unloaded +// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref ir0, inst+24, loaded +// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_orig = %import_ref.1 -// CHECK:STDOUT: .a_ref = %import_ref.2 +// CHECK:STDOUT: .a_orig = imports.%import_ref.1 +// CHECK:STDOUT: .a_ref = imports.%import_ref.2 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+13, unloaded -// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref ir0, inst+24, loaded // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] @@ -101,7 +107,7 @@ var a: i32* = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, file.%import_ref.2 +// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, imports.%import_ref.2 // CHECK:STDOUT: %.loc4: %.2 = bind_value %a_ref.ref // CHECK:STDOUT: assign file.%a.var, %.loc4 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index bd7aea1914a6..b34437228f06 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -28,6 +28,11 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,8 +40,6 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc12_29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_32.loc12_29 [template = i32] diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index 20e191653ce2..f0bc73a331c1 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -31,6 +31,13 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: %ConstPtr: %ConstPtr.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -39,8 +46,6 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Ptr.decl: %Ptr.type = fn_decl @Ptr [template = constants.%Ptr] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] @@ -54,8 +59,6 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: %.loc11_23.3: type = ptr_type i32 [template = constants.%.2] // CHECK:STDOUT: @Ptr.%return: ref %.2 = var // CHECK:STDOUT: } -// 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: %ConstPtr.decl: %ConstPtr.type = fn_decl @ConstPtr [template = constants.%ConstPtr] { // CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] diff --git a/toolchain/check/testdata/return/code_after_return.carbon b/toolchain/check/testdata/return/code_after_return.carbon index 755fcfd9e068..eb7400a5677c 100644 --- a/toolchain/check/testdata/return/code_after_return.carbon +++ b/toolchain/check/testdata/return/code_after_return.carbon @@ -24,6 +24,10 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -32,7 +36,6 @@ fn Main() { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 47bc226c0aab..c0a37a164a7f 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -37,6 +37,12 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %.6: bool = bool_literal true [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -44,8 +50,6 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] @@ -57,7 +61,6 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_32, %.loc11_18.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type"; diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index 7a1ea54fe8e4..1737af69e256 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -29,6 +29,10 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: %.2: i32 = int_literal 6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,7 +44,6 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: %ReturnType.decl: %ReturnType.type = fn_decl @ReturnType [template = constants.%ReturnType] { // CHECK:STDOUT: @ReturnType.%return: ref type = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] { // CHECK:STDOUT: %ReturnType.ref: %ReturnType.type = name_ref ReturnType, %ReturnType.decl [template = constants.%ReturnType] // CHECK:STDOUT: %ReturnType.call: init type = call %ReturnType.ref() diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index 613c57d2b405..f3287f3ee057 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -24,6 +24,10 @@ fn Main() -> i32 { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -31,7 +35,6 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] 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 5d4a67fa1181..2febd00c7ebd 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 @@ -25,6 +25,10 @@ fn Procedure() -> i32 { // CHECK:STDOUT: %Procedure: %Procedure.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -32,7 +36,6 @@ fn Procedure() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Procedure.decl: %Procedure.type = fn_decl @Procedure [template = constants.%Procedure] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32 [template = i32] 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 d1f428b36d7c..73901c612caf 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -52,6 +52,13 @@ fn G() -> C { // CHECK:STDOUT: %struct: %C = struct_value (%.3, %.7) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -61,17 +68,13 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // 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_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32, %.loc11_11.1 [template = i32] // CHECK:STDOUT: @F.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @G.%return: ref %C = var diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 7373585f66ad..1d4fe0113105 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -54,6 +54,15 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %DifferentScopes: %DifferentScopes.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -62,24 +71,18 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %SameScope.decl: %SameScope.type = fn_decl @SameScope [template = constants.%SameScope] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11, %.loc11_19.1 [template = i32] // CHECK:STDOUT: @SameScope.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %DifferentScopes.decl: %DifferentScopes.type = fn_decl @DifferentScopes [template = constants.%DifferentScopes] { // CHECK:STDOUT: %int.make_type_32.loc26: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc26_25.1: type = value_of_initializer %int.make_type_32.loc26 [template = i32] // CHECK:STDOUT: %.loc26_25.2: type = converted %int.make_type_32.loc26, %.loc26_25.1 [template = i32] // CHECK:STDOUT: @DifferentScopes.%return: ref i32 = var // CHECK:STDOUT: } -// 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: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index a662b35329d0..268e2a6d8a10 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -33,6 +33,11 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %.3: f64 = float_literal 0 [template] // 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: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,14 +45,12 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Mismatch.decl: %Mismatch.type = fn_decl @Mismatch [template = constants.%Mismatch] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_18.2: type = converted %int.make_type_32, %.loc11_18.1 [template = i32] // CHECK:STDOUT: @Mismatch.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index 3ab680087761..fd203ca7ce4b 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -26,6 +26,10 @@ fn Main() -> i32 { // CHECK:STDOUT: %.2: f64 = float_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,7 +37,6 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 5d2aef44c2a7..4badb196fca8 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -28,6 +28,10 @@ fn Main() -> i32 { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,7 +39,6 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index d29b9430874a..64a55ff67d51 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -25,6 +25,10 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: %.2: i32 = int_literal 6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,7 +39,6 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %x.var: ref type = var x // CHECK:STDOUT: %x: ref type = bind_name x, %x.var -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] { // CHECK:STDOUT: %x.ref: ref type = name_ref x, %x // CHECK:STDOUT: %.loc15: type = bind_value %x.ref diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 270f05125f48..e29247ceb48a 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -43,6 +43,13 @@ fn G() -> i32 { // CHECK:STDOUT: %.7: i32 = int_literal 0 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -53,20 +60,16 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] // CHECK:STDOUT: @F.%return: ref %C = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc21_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc21_11.2: type = converted %int.make_type_32, %.loc21_11.1 [template = i32] // CHECK:STDOUT: @G.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index c38e0dddc5fd..d190ea4b0c3f 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -44,6 +44,16 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %EnclosingButAfter: %EnclosingButAfter.type = struct_value () [template] // 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -52,17 +62,12 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %UnrelatedScopes.decl: %UnrelatedScopes.type = fn_decl @UnrelatedScopes [template = constants.%UnrelatedScopes] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11, %.loc11_25.1 [template = i32] // CHECK:STDOUT: @UnrelatedScopes.%return: ref i32 = var // CHECK:STDOUT: } -// 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: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %EnclosingButAfter.decl: %EnclosingButAfter.type = fn_decl @EnclosingButAfter [template = constants.%EnclosingButAfter] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %bool.make_type [template = bool] @@ -74,8 +79,6 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %.loc21_34.2: type = converted %int.make_type_32.loc21, %.loc21_34.1 [template = i32] // CHECK:STDOUT: @EnclosingButAfter.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index d7f10a53a420..7ab96b74b048 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -25,6 +25,10 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: %struct: %.2 = struct_value (%.3) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -32,7 +36,6 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 3cd0c5c37a6d..fa21c5a2fa26 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -29,6 +29,11 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5, %.6) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -36,8 +41,6 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32.loc12_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc12_20: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index 2e4ebe400d79..3f1145ba47fe 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -23,6 +23,10 @@ fn Main() -> i32 { // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,7 +34,6 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index 6ae28eeec5ed..3368ffea65b7 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -23,6 +23,10 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: %.3: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,7 +34,6 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index 911d76702cc6..1ab815c3b350 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -69,6 +69,20 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: %.8: i32 = int_literal 4 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -80,11 +94,6 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc18_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_16.1: type = value_of_initializer %int.make_type_32.loc18_16 [template = i32] @@ -103,30 +112,24 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: %.loc18_56.2: type = converted %int.make_type_32.loc18_56, %.loc18_56.1 [template = i32] // CHECK:STDOUT: @F.%return: ref = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc27_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc27_13.1: type = value_of_initializer %int.make_type_32.loc27_13 [template = i32] // CHECK:STDOUT: %.loc27_13.2: type = converted %int.make_type_32.loc27_13, %.loc27_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc27_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc27_22.1: type = value_of_initializer %int.make_type_32.loc27_22 [template = i32] // CHECK:STDOUT: %.loc27_22.2: type = converted %int.make_type_32.loc27_22, %.loc27_22.1 [template = i32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc36: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc36_8.1: type = value_of_initializer %int.make_type_32.loc36 [template = i32] // CHECK:STDOUT: %.loc36_8.2: type = converted %int.make_type_32.loc36, %.loc36_8.1 [template = i32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc45: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc45_13.1: type = value_of_initializer %int.make_type_32.loc45 [template = i32] // CHECK:STDOUT: %.loc45_13.2: type = converted %int.make_type_32.loc45, %.loc45_13.1 [template = i32] // CHECK:STDOUT: %.loc45_16: type = struct_type {.a: i32} [template = constants.%.3] // CHECK:STDOUT: %x.var: ref %.3 = var x // CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc53_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc53_13.1: type = value_of_initializer %int.make_type_32.loc53_13 [template = i32] // CHECK:STDOUT: %.loc53_13.2: type = converted %int.make_type_32.loc53_13, %.loc53_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc53_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc53_22.1: type = value_of_initializer %int.make_type_32.loc53_22 [template = i32] // CHECK:STDOUT: %.loc53_22.2: type = converted %int.make_type_32.loc53_22, %.loc53_22.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index 00df399edcbe..096148da260d 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -30,6 +30,11 @@ var y: {.b: i32} = x; // CHECK:STDOUT: %.4: type = struct_type {.b: i32} [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,14 +43,12 @@ var y: {.b: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32.loc15, %.loc15_13.1 [template = i32] // CHECK:STDOUT: %.loc15_16: type = struct_type {.a: i32} [template = constants.%.2] // CHECK:STDOUT: %x.var: ref %.2 = var x // CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc20_13.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32] // CHECK:STDOUT: %.loc20_13.2: type = converted %int.make_type_32.loc20, %.loc20_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index b2e34210f82b..74e2b7d5bffe 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -24,6 +24,10 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: %.4: type = struct_type {.b: f64} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -31,7 +35,6 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index e87008cea801..c9024a1a2041 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -28,6 +28,11 @@ var y: i32 = x.b; // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,14 +42,12 @@ var y: i32 = x.b; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc11_13.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64] // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc11_13.3: type = converted %float.make_type, %.loc11_13.2 [template = f64] // CHECK:STDOUT: %.loc11_16: type = struct_type {.a: f64} [template = constants.%.3] // CHECK:STDOUT: %x.var: ref %.3 = var x // CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 1ac56d340096..49d6f4b58c6a 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -25,6 +25,11 @@ var y: i32 = x.b; // CHECK:STDOUT: %struct: %.2 = struct_value (%.3) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,14 +38,12 @@ var y: i32 = x.b; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11, %.loc11_13.1 [template = i32] // CHECK:STDOUT: %.loc11_16: type = struct_type {.a: i32} [template = constants.%.2] // CHECK:STDOUT: %x.var: ref %.2 = var x // CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index b47ebef92b74..f25c01e4a2be 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -25,6 +25,11 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: %.5: type = struct_type {.a: i32} [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -32,11 +37,9 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14_13 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14_13, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_22.1: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32] // CHECK:STDOUT: %.loc14_22.2: type = converted %int.make_type_32.loc14_22, %.loc14_22.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index e2d4879132dd..306725ec81d2 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -22,6 +22,11 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -29,14 +34,12 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] // CHECK:STDOUT: %.loc14_16: type = struct_type {.a: i32} [template = constants.%.2] // CHECK:STDOUT: %x.var: ref %.2 = var x // CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 1f51f08210b2..6a93d75d032f 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -84,6 +84,15 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -94,33 +103,27 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_32.loc4, %.loc4_17.1 [template = i32] // CHECK:STDOUT: %.loc4_20: type = struct_type {.a: i32} [template = constants.%.2] // CHECK:STDOUT: %a_ref.var: ref %.2 = var a_ref // CHECK:STDOUT: %a_ref: ref %.2 = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_22.1: type = value_of_initializer %int.make_type_32.loc5_22 [template = i32] // CHECK:STDOUT: %.loc5_22.2: type = converted %int.make_type_32.loc5_22, %.loc5_22.1 [template = i32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_36.1: %.4 = tuple_literal (%int.make_type_32.loc5_32) // CHECK:STDOUT: %.loc5_36.2: type = value_of_initializer %int.make_type_32.loc5_32 [template = i32] // CHECK:STDOUT: %.loc5_36.3: type = converted %int.make_type_32.loc5_32, %.loc5_36.2 [template = i32] // CHECK:STDOUT: %.loc5_36.4: type = converted %.loc5_36.1, constants.%.5 [template = constants.%.5] // CHECK:STDOUT: %.loc5_37: type = struct_type {.b: i32, .c: %.5} [template = constants.%.6] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_44: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_44.1: type = value_of_initializer %int.make_type_32.loc5_44 [template = i32] // CHECK:STDOUT: %.loc5_44.2: type = converted %int.make_type_32.loc5_44, %.loc5_44.1 [template = i32] // CHECK:STDOUT: %.loc5_47: type = struct_type {.a: %.6, .d: i32} [template = constants.%.7] // CHECK:STDOUT: %b_ref.var: ref %.7 = var b_ref // CHECK:STDOUT: %b_ref: ref %.7 = bind_name b_ref, %b_ref.var -// 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: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { // CHECK:STDOUT: %int.make_type_32.loc8_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_18.1: type = value_of_initializer %int.make_type_32.loc8_18 [template = i32] @@ -216,12 +219,24 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: ref %.2 = import_ref ir0, inst+17, loaded +// CHECK:STDOUT: %import_ref.2: ref %.6 = import_ref ir0, inst+60, loaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+104, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] +// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9 = import_ref ir0, inst+107, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = %import_ref.1 -// CHECK:STDOUT: .b_ref = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .F = %import_ref.4 +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b @@ -230,38 +245,29 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1: ref %.2 = import_ref ir0, inst+17, loaded -// CHECK:STDOUT: %import_ref.2: ref %.6 = import_ref ir0, inst+60, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_32.loc4, %.loc4_13.1 [template = i32] // CHECK:STDOUT: %.loc4_16: type = struct_type {.a: i32} [template = constants.%.2] // CHECK:STDOUT: %a.var: ref %.2 = var a // CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_18.1: type = value_of_initializer %int.make_type_32.loc5_18 [template = i32] // CHECK:STDOUT: %.loc5_18.2: type = converted %int.make_type_32.loc5_18, %.loc5_18.1 [template = i32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_28: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_32.1: %.3 = tuple_literal (%int.make_type_32.loc5_28) // CHECK:STDOUT: %.loc5_32.2: type = value_of_initializer %int.make_type_32.loc5_28 [template = i32] // CHECK:STDOUT: %.loc5_32.3: type = converted %int.make_type_32.loc5_28, %.loc5_32.2 [template = i32] // CHECK:STDOUT: %.loc5_32.4: type = converted %.loc5_32.1, constants.%.4 [template = constants.%.4] // CHECK:STDOUT: %.loc5_33: type = struct_type {.b: i32, .c: %.4} [template = constants.%.5] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_40: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_40.1: type = value_of_initializer %int.make_type_32.loc5_40 [template = i32] // CHECK:STDOUT: %.loc5_40.2: type = converted %int.make_type_32.loc5_40, %.loc5_40.1 [template = i32] // CHECK:STDOUT: %.loc5_43: type = struct_type {.a: %.5, .d: i32} [template = constants.%.6] // CHECK:STDOUT: %b.var: ref %.6 = var b // CHECK:STDOUT: %b: ref %.6 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.9 = import_ref ir0, inst+107, unloaded -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %import_ref.3 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc6_16: i32 = int_literal 1 [template = constants.%.12] // CHECK:STDOUT: %.loc6_24: i32 = int_literal 2 [template = constants.%.13] // CHECK:STDOUT: %.loc6_25: %.11 = struct_literal (%.loc6_16, %.loc6_24) @@ -276,7 +282,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -285,13 +291,13 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, file.%import_ref.1 +// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, imports.%import_ref.1 // CHECK:STDOUT: %.loc4_20.1: ref i32 = struct_access %a_ref.ref, element0 // CHECK:STDOUT: %.loc4_20.2: i32 = bind_value %.loc4_20.1 // CHECK:STDOUT: %.loc4_20.3: init %.2 = struct_init (%.loc4_20.2) to file.%a.var // CHECK:STDOUT: %.loc4_25: init %.2 = converted %a_ref.ref, %.loc4_20.3 // CHECK:STDOUT: assign file.%a.var, %.loc4_25 -// CHECK:STDOUT: %b_ref.ref: ref %.6 = name_ref b_ref, file.%import_ref.2 +// CHECK:STDOUT: %b_ref.ref: ref %.6 = name_ref b_ref, imports.%import_ref.2 // CHECK:STDOUT: %.loc5_47.1: ref %.5 = struct_access %b_ref.ref, element0 // CHECK:STDOUT: %.loc5_47.2: ref i32 = struct_access %.loc5_47.1, element0 // CHECK:STDOUT: %.loc5_47.3: i32 = bind_value %.loc5_47.2 @@ -314,7 +320,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.loc5_47.20: init %.6 = struct_init (%.loc5_47.15, %.loc5_47.19) to file.%b.var // CHECK:STDOUT: %.loc5_52: init %.6 = converted %b_ref.ref, %.loc5_47.20 // CHECK:STDOUT: assign file.%b.var, %.loc5_52 -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.4 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc6: ref %C.3 = splice_block file.%c.var {} // CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc6 // CHECK:STDOUT: assign file.%c.var, %F.call @@ -342,25 +348,28 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %.8: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+17, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+104, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+107, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = %import_ref.1 -// CHECK:STDOUT: .b_ref = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .F = %import_ref.4 +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .c_bad = %c_bad // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+60, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+107, unloaded -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %import_ref.3 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc13_28: i32 = int_literal 2 [template = constants.%.5] // CHECK:STDOUT: %.loc13_29: %.6 = struct_literal (%.loc13_20, %.loc13_28) @@ -373,14 +382,14 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.3; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.4 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc13: ref %C.3 = temporary_storage // CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc13 // CHECK:STDOUT: assign file.%c_bad.var, @@ -411,25 +420,28 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+17, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+60, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+104, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+107, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = %import_ref.1 -// CHECK:STDOUT: .b_ref = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .F = %import_ref.4 +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .c_bad = %c_bad // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+60, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+107, unloaded -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %import_ref.3 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc6_20: i32 = int_literal 3 [template = constants.%.4] // CHECK:STDOUT: %.loc6_28: i32 = int_literal 4 [template = constants.%.5] // CHECK:STDOUT: %.loc6_29: %.3 = struct_literal (%.loc6_20, %.loc6_28) @@ -444,14 +456,14 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.4; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.4 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc6: ref %C.4 = temporary_storage // CHECK:STDOUT: %F.call: init %C.4 = call %F.ref() to %.loc6 // CHECK:STDOUT: assign file.%c_bad.var, diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index c1a9395c97b8..6d73eabcb059 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -33,6 +33,13 @@ fn F() -> i32 { // CHECK:STDOUT: %.8: type = ptr_type %.7 [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -41,9 +48,6 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc11_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32.loc11_16 [template = i32] @@ -57,7 +61,6 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc11_37: type = struct_type {.x: i32, .y: i32, .z: i32} [template = constants.%.2] // CHECK:STDOUT: @G.%return: ref %.2 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index bc34e1e8aa7c..18a8face18de 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -28,6 +28,13 @@ var z: i32 = y; // CHECK:STDOUT: %struct: %.3 = struct_value (%.5, %.6) [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,24 +45,20 @@ var z: i32 = y; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %.loc11_13.1: i32 = int_literal 64 [template = constants.%.1] -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64] // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %float.make_type [template = f64] // CHECK:STDOUT: %.loc11_13.3: type = converted %float.make_type, %.loc11_13.2 [template = f64] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11, %.loc11_22.1 [template = i32] // CHECK:STDOUT: %.loc11_25: type = struct_type {.a: f64, .b: i32} [template = constants.%.3] // CHECK:STDOUT: %x.var: ref %.3 = var x // CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32] // CHECK:STDOUT: %y.var: ref i32 = var y // CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32] // CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32] diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index 1c6e69a9d06e..b607a02db3f7 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -32,6 +32,18 @@ fn G() { // CHECK:STDOUT: %.7: type = ptr_type %.6 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -40,9 +52,6 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %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] @@ -58,12 +67,6 @@ fn G() { // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} -// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index a93fddaccc98..9857135f6584 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -22,6 +22,11 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %struct: %.2 = struct_value (%.3) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,14 +35,12 @@ var y: {.a: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11, %.loc11_13.1 [template = i32] // CHECK:STDOUT: %.loc11_16: type = struct_type {.a: i32} [template = constants.%.2] // CHECK:STDOUT: %x.var: ref %.2 = var x // CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32] // CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12, %.loc12_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index d936db22ead5..b841de864005 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -38,6 +38,17 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %.6: type = ptr_type %.5 [template] // 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: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -47,14 +58,12 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %MakeI32.decl: %MakeI32.type = fn_decl @MakeI32 [template = constants.%MakeI32] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11, %.loc11_17.1 [template = i32] // CHECK:STDOUT: @MakeI32.%return: ref i32 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %MakeF64.decl: %MakeF64.type = fn_decl @MakeF64 [template = constants.%MakeF64] { // CHECK:STDOUT: %.loc12_17.1: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type.loc12: init type = call constants.%Float(%.loc12_17.1) [template = f64] @@ -62,8 +71,6 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %.loc12_17.3: type = converted %float.make_type.loc12, %.loc12_17.2 [template = f64] // CHECK:STDOUT: @MakeF64.%return: ref f64 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_16.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32] @@ -75,10 +82,6 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %.loc14_28: type = struct_type {.a: i32, .b: f64} [template = constants.%.3] // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index 40b29eeafc4f..d408154c1f54 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -27,6 +27,13 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %struct: %.4 = struct_value (%.6, %tuple) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -35,11 +42,9 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11_13 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11_13, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_27.1: %.2 = tuple_literal (%int.make_type_32.loc11_23) // CHECK:STDOUT: %.loc11_27.2: type = value_of_initializer %int.make_type_32.loc11_23 [template = i32] @@ -48,11 +53,9 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %.loc11_28: type = struct_type {.a: i32, .b: %.3} [template = constants.%.4] // CHECK:STDOUT: %x.var: ref %.4 = var x // CHECK:STDOUT: %x: ref %.4 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12_13 [template = i32] // CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12_13, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_27.1: %.2 = tuple_literal (%int.make_type_32.loc12_23) // CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %int.make_type_32.loc12_23 [template = i32] diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index d42418c34fd5..aa719a4630b0 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -27,6 +27,17 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %struct: %.2 = struct_value (%.4, %.5) [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,40 +48,32 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11_13 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11_13, %.loc11_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_22.1: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32] // CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11_22, %.loc11_22.1 [template = i32] // CHECK:STDOUT: %.loc11_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.2] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: type = value_of_initializer %int.make_type_32.loc12_13 [template = i32] // CHECK:STDOUT: %.loc12_13.2: type = converted %int.make_type_32.loc12_13, %.loc12_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_22.1: type = value_of_initializer %int.make_type_32.loc12_22 [template = i32] // CHECK:STDOUT: %.loc12_22.2: type = converted %int.make_type_32.loc12_22, %.loc12_22.1 [template = i32] // CHECK:STDOUT: %.loc12_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.2] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14_13 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14_13, %.loc14_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_22.1: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32] // CHECK:STDOUT: %.loc14_22.2: type = converted %int.make_type_32.loc14_22, %.loc14_22.1 [template = i32] // CHECK:STDOUT: %.loc14_25: type = struct_type {.a: i32, .b: i32} [template = constants.%.2] // CHECK:STDOUT: %x.var: ref %.2 = var x // CHECK:STDOUT: %x: ref %.2 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32.loc15_13 [template = i32] // CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32.loc15_13, %.loc15_13.1 [template = i32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_22.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] // CHECK:STDOUT: %.loc15_22.2: type = converted %int.make_type_32.loc15_22, %.loc15_22.1 [template = i32] diff --git a/toolchain/check/testdata/tuples/fail_assign_nested.carbon b/toolchain/check/testdata/tuples/fail_assign_nested.carbon index b3950dd29e20..5f80fc97b5ed 100644 --- a/toolchain/check/testdata/tuples/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_nested.carbon @@ -36,6 +36,13 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: %.16: type = tuple_type (%.12, %.12) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,14 +50,10 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_18: %.2 = tuple_literal (%int.make_type_32.loc14_10, %int.make_type_32.loc14_15) -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_27: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_30: %.2 = tuple_literal (%int.make_type_32.loc14_22, %int.make_type_32.loc14_27) // CHECK:STDOUT: %.loc14_31.1: %.3 = tuple_literal (%.loc14_18, %.loc14_30) diff --git a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon index f7b2805611ef..512df2e3248b 100644 --- a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon @@ -27,6 +27,11 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: %.7: type = tuple_type (i32, f64) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -34,9 +39,7 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: %.2 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) // CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] diff --git a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon index 49518e36ce07..5bad927bf889 100644 --- a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon @@ -33,6 +33,10 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: %.5: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -43,7 +47,6 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc19_24.1: %.2 = tuple_literal (%int.make_type_32, %Incomplete.ref.loc19) diff --git a/toolchain/check/testdata/tuples/fail_too_few_element.carbon b/toolchain/check/testdata/tuples/fail_too_few_element.carbon index 2efd7b3efe4f..7419cc469434 100644 --- a/toolchain/check/testdata/tuples/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuples/fail_too_few_element.carbon @@ -26,6 +26,11 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: %.6: type = tuple_type (i32) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -33,9 +38,7 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: %.2 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) // CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] diff --git a/toolchain/check/testdata/tuples/fail_type_assign.carbon b/toolchain/check/testdata/tuples/fail_type_assign.carbon index b35fbdda1f7a..fff78385f553 100644 --- a/toolchain/check/testdata/tuples/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuples/fail_type_assign.carbon @@ -23,6 +23,11 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %.3: type = tuple_type (i32) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -30,7 +35,6 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_14.1: %.2 = tuple_literal (%int.make_type_32) // CHECK:STDOUT: %.loc14_14.2: type = value_of_initializer %int.make_type_32 [template = i32] @@ -38,7 +42,6 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: %.loc14_14.4: type = converted %.loc14_14.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %x.var: ref %.3 = var x // CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/tuples/import.carbon b/toolchain/check/testdata/tuples/import.carbon index 1aed352e3851..059b738975c4 100644 --- a/toolchain/check/testdata/tuples/import.carbon +++ b/toolchain/check/testdata/tuples/import.carbon @@ -89,6 +89,16 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -99,7 +109,6 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_17.1: %.2 = tuple_literal (%int.make_type_32.loc4) // CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_32.loc4 [template = i32] @@ -107,15 +116,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc4_17.4: type = converted %.loc4_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a_ref.var: ref %.3 = var a_ref // CHECK:STDOUT: %a_ref: ref %.3 = bind_name a_ref, %a_ref.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_19: %.2 = tuple_literal (%int.make_type_32.loc5_15) -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_25: %.5 = tuple_literal (%.loc5_19, %int.make_type_32.loc5_22) -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_29: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_34: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_37: %.6 = tuple_literal (%int.make_type_32.loc5_29, %int.make_type_32.loc5_34) // CHECK:STDOUT: %.loc5_38.1: %.7 = tuple_literal (%.loc5_25, %.loc5_37) @@ -133,8 +138,6 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_38.13: type = converted %.loc5_38.1, constants.%.10 [template = constants.%.10] // CHECK:STDOUT: %b_ref.var: ref %.10 = var b_ref // CHECK:STDOUT: %b_ref: ref %.10 = bind_name b_ref, %b_ref.var -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { // CHECK:STDOUT: %int.make_type_32.loc7_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] @@ -240,12 +243,25 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: ref %.3 = import_ref ir0, inst+17, loaded +// CHECK:STDOUT: %import_ref.2: ref %.9 = import_ref ir0, inst+61, loaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+109, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] +// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10 = import_ref ir0, inst+112, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = %import_ref.1 -// CHECK:STDOUT: .b_ref = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .F = %import_ref.4 +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b @@ -254,12 +270,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1: ref %.3 = import_ref ir0, inst+17, loaded -// CHECK:STDOUT: %import_ref.2: ref %.9 = import_ref ir0, inst+61, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+109, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: %.2 = tuple_literal (%int.make_type_32.loc4) // CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_32.loc4 [template = i32] @@ -267,15 +278,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc4_13.4: type = converted %.loc4_13.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %a.var: ref %.3 = var a // CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_15: %.2 = tuple_literal (%int.make_type_32.loc5_11) -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_21: %.4 = tuple_literal (%.loc5_15, %int.make_type_32.loc5_18) -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_25: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc5_30: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_33: %.5 = tuple_literal (%int.make_type_32.loc5_25, %int.make_type_32.loc5_30) // CHECK:STDOUT: %.loc5_34.1: %.6 = tuple_literal (%.loc5_21, %.loc5_33) @@ -293,8 +300,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_34.13: type = converted %.loc5_34.1, constants.%.9 [template = constants.%.9] // CHECK:STDOUT: %b.var: ref %.9 = var b // CHECK:STDOUT: %b: ref %.9 = bind_name b, %b.var -// CHECK:STDOUT: %import_ref.10 = import_ref ir0, inst+112, unloaded -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %import_ref.3 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc6_11: i32 = int_literal 1 [template = constants.%.15] // CHECK:STDOUT: %.loc6_14: i32 = int_literal 2 [template = constants.%.16] // CHECK:STDOUT: %.loc6_15: %.8 = tuple_literal (%.loc6_11, %.loc6_14) @@ -309,7 +315,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.10 +// CHECK:STDOUT: .Self = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -318,13 +324,13 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %.3 = name_ref a_ref, file.%import_ref.1 +// CHECK:STDOUT: %a_ref.ref: ref %.3 = name_ref a_ref, imports.%import_ref.1 // CHECK:STDOUT: %.loc4_17.1: ref i32 = tuple_access %a_ref.ref, element0 // CHECK:STDOUT: %.loc4_17.2: i32 = bind_value %.loc4_17.1 // CHECK:STDOUT: %.loc4_17.3: init %.3 = tuple_init (%.loc4_17.2) to file.%a.var // CHECK:STDOUT: %.loc4_22: init %.3 = converted %a_ref.ref, %.loc4_17.3 // CHECK:STDOUT: assign file.%a.var, %.loc4_22 -// CHECK:STDOUT: %b_ref.ref: ref %.9 = name_ref b_ref, file.%import_ref.2 +// CHECK:STDOUT: %b_ref.ref: ref %.9 = name_ref b_ref, imports.%import_ref.2 // CHECK:STDOUT: %.loc5_38.1: ref %.7 = tuple_access %b_ref.ref, element0 // CHECK:STDOUT: %.loc5_38.2: ref %.3 = tuple_access %.loc5_38.1, element0 // CHECK:STDOUT: %.loc5_38.3: ref i32 = tuple_access %.loc5_38.2, element0 @@ -355,7 +361,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.loc5_38.28: init %.9 = tuple_init (%.loc5_38.15, %.loc5_38.27) to file.%b.var // CHECK:STDOUT: %.loc5_43: init %.9 = converted %b_ref.ref, %.loc5_38.28 // CHECK:STDOUT: assign file.%b.var, %.loc5_43 -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.4 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc6: ref %C.3 = splice_block file.%c.var {} // CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc6 // CHECK:STDOUT: assign file.%c.var, %F.call @@ -384,25 +390,28 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %.9: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+17, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+61, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+109, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+112, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = %import_ref.1 -// CHECK:STDOUT: .b_ref = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .F = %import_ref.4 +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .c_bad = %c_bad // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+61, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+109, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+112, unloaded -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %import_ref.3 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc14_15: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc14_18: i32 = int_literal 2 [template = constants.%.5] // CHECK:STDOUT: %.loc14_21: i32 = int_literal 3 [template = constants.%.6] @@ -416,14 +425,14 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.3; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.4 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc14: ref %C.3 = temporary_storage // CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc14 // CHECK:STDOUT: assign file.%c_bad.var, @@ -454,25 +463,28 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+17, unloaded +// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+61, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+109, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+112, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = %import_ref.1 -// CHECK:STDOUT: .b_ref = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.3 -// CHECK:STDOUT: .F = %import_ref.4 +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 // CHECK:STDOUT: .Core = %Core // CHECK:STDOUT: .c_bad = %c_bad // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref ir0, inst+61, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir0, inst+109, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref ir0, inst+126, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+112, unloaded -// CHECK:STDOUT: %C.ref: %C.type = name_ref C, %import_ref.3 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc7_15: i32 = int_literal 3 [template = constants.%.4] // CHECK:STDOUT: %.loc7_18: i32 = int_literal 4 [template = constants.%.5] // CHECK:STDOUT: %.loc7_19: %.3 = tuple_literal (%.loc7_15, %.loc7_18) @@ -487,14 +499,14 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = file.%import_ref.5 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %C.4; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref.4 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %.loc7: ref %C.4 = temporary_storage // CHECK:STDOUT: %F.call: init %C.4 = call %F.ref() to %.loc7 // CHECK:STDOUT: assign file.%c_bad.var, diff --git a/toolchain/check/testdata/tuples/nested_tuple.carbon b/toolchain/check/testdata/tuples/nested_tuple.carbon index 23a250bb29c7..6e7f27eb2d79 100644 --- a/toolchain/check/testdata/tuples/nested_tuple.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple.carbon @@ -30,6 +30,12 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: %tuple.2: %.5 = tuple_value (%tuple.1, %.11) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -37,12 +43,9 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_10: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_18: %.2 = tuple_literal (%int.make_type_32.loc11_10, %int.make_type_32.loc11_15) -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_21: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_24.1: %.3 = tuple_literal (%.loc11_18, %int.make_type_32.loc11_21) // CHECK:STDOUT: %.loc11_24.2: type = value_of_initializer %int.make_type_32.loc11_10 [template = i32] diff --git a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon index 96256553fe12..f06c1993c1ee 100644 --- a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon @@ -45,6 +45,23 @@ fn H() { // CHECK:STDOUT: %.14: i32 = int_literal 2 [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -54,9 +71,6 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// 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: %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] @@ -72,18 +86,7 @@ fn H() { // CHECK:STDOUT: @F.%return: ref %.3 = var // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} -// 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/tuples/one_element.carbon b/toolchain/check/testdata/tuples/one_element.carbon index 3f9fdac060dc..a6152380f436 100644 --- a/toolchain/check/testdata/tuples/one_element.carbon +++ b/toolchain/check/testdata/tuples/one_element.carbon @@ -23,6 +23,11 @@ var y: (i32,) = x; // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.4) [template] // 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -31,7 +36,6 @@ var y: (i32,) = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: %.2 = tuple_literal (%int.make_type_32.loc11) // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] @@ -39,7 +43,6 @@ var y: (i32,) = x; // CHECK:STDOUT: %.loc11_13.4: type = converted %.loc11_13.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %x.var: ref %.3 = var x // CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_13.1: %.2 = tuple_literal (%int.make_type_32.loc12) // CHECK:STDOUT: %.loc12_13.2: type = value_of_initializer %int.make_type_32.loc12 [template = i32] diff --git a/toolchain/check/testdata/tuples/two_elements.carbon b/toolchain/check/testdata/tuples/two_elements.carbon index 126690489fa1..511d7ef4bfc5 100644 --- a/toolchain/check/testdata/tuples/two_elements.carbon +++ b/toolchain/check/testdata/tuples/two_elements.carbon @@ -28,6 +28,17 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5, %.6) [template] // 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.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -38,9 +49,7 @@ var y: (i32, i32) = x; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) // CHECK:STDOUT: %.loc11_17.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] @@ -48,9 +57,7 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %.loc11_17.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] // CHECK:STDOUT: %.loc11_17.5: type = converted %int.make_type_32.loc11_14, %.loc11_17.4 [template = i32] // CHECK:STDOUT: %.loc11_17.6: type = converted %.loc11_17.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc12_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_17.1: %.2 = tuple_literal (%int.make_type_32.loc12_9, %int.make_type_32.loc12_14) // CHECK:STDOUT: %.loc12_17.2: type = value_of_initializer %int.make_type_32.loc12_9 [template = i32] @@ -58,9 +65,7 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %.loc12_17.4: type = value_of_initializer %int.make_type_32.loc12_14 [template = i32] // CHECK:STDOUT: %.loc12_17.5: type = converted %int.make_type_32.loc12_14, %.loc12_17.4 [template = i32] // CHECK:STDOUT: %.loc12_17.6: type = converted %.loc12_17.1, constants.%.3 [template = constants.%.3] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: %.2 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) // CHECK:STDOUT: %.loc14_17.2: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] @@ -70,9 +75,7 @@ var y: (i32, i32) = x; // CHECK:STDOUT: %.loc14_17.6: type = converted %.loc14_17.1, constants.%.3 [template = constants.%.3] // CHECK:STDOUT: %x.var: ref %.3 = var x // CHECK:STDOUT: %x: ref %.3 = bind_name x, %x.var -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15_9: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %int.make_type_32.loc15_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_17.1: %.2 = tuple_literal (%int.make_type_32.loc15_9, %int.make_type_32.loc15_14) // CHECK:STDOUT: %.loc15_17.2: type = value_of_initializer %int.make_type_32.loc15_9 [template = i32] diff --git a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon index 3051c2b4ea3e..7a617f317268 100644 --- a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon +++ b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon @@ -66,6 +66,11 @@ var y2: bool = false or true; // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -84,13 +89,11 @@ var y2: bool = false or true; // CHECK:STDOUT: %.loc37_10.2: type = converted %.loc37_10.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %x2.var: ref %.1 = var x2 // CHECK:STDOUT: %x2: ref %.1 = bind_name x2, %x2.var -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %bool.make_type.loc47: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc47_8.1: type = value_of_initializer %bool.make_type.loc47 [template = bool] // CHECK:STDOUT: %.loc47_8.2: type = converted %bool.make_type.loc47, %.loc47_8.1 [template = bool] // CHECK:STDOUT: %y.var: ref bool = var y // CHECK:STDOUT: %y: ref bool = bind_name y, %y.var -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %bool.make_type.loc56: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc56_9.1: type = value_of_initializer %bool.make_type.loc56 [template = bool] // CHECK:STDOUT: %.loc56_9.2: type = converted %bool.make_type.loc56, %.loc56_9.1 [template = bool] diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/no_prelude/export_name.carbon index 425bf3e3b1cf..dbebcd99f26e 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/no_prelude/export_name.carbon @@ -69,13 +69,16 @@ var w: () = v; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: ref %.1 = import_ref ir1, inst+5, loaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .v = %v // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: ref %.1 = import_ref ir1, inst+5, loaded -// CHECK:STDOUT: %v: ref %.1 = export v, %import_ref +// CHECK:STDOUT: %v: ref %.1 = export v, imports.%import_ref // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_use_export.carbon @@ -85,13 +88,16 @@ var w: () = v; // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: ref %.1 = import_ref ir1, inst+4, loaded [template = ] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .v = %import_ref +// CHECK:STDOUT: .v = imports.%import_ref // CHECK:STDOUT: .w = %w // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: ref %.1 = import_ref ir1, inst+4, loaded [template = ] // CHECK:STDOUT: %.loc15_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %w.var: ref %.1 = var w @@ -100,7 +106,7 @@ var w: () = v; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v.ref: ref %.1 = name_ref v, file.%import_ref [template = ] +// CHECK:STDOUT: %v.ref: ref %.1 = name_ref v, imports.%import_ref [template = ] // CHECK:STDOUT: %.loc15_13: init %.1 = tuple_init () to file.%w.var [template = constants.%tuple] // CHECK:STDOUT: %.loc15_14: init %.1 = converted %v.ref, %.loc15_13 [template = constants.%tuple] // CHECK:STDOUT: assign file.%w.var, %.loc15_14 diff --git a/toolchain/check/testdata/var/no_prelude/import.carbon b/toolchain/check/testdata/var/no_prelude/import.carbon index 530aa31fb9c0..476f082f2752 100644 --- a/toolchain/check/testdata/var/no_prelude/import.carbon +++ b/toolchain/check/testdata/var/no_prelude/import.carbon @@ -53,14 +53,17 @@ var a: () = a_ref; // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: ref %.1 = import_ref ir0, inst+5, loaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = %import_ref +// CHECK:STDOUT: .a_ref = imports.%import_ref // CHECK:STDOUT: .a = %a // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: ref %.1 = import_ref ir0, inst+5, loaded // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -69,7 +72,7 @@ var a: () = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %a_ref.ref: ref %.1 = name_ref a_ref, file.%import_ref +// CHECK:STDOUT: %a_ref.ref: ref %.1 = name_ref a_ref, imports.%import_ref // CHECK:STDOUT: %.loc4_13: init %.1 = tuple_init () to file.%a.var [template = constants.%tuple] // CHECK:STDOUT: %.loc4_18: init %.1 = converted %a_ref.ref, %.loc4_13 [template = constants.%tuple] // CHECK:STDOUT: assign file.%a.var, %.loc4_18 diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index 43d1d8f0e6ab..7dbef8602136 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -84,14 +84,17 @@ var v2: () = Test.v; // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: ref %.1 = import_ref ir0, inst+5, loaded +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .v [private] = %import_ref +// CHECK:STDOUT: .v [private] = imports.%import_ref // CHECK:STDOUT: .v2 = %v2 // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: ref %.1 = import_ref ir0, inst+5, loaded // CHECK:STDOUT: %.loc4_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %v2.var: ref %.1 = var v2 @@ -100,7 +103,7 @@ var v2: () = Test.v; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v.ref: ref %.1 = name_ref v, file.%import_ref +// CHECK:STDOUT: %v.ref: ref %.1 = name_ref v, imports.%import_ref // CHECK:STDOUT: %.loc4_14: init %.1 = tuple_init () to file.%v2.var [template = constants.%tuple] // CHECK:STDOUT: %.loc4_15: init %.1 = converted %v.ref, %.loc4_14 [template = constants.%tuple] // CHECK:STDOUT: assign file.%v2.var, %.loc4_15 diff --git a/toolchain/check/testdata/while/break_continue.carbon b/toolchain/check/testdata/while/break_continue.carbon index 02d0a2fc1c4a..8792d7cce09c 100644 --- a/toolchain/check/testdata/while/break_continue.carbon +++ b/toolchain/check/testdata/while/break_continue.carbon @@ -56,6 +56,17 @@ fn While() { // CHECK:STDOUT: %While: %While.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -71,56 +82,48 @@ fn While() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] // CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type.loc11, %.loc11_11.1 [template = bool] // CHECK:STDOUT: @A.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type.loc12 [template = bool] // CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type.loc12, %.loc12_11.1 [template = bool] // CHECK:STDOUT: @B.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] { // CHECK:STDOUT: %bool.make_type.loc13: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %bool.make_type.loc13 [template = bool] // CHECK:STDOUT: %.loc13_11.2: type = converted %bool.make_type.loc13, %.loc13_11.1 [template = bool] // CHECK:STDOUT: @C.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] { // CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %bool.make_type.loc14 [template = bool] // CHECK:STDOUT: %.loc14_11.2: type = converted %bool.make_type.loc14, %.loc14_11.1 [template = bool] // CHECK:STDOUT: @D.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] { // CHECK:STDOUT: %bool.make_type.loc15: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %bool.make_type.loc15 [template = bool] // CHECK:STDOUT: %.loc15_11.2: type = converted %bool.make_type.loc15, %.loc15_11.1 [template = bool] // CHECK:STDOUT: @E.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type.loc16: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %bool.make_type.loc16 [template = bool] // CHECK:STDOUT: %.loc16_11.2: type = converted %bool.make_type.loc16, %.loc16_11.1 [template = bool] // CHECK:STDOUT: @F.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %bool.make_type.loc17: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc17_11.1: type = value_of_initializer %bool.make_type.loc17 [template = bool] // CHECK:STDOUT: %.loc17_11.2: type = converted %bool.make_type.loc17, %.loc17_11.1 [template = bool] // CHECK:STDOUT: @G.%return: ref bool = var // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] { // CHECK:STDOUT: %bool.make_type.loc18: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %bool.make_type.loc18 [template = bool] diff --git a/toolchain/check/testdata/while/unreachable_end.carbon b/toolchain/check/testdata/while/unreachable_end.carbon index 352c406937aa..fb77646345b3 100644 --- a/toolchain/check/testdata/while/unreachable_end.carbon +++ b/toolchain/check/testdata/while/unreachable_end.carbon @@ -41,6 +41,10 @@ fn While() { // CHECK:STDOUT: %While: %While.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -52,7 +56,6 @@ fn While() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/while/while.carbon b/toolchain/check/testdata/while/while.carbon index c95ed5cba411..d0e1364178b6 100644 --- a/toolchain/check/testdata/while/while.carbon +++ b/toolchain/check/testdata/while/while.carbon @@ -40,6 +40,10 @@ fn While() { // CHECK:STDOUT: %While: %While.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = %Core @@ -51,7 +55,6 @@ fn While() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Core: = namespace %Core.import, [template] {} -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref ir7, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 41deacb93cb5..64de8562dd56 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -42,6 +42,7 @@ class Formatter { out_ << "--- " << sem_ir_.filename() << "\n\n"; FormatConstants(); + FormatImportRefs(); out_ << inst_namer_.GetScopeName(InstNamer::ScopeId::File) << " "; OpenBrace(); @@ -141,6 +142,20 @@ class Formatter { out_ << "\n\n"; } + auto FormatImportRefs() -> void { + auto import_refs = sem_ir_.inst_blocks().Get(InstBlockId::ImportRefs); + if (import_refs.empty()) { + return; + } + + llvm::SaveAndRestore scope(scope_, InstNamer::ScopeId::ImportRefs); + out_ << inst_namer_.GetScopeName(InstNamer::ScopeId::ImportRefs) << " "; + OpenBrace(); + FormatCodeBlock(import_refs); + CloseBrace(); + out_ << "\n\n"; + } + auto FormatClass(ClassId id) -> void { const Class& class_info = sem_ir_.classes().Get(id); diff --git a/toolchain/sem_ir/ids.h b/toolchain/sem_ir/ids.h index 559774328f06..33e42a45d265 100644 --- a/toolchain/sem_ir/ids.h +++ b/toolchain/sem_ir/ids.h @@ -567,10 +567,14 @@ struct InstBlockId : public IdBase, public Printable { // 0-index block. static const InstBlockId Empty; - // Exported instructions. Always the 1-index block. Empty until the File is - // fully checked; intermediate state is in the Check::Context. + // Exported instructions. Empty until the File is fully checked; intermediate + // state is in the Check::Context. static const InstBlockId Exports; + // ImportRef instructions. Empty until the File is fully checked; intermediate + // state is in the Check::Context. + static const InstBlockId ImportRefs; + // Global declaration initialization instructions. Empty if none are present. // Otherwise, __global_init function will be generated and this block will // be inserted into it. @@ -590,6 +594,8 @@ struct InstBlockId : public IdBase, public Printable { out << "empty"; } else if (*this == Exports) { out << "exports"; + } else if (*this == ImportRefs) { + out << "import_refs"; } else if (*this == GlobalInit) { out << "global_init"; } else { @@ -601,9 +607,10 @@ struct InstBlockId : public IdBase, public Printable { constexpr InstBlockId InstBlockId::Empty = InstBlockId(0); constexpr InstBlockId InstBlockId::Exports = InstBlockId(1); +constexpr InstBlockId InstBlockId::ImportRefs = InstBlockId(2); +constexpr InstBlockId InstBlockId::GlobalInit = InstBlockId(3); constexpr InstBlockId InstBlockId::Invalid = InstBlockId(InvalidIndex); constexpr InstBlockId InstBlockId::Unreachable = InstBlockId(InvalidIndex - 1); -constexpr InstBlockId InstBlockId::GlobalInit = InstBlockId(2); // The ID of a type. struct TypeId : public IdBase, public Printable { diff --git a/toolchain/sem_ir/inst.h b/toolchain/sem_ir/inst.h index e99fe7080623..ccc7a26673c1 100644 --- a/toolchain/sem_ir/inst.h +++ b/toolchain/sem_ir/inst.h @@ -445,6 +445,8 @@ class InstBlockStore : public BlockValueStore { CARBON_CHECK(empty_id == InstBlockId::Empty); auto exports_id = AddDefaultValue(); CARBON_CHECK(exports_id == InstBlockId::Exports); + auto import_refs_id = AddDefaultValue(); + CARBON_CHECK(import_refs_id == InstBlockId::ImportRefs); auto global_init_id = AddDefaultValue(); CARBON_CHECK(global_init_id == InstBlockId::GlobalInit); } diff --git a/toolchain/sem_ir/inst_namer.cpp b/toolchain/sem_ir/inst_namer.cpp index 2f75f69ba5c8..1a8d5e6dc19a 100644 --- a/toolchain/sem_ir/inst_namer.cpp +++ b/toolchain/sem_ir/inst_namer.cpp @@ -29,6 +29,10 @@ InstNamer::InstNamer(const Lex::TokenizedBuffer& tokenized_buffer, // Build the constants scope. CollectNamesInBlock(ScopeId::Constants, sem_ir.constants().array_ref()); + // Build the ImportRef scope. + CollectNamesInBlock(ScopeId::ImportRefs, + sem_ir.inst_blocks().Get(SemIR::InstBlockId::ImportRefs)); + // Build the file scope. CollectNamesInBlock(ScopeId::File, sem_ir.top_inst_block_id()); @@ -110,7 +114,7 @@ auto InstNamer::GetScopeName(ScopeId scope) const -> std::string { // These are treated as SemIR keywords. case ScopeId::File: return "file"; - case ScopeId::ImportRef: + case ScopeId::ImportRefs: return "imports"; case ScopeId::Constants: return "constants"; @@ -468,7 +472,7 @@ auto InstNamer::CollectNamesInBlock(ScopeId scope_id, if (const_id.is_valid() && const_id.is_template()) { auto const_inst_id = sem_ir_.constant_values().GetInstId(const_id); if (!insts[const_inst_id.index].second) { - CollectNamesInBlock(ScopeId::ImportRef, const_inst_id); + CollectNamesInBlock(ScopeId::ImportRefs, const_inst_id); } } continue; diff --git a/toolchain/sem_ir/inst_namer.h b/toolchain/sem_ir/inst_namer.h index f486588eebc7..428812ade315 100644 --- a/toolchain/sem_ir/inst_namer.h +++ b/toolchain/sem_ir/inst_namer.h @@ -20,7 +20,7 @@ class InstNamer { enum class ScopeId : int32_t { None = -1, File = 0, - ImportRef = 1, + ImportRefs = 1, Constants = 2, FirstFunction = 3, }; diff --git a/toolchain/sem_ir/yaml_test.cpp b/toolchain/sem_ir/yaml_test.cpp index efb03be24161..e2e52df53211 100644 --- a/toolchain/sem_ir/yaml_test.cpp +++ b/toolchain/sem_ir/yaml_test.cpp @@ -92,10 +92,11 @@ TEST(SemIRTest, YAML) { Yaml::Mapping(ElementsAre( Pair("empty", Yaml::Mapping(IsEmpty())), Pair("exports", Yaml::Mapping(Each(Pair(_, inst_id)))), + Pair("import_refs", Yaml::Mapping(IsEmpty())), Pair("global_init", Yaml::Mapping(IsEmpty())), - Pair("block3", Yaml::Mapping(Each(Pair(_, inst_id)))), Pair("block4", Yaml::Mapping(Each(Pair(_, inst_id)))), - Pair("block5", Yaml::Mapping(Each(Pair(_, inst_id))))))))); + Pair("block5", Yaml::Mapping(Each(Pair(_, inst_id)))), + Pair("block6", Yaml::Mapping(Each(Pair(_, inst_id))))))))); auto root = Yaml::Sequence(ElementsAre(Yaml::Mapping( ElementsAre(Pair("filename", "test.carbon"), Pair("sem_ir", file)))));