diff --git a/toolchain/check/import_ref.cpp b/toolchain/check/import_ref.cpp index 91c0a08e101f..b374b160fd3b 100644 --- a/toolchain/check/import_ref.cpp +++ b/toolchain/check/import_ref.cpp @@ -1501,11 +1501,10 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, LoadLocalPatternConstantIds(resolver, import_class.param_patterns_id); auto generic_data = GetLocalGenericData(resolver, import_class.generic_id); auto self_const_id = GetLocalConstantId(resolver, import_class.self_type_id); - auto complete_type_witness_id = + auto complete_type_witness_const_id = import_class.complete_type_witness_id.is_valid() - ? GetLocalConstantInstId(resolver, - import_class.complete_type_witness_id) - : SemIR::InstId::Invalid; + ? GetLocalConstantId(resolver, import_class.complete_type_witness_id) + : SemIR::ConstantId::Invalid; auto base_id = import_class.base_id.is_valid() ? GetLocalConstantInstId(resolver, import_class.base_id) : SemIR::InstId::Invalid; @@ -1529,6 +1528,11 @@ static auto TryResolveTypedInst(ImportRefResolver& resolver, resolver.local_context().GetTypeIdForTypeConstant(self_const_id); if (import_class.is_defined()) { + auto complete_type_witness_id = AddLoadedImportRef( + resolver, + resolver.local_context().GetBuiltinType( + SemIR::BuiltinInstKind::WitnessType), + import_class.complete_type_witness_id, complete_type_witness_const_id); AddClassDefinition(resolver, import_class, new_class, complete_type_witness_id, base_id, adapt_id); } diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index 5e40b73ede28..24497bf7aafc 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -105,7 +105,8 @@ var d: D* = &c; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -119,8 +120,8 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_orig.carbon @@ -134,7 +135,8 @@ var d: D* = &c; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -148,8 +150,8 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_export.carbon @@ -162,8 +164,9 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+9, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+10, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+8, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -179,8 +182,8 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -199,7 +202,7 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export, inst+9, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -231,9 +234,10 @@ var d: D* = &c; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+9, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, inst+9, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_orig, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+10, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, inst+10, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//export_orig, inst+8, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_orig, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -255,8 +259,8 @@ var d: D* = &c; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = 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 706acb2e8f4c..1a2cc89b6378 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -111,7 +111,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: %import_ref.1 = import_ref Main//class1, inst+1, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//class1, inst+7, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3 = import_ref Main//class1, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//class1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//class1, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//class1, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -133,8 +134,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- class3.carbon @@ -147,9 +148,10 @@ var c: () = a_alias_alias; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, inst+16, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//class2, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, inst+17, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//class2, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//class2, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -167,8 +169,8 @@ var c: () = a_alias_alias; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- var1.carbon diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index fcac795c57ea..f3a2c909df1e 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -90,7 +90,8 @@ var inst: Test.A = {}; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Test//def, inst+1, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Test//def, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Test//def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Test//def, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Test//def, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -108,8 +109,8 @@ var inst: Test.A = {}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/no_prelude/import_order.carbon index 0d985b67074a..058cd27a713f 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_order.carbon @@ -89,8 +89,9 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+14, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+16, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5: type = import_ref Main//a, inst+18, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.7: %.4 = import_ref Main//a, inst+7, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.6: = import_ref Main//a, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+2, unloaded +// CHECK:STDOUT: %import_ref.8: %.4 = import_ref Main//a, inst+7, loaded [template = %.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -122,9 +123,9 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .v = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: .v = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -138,7 +139,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc7_25: init %C = converted %.loc7_24.1, %.loc7_24.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%d_val.var, %.loc7_25 // CHECK:STDOUT: %d_val.ref: ref %C = name_ref d_val, file.%d_val -// CHECK:STDOUT: %v.ref.loc8: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc8: %.4 = name_ref v, imports.%import_ref.8 [template = imports.%.1] // CHECK:STDOUT: %.loc8_27.1: ref %empty_tuple.type = class_element_access %d_val.ref, element0 // CHECK:STDOUT: %.loc8_29.1: %.1 = struct_literal (%.loc8_27.1) // CHECK:STDOUT: %.loc8_29.2: ref %empty_tuple.type = class_element_access file.%c_val.var, element0 @@ -148,7 +149,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc8_30: init %C = converted %.loc8_29.1, %.loc8_29.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%c_val.var, %.loc8_30 // CHECK:STDOUT: %c_val.ref: ref %C = name_ref c_val, file.%c_val -// CHECK:STDOUT: %v.ref.loc9: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc9: %.4 = name_ref v, imports.%import_ref.8 [template = imports.%.1] // CHECK:STDOUT: %.loc9_27.1: ref %empty_tuple.type = class_element_access %c_val.ref, element0 // CHECK:STDOUT: %.loc9_29.1: %.1 = struct_literal (%.loc9_27.1) // CHECK:STDOUT: %.loc9_29.2: ref %empty_tuple.type = class_element_access file.%b_val.var, element0 @@ -158,7 +159,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc9_30: init %C = converted %.loc9_29.1, %.loc9_29.4 [template = constants.%struct] // CHECK:STDOUT: assign file.%b_val.var, %.loc9_30 // CHECK:STDOUT: %b_val.ref: ref %C = name_ref b_val, file.%b_val -// CHECK:STDOUT: %v.ref.loc10: %.4 = name_ref v, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %v.ref.loc10: %.4 = name_ref v, imports.%import_ref.8 [template = imports.%.1] // CHECK:STDOUT: %.loc10_27.1: ref %empty_tuple.type = class_element_access %b_val.ref, element0 // CHECK:STDOUT: %.loc10_29.1: %.1 = struct_literal (%.loc10_27.1) // CHECK:STDOUT: %.loc10_29.2: ref %empty_tuple.type = class_element_access file.%a_val.var, element0 diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index db16c087bb98..7a90f3cb1bbc 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -202,7 +202,8 @@ var c: Other.C = {}; // CHECK:STDOUT: import Other//other_define // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -221,8 +222,8 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -296,7 +297,8 @@ var c: Other.C = {}; // CHECK:STDOUT: import Other//other_extern // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -315,8 +317,8 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -348,7 +350,8 @@ var c: Other.C = {}; // CHECK:STDOUT: import Other//other_conflict // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//other_define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//other_define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//other_define, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//other_define, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -367,8 +370,8 @@ var c: Other.C = {}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index c4708bac5f31..98fa8aff1e78 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -97,7 +97,8 @@ var a: Incomplete; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -117,8 +118,8 @@ var a: Incomplete; // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { diff --git a/toolchain/check/testdata/class/generic/adapt.carbon b/toolchain/check/testdata/class/generic/adapt.carbon index d80d670c9793..d431aa263d23 100644 --- a/toolchain/check/testdata/class/generic/adapt.carbon +++ b/toolchain/check/testdata/class/generic/adapt.carbon @@ -290,13 +290,15 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %import_ref.2: type = import_ref Main//adapt_specific_type, inst+26, loaded [template = constants.%Adapter] // CHECK:STDOUT: %import_ref.3 = import_ref Main//adapt_specific_type, inst+65, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.8 +// CHECK:STDOUT: .Int = %import_ref.10 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//adapt_specific_type, inst+15, unloaded -// CHECK:STDOUT: %import_ref.5: @C.%.1 (%.6) = import_ref Main//adapt_specific_type, inst+18, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//adapt_specific_type, inst+27, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//adapt_specific_type, inst+20, loaded [symbolic = @C.%.3 (constants.%.3)] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//adapt_specific_type, inst+15, unloaded +// CHECK:STDOUT: %import_ref.6: @C.%.1 (%.6) = import_ref Main//adapt_specific_type, inst+18, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8: = import_ref Main//adapt_specific_type, inst+51, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//adapt_specific_type, inst+27, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -329,8 +331,8 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Adapter { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%T: type) { @@ -345,9 +347,9 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -362,7 +364,7 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.3] // CHECK:STDOUT: %.loc7_13.1: %C.3 = as_compatible %a.ref // CHECK:STDOUT: %.loc7_13.2: %C.3 = converted %a.ref, %.loc7_13.1 -// CHECK:STDOUT: %x.ref: %.7 = name_ref x, imports.%import_ref.5 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.7 = name_ref x, imports.%import_ref.6 [template = imports.%.1] // CHECK:STDOUT: %.loc7_23.1: ref %i32 = class_element_access %.loc7_13.2, element0 // CHECK:STDOUT: %.loc7_23.2: %i32 = bind_value %.loc7_23.1 // CHECK:STDOUT: return %.loc7_23.2 @@ -656,15 +658,17 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_adapt_specific_type_library, inst+9, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//extend_adapt_specific_type_library, inst+26, loaded [template = constants.%Adapter] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.8 -// CHECK:STDOUT: .ImplicitAs = %import_ref.9 +// CHECK:STDOUT: .Int = %import_ref.10 +// CHECK:STDOUT: .ImplicitAs = %import_ref.11 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extend_adapt_specific_type_library, inst+15, unloaded -// CHECK:STDOUT: %import_ref.4: @C.%.1 (%.6) = import_ref Main//extend_adapt_specific_type_library, inst+18, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_adapt_specific_type_library, inst+27, unloaded -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//extend_adapt_specific_type_library, inst+44, loaded [template = constants.%C.3] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//extend_adapt_specific_type_library, inst+20, loaded [symbolic = @C.%.3 (constants.%.3)] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_adapt_specific_type_library, inst+15, unloaded +// CHECK:STDOUT: %import_ref.5: @C.%.1 (%.6) = import_ref Main//extend_adapt_specific_type_library, inst+18, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7: = import_ref Main//extend_adapt_specific_type_library, inst+51, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_adapt_specific_type_library, inst+27, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//extend_adapt_specific_type_library, inst+44, loaded [template = constants.%C.3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -696,9 +700,9 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class @Adapter { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: extend imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: extend imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%T: type) { @@ -713,16 +717,16 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ImportedAccess(%a.param_patt: %Adapter) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.ref: %Adapter = name_ref a, %a -// CHECK:STDOUT: %x.ref: %.7 = name_ref x, imports.%import_ref.4 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.7 = name_ref x, imports.%import_ref.5 [template = imports.%.1] // CHECK:STDOUT: %.loc14_11.1: %C.3 = converted %a.ref, [template = ] // CHECK:STDOUT: %.loc14_11.2: %i32 = class_element_access , element0 [template = ] // CHECK:STDOUT: return @@ -886,11 +890,12 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: %import_ref.1: %Adapter.type = import_ref Main//adapt_generic_type, inst+9, loaded [template = constants.%Adapter.1] // CHECK:STDOUT: %import_ref.2 = import_ref Main//adapt_generic_type, inst+51, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.5 +// CHECK:STDOUT: .Int = %import_ref.6 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//adapt_generic_type, inst+15, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//adapt_generic_type, inst+18, loaded [symbolic = @Adapter.%.1 (constants.%.1)] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//adapt_generic_type, inst+15, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -955,8 +960,8 @@ fn ImportedConvertLocal(a: Adapter(C)) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.1 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/base_is_generic.carbon b/toolchain/check/testdata/class/generic/base_is_generic.carbon index e8dcdc8a8255..d7dc83c95734 100644 --- a/toolchain/check/testdata/class/generic/base_is_generic.carbon +++ b/toolchain/check/testdata/class/generic/base_is_generic.carbon @@ -268,7 +268,7 @@ fn H() { // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: %ImportedDoubleFieldAccess.type: type = fn_type @ImportedDoubleFieldAccess [template] // CHECK:STDOUT: %ImportedDoubleFieldAccess: %ImportedDoubleFieldAccess.type = struct_value () [template] -// CHECK:STDOUT: %.17: type = unbound_element_type %Param, %i32 [template] +// CHECK:STDOUT: %.18: type = unbound_element_type %Param, %i32 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -277,17 +277,20 @@ fn H() { // CHECK:STDOUT: %import_ref.3: type = import_ref Main//extend_generic_base, inst+48, loaded [template = constants.%Derived] // CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_generic_base, inst+78, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.13 +// CHECK:STDOUT: .Int = %import_ref.16 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Main//extend_generic_base, inst+27, unloaded -// CHECK:STDOUT: %import_ref.6: %.17 = import_ref Main//extend_generic_base, inst+44, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//extend_generic_base, inst+15, unloaded -// CHECK:STDOUT: %import_ref.8: @Base.%.1 (%.9) = import_ref Main//extend_generic_base, inst+18, loaded [template = %.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_base, inst+49, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//extend_generic_base, inst+61, unloaded -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//extend_generic_base, inst+52, loaded [template = constants.%Base.3] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_base, inst+46, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_base, inst+27, unloaded +// CHECK:STDOUT: %import_ref.7: %.18 = import_ref Main//extend_generic_base, inst+44, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8: = import_ref Main//extend_generic_base, inst+20, loaded [symbolic = @Base.%.3 (constants.%.5)] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_base, inst+15, unloaded +// CHECK:STDOUT: %import_ref.10: @Base.%.1 (%.9) = import_ref Main//extend_generic_base, inst+18, loaded [template = %.2] +// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_generic_base, inst+63, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//extend_generic_base, inst+49, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//extend_generic_base, inst+61, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//extend_generic_base, inst+52, loaded [template = constants.%Base.3] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -321,17 +324,17 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 -// CHECK:STDOUT: .base = imports.%import_ref.11 -// CHECK:STDOUT: extend imports.%import_ref.12 -// CHECK:STDOUT: complete_type_witness = constants.%.8 +// CHECK:STDOUT: .Self = imports.%import_ref.13 +// CHECK:STDOUT: .base = imports.%import_ref.14 +// CHECK:STDOUT: extend imports.%import_ref.15 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Param { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .y = imports.%import_ref.7 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Base(constants.%T: type) { @@ -346,20 +349,20 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: .x = imports.%import_ref.8 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .x = imports.%import_ref.10 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ImportedDoubleFieldAccess(%d.param_patt: %Derived) -> %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d -// CHECK:STDOUT: %x.ref: %.10 = name_ref x, imports.%import_ref.8 [template = imports.%.2] +// CHECK:STDOUT: %x.ref: %.10 = name_ref x, imports.%import_ref.10 [template = imports.%.2] // CHECK:STDOUT: %.loc7_11.1: ref %Base.3 = class_element_access %d.ref, element0 // CHECK:STDOUT: %.loc7_11.2: ref %Base.3 = converted %d.ref, %.loc7_11.1 // CHECK:STDOUT: %.loc7_11.3: ref %Param = class_element_access %.loc7_11.2, element0 -// CHECK:STDOUT: %y.ref: %.17 = name_ref y, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %y.ref: %.18 = name_ref y, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc7_13.1: ref %i32 = class_element_access %.loc7_11.3, element0 // CHECK:STDOUT: %.loc7_13.2: %i32 = bind_value %.loc7_13.1 // CHECK:STDOUT: return %.loc7_13.2 @@ -784,11 +787,13 @@ fn H() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Main//extend_generic_symbolic_base, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6: @X.%G.type (%G.type.1) = import_ref Main//extend_generic_symbolic_base, inst+21, loaded [symbolic = @X.%G (constants.%G.1)] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_generic_symbolic_base, inst+52, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//extend_generic_symbolic_base, inst+61, unloaded -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//extend_generic_symbolic_base, inst+55, loaded [symbolic = @C.%X (constants.%X.3)] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extend_generic_symbolic_base, inst+26, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_generic_symbolic_base, inst+15, unloaded +// CHECK:STDOUT: %import_ref.7: @X.%G.type (%G.type.1) = import_ref Main//extend_generic_symbolic_base, inst+21, loaded [symbolic = @X.%G (constants.%G.1)] +// CHECK:STDOUT: %import_ref.9: = import_ref Main//extend_generic_symbolic_base, inst+63, loaded [symbolic = @C.%.3 (constants.%.6)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//extend_generic_symbolic_base, inst+52, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//extend_generic_symbolic_base, inst+61, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//extend_generic_symbolic_base, inst+55, loaded [symbolic = @C.%X (constants.%X.3)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -817,10 +822,10 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: .base = imports.%import_ref.9 -// CHECK:STDOUT: extend imports.%import_ref.10 -// CHECK:STDOUT: complete_type_witness = constants.%.6 +// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: .base = imports.%import_ref.11 +// CHECK:STDOUT: extend imports.%import_ref.12 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -834,9 +839,9 @@ fn H() { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .G = imports.%import_ref.6 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .G = imports.%import_ref.7 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -852,7 +857,7 @@ fn H() { // CHECK:STDOUT: %.loc7_17.1: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i32] // CHECK:STDOUT: %.loc7_17.2: type = converted %int.make_type_signed.loc7_18, %.loc7_17.1 [template = constants.%i32] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.3] -// CHECK:STDOUT: %.loc7_22.1: %G.type.3 = specific_constant imports.%import_ref.6, @X(constants.%i32) [template = constants.%G.3] +// CHECK:STDOUT: %.loc7_22.1: %G.type.3 = specific_constant imports.%import_ref.7, @X(constants.%i32) [template = constants.%G.3] // CHECK:STDOUT: %G.ref: %G.type.3 = name_ref G, %.loc7_22.1 [template = constants.%G.3] // CHECK:STDOUT: %.loc7_22.2: = specific_function %G.ref, @G(constants.%i32) [template = constants.%.14] // CHECK:STDOUT: %G.call: init %i32 = call %.loc7_22.2() diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 8c76ba79ec44..65cb75b1abdb 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -350,7 +350,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] // CHECK:STDOUT: %.32: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] // CHECK:STDOUT: %.33: %.32 = assoc_entity element0, imports.%import_ref.10 [template] -// CHECK:STDOUT: %.34: %.2 = assoc_entity element0, imports.%import_ref.43 [symbolic] +// CHECK:STDOUT: %.34: %.2 = assoc_entity element0, imports.%import_ref.44 [symbolic] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.24) [template] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] // CHECK:STDOUT: %.35: = interface_witness (%Convert.14) [template] @@ -363,8 +363,8 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+20, loaded [template = constants.%CompleteClass.1] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.41 -// CHECK:STDOUT: .ImplicitAs = %import_ref.42 +// CHECK:STDOUT: .Int = %import_ref.42 +// CHECK:STDOUT: .ImplicitAs = %import_ref.43 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -400,9 +400,10 @@ class Class(U:! type) { // CHECK:STDOUT: %import_ref.35: type = import_ref Main//foo, inst+333, loaded [symbolic = @impl.8.%uN (constants.%uN)] // CHECK:STDOUT: %import_ref.36: type = import_ref Main//foo, inst+334, loaded [template = constants.%As.type.5] // CHECK:STDOUT: %import_ref.37 = import_ref Main//foo, inst+335, unloaded -// CHECK:STDOUT: %import_ref.38 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst+42, unloaded -// CHECK:STDOUT: %import_ref.40 = import_ref Main//foo, inst+51, unloaded +// CHECK:STDOUT: %import_ref.38: = import_ref Main//foo, inst+55, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst+25, unloaded +// CHECK:STDOUT: %import_ref.40 = import_ref Main//foo, inst+42, unloaded +// CHECK:STDOUT: %import_ref.41 = import_ref Main//foo, inst+51, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -643,10 +644,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.38 -// CHECK:STDOUT: .n = imports.%import_ref.39 -// CHECK:STDOUT: .F = imports.%import_ref.40 -// CHECK:STDOUT: complete_type_witness = constants.%.26 +// CHECK:STDOUT: .Self = imports.%import_ref.39 +// CHECK:STDOUT: .n = imports.%import_ref.40 +// CHECK:STDOUT: .F = imports.%import_ref.41 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.38 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1126,9 +1127,10 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.6: @CompleteClass.%.1 (%.4) = import_ref Main//foo, inst+42, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+51, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//foo, inst+55, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+25, unloaded +// CHECK:STDOUT: %import_ref.7: @CompleteClass.%.1 (%.4) = import_ref Main//foo, inst+42, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8: @CompleteClass.%F.type (%F.type.1) = import_ref Main//foo, inst+51, loaded [symbolic = @CompleteClass.%F (constants.%F.1)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1178,10 +1180,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .n = imports.%import_ref.6 -// CHECK:STDOUT: .F = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .n = imports.%import_ref.7 +// CHECK:STDOUT: .F = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1200,7 +1202,7 @@ class Class(U:! type) { // 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: %.loc7_11.1: %F.type.2 = specific_constant imports.%import_ref.7, @CompleteClass(constants.%i32) [template = constants.%F.2] +// CHECK:STDOUT: %.loc7_11.1: %F.type.2 = specific_constant imports.%import_ref.8, @CompleteClass(constants.%i32) [template = constants.%F.2] // CHECK:STDOUT: %F.ref.loc7: %F.type.2 = name_ref F, %.loc7_11.1 [template = constants.%F.2] // CHECK:STDOUT: %.loc7_11.2: = specific_function %F.ref.loc7, @F.1(constants.%i32) [template = constants.%.7] // CHECK:STDOUT: %F.call.loc7: init %i32 = call %.loc7_11.2() @@ -1232,7 +1234,7 @@ class Class(U:! type) { // CHECK:STDOUT: %F.call: init %CompleteClass.3 = call %F.ref() to %.loc11_7 // CHECK:STDOUT: assign %v.var, %F.call // CHECK:STDOUT: %v.ref: ref %CompleteClass.3 = name_ref v, %v -// CHECK:STDOUT: %n.ref: %.5 = name_ref n, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %n.ref: %.5 = name_ref n, imports.%import_ref.7 [template = imports.%.1] // CHECK:STDOUT: %.loc12_11.1: ref %i32 = class_element_access %v.ref, element0 // CHECK:STDOUT: %.loc12_11.2: %i32 = bind_value %.loc12_11.1 // CHECK:STDOUT: return %.loc12_11.2 @@ -1330,7 +1332,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic] // CHECK:STDOUT: %.22: type = facet_access_type %Self.4 [symbolic] // CHECK:STDOUT: %.23: type = assoc_entity_type %As.type.2, %Convert.type.8 [symbolic] -// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.33 [symbolic] +// CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.34 [symbolic] // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.7, @impl.5(%N) [symbolic] // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic] // CHECK:STDOUT: %.25: = interface_witness (%Convert.9) [symbolic] @@ -1346,7 +1348,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.6, @As(Core.IntLiteral) [template] // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [template] // CHECK:STDOUT: %.29: type = assoc_entity_type %As.type.5, %Convert.type.12 [template] -// CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.40 [template] +// CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.41 [template] // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.10, @impl.8(%N) [symbolic] // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [symbolic] // CHECK:STDOUT: %.31: = interface_witness (%Convert.13) [symbolic] @@ -1357,42 +1359,43 @@ class Class(U:! type) { // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+20, loaded [template = constants.%CompleteClass.1] // CHECK:STDOUT: %import_ref.3: %F.type.3 = import_ref Main//foo, inst+377, loaded [template = constants.%F.3] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.7 -// CHECK:STDOUT: .ImplicitAs = %import_ref.8 +// CHECK:STDOUT: .Int = %import_ref.8 +// CHECK:STDOUT: .ImplicitAs = %import_ref.9 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+25, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+42, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+51, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Main//foo, inst+116, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Main//foo, inst+117, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.4)] -// CHECK:STDOUT: %import_ref.16 = import_ref Main//foo, inst+118, unloaded -// CHECK:STDOUT: %import_ref.17: type = import_ref Main//foo, inst+142, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.18: type = import_ref Main//foo, inst+143, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] -// CHECK:STDOUT: %import_ref.19 = import_ref Main//foo, inst+144, unloaded -// CHECK:STDOUT: %import_ref.20: type = import_ref Main//foo, inst+167, loaded [symbolic = @impl.3.%iN (constants.%iN)] -// CHECK:STDOUT: %import_ref.21: type = import_ref Main//foo, inst+168, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.22 = import_ref Main//foo, inst+169, unloaded -// CHECK:STDOUT: %import_ref.24: type = import_ref Main//foo, inst+195, loaded [symbolic = @impl.4.%uN (constants.%uN)] -// CHECK:STDOUT: %import_ref.25: type = import_ref Main//foo, inst+196, loaded [template = constants.%ImplicitAs.type.6] -// CHECK:STDOUT: %import_ref.26 = import_ref Main//foo, inst+197, unloaded -// CHECK:STDOUT: %import_ref.27 = import_ref Main//foo, inst+223, unloaded -// CHECK:STDOUT: %import_ref.28 = import_ref Main//foo, inst+224, unloaded -// CHECK:STDOUT: %import_ref.29 = import_ref Main//foo, inst+225, unloaded -// CHECK:STDOUT: %import_ref.30: type = import_ref Main//foo, inst+229, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.31: type = import_ref Main//foo, inst+230, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] -// CHECK:STDOUT: %import_ref.32 = import_ref Main//foo, inst+231, unloaded -// CHECK:STDOUT: %import_ref.33 = import_ref Main//foo, inst+245, unloaded -// CHECK:STDOUT: %import_ref.34: type = import_ref Main//foo, inst+280, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.35: type = import_ref Main//foo, inst+281, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] -// CHECK:STDOUT: %import_ref.36 = import_ref Main//foo, inst+282, unloaded -// CHECK:STDOUT: %import_ref.37: type = import_ref Main//foo, inst+305, loaded [symbolic = @impl.7.%iN (constants.%iN)] -// CHECK:STDOUT: %import_ref.38: type = import_ref Main//foo, inst+306, loaded [template = constants.%As.type.5] -// CHECK:STDOUT: %import_ref.39 = import_ref Main//foo, inst+307, unloaded -// CHECK:STDOUT: %import_ref.41: type = import_ref Main//foo, inst+333, loaded [symbolic = @impl.8.%uN (constants.%uN)] -// CHECK:STDOUT: %import_ref.42: type = import_ref Main//foo, inst+334, loaded [template = constants.%As.type.5] -// CHECK:STDOUT: %import_ref.43 = import_ref Main//foo, inst+335, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//foo, inst+55, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+25, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+42, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//foo, inst+51, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref Main//foo, inst+116, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.16: type = import_ref Main//foo, inst+117, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.4)] +// CHECK:STDOUT: %import_ref.17 = import_ref Main//foo, inst+118, unloaded +// CHECK:STDOUT: %import_ref.18: type = import_ref Main//foo, inst+142, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.19: type = import_ref Main//foo, inst+143, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.5)] +// CHECK:STDOUT: %import_ref.20 = import_ref Main//foo, inst+144, unloaded +// CHECK:STDOUT: %import_ref.21: type = import_ref Main//foo, inst+167, loaded [symbolic = @impl.3.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.22: type = import_ref Main//foo, inst+168, loaded [template = constants.%ImplicitAs.type.6] +// CHECK:STDOUT: %import_ref.23 = import_ref Main//foo, inst+169, unloaded +// CHECK:STDOUT: %import_ref.25: type = import_ref Main//foo, inst+195, loaded [symbolic = @impl.4.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.26: type = import_ref Main//foo, inst+196, loaded [template = constants.%ImplicitAs.type.6] +// CHECK:STDOUT: %import_ref.27 = import_ref Main//foo, inst+197, unloaded +// CHECK:STDOUT: %import_ref.28 = import_ref Main//foo, inst+223, unloaded +// CHECK:STDOUT: %import_ref.29 = import_ref Main//foo, inst+224, unloaded +// CHECK:STDOUT: %import_ref.30 = import_ref Main//foo, inst+225, unloaded +// CHECK:STDOUT: %import_ref.31: type = import_ref Main//foo, inst+229, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.32: type = import_ref Main//foo, inst+230, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)] +// CHECK:STDOUT: %import_ref.33 = import_ref Main//foo, inst+231, unloaded +// CHECK:STDOUT: %import_ref.34 = import_ref Main//foo, inst+245, unloaded +// CHECK:STDOUT: %import_ref.35: type = import_ref Main//foo, inst+280, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.36: type = import_ref Main//foo, inst+281, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)] +// CHECK:STDOUT: %import_ref.37 = import_ref Main//foo, inst+282, unloaded +// CHECK:STDOUT: %import_ref.38: type = import_ref Main//foo, inst+305, loaded [symbolic = @impl.7.%iN (constants.%iN)] +// CHECK:STDOUT: %import_ref.39: type = import_ref Main//foo, inst+306, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.40 = import_ref Main//foo, inst+307, unloaded +// CHECK:STDOUT: %import_ref.42: type = import_ref Main//foo, inst+333, loaded [symbolic = @impl.8.%uN (constants.%uN)] +// CHECK:STDOUT: %import_ref.43: type = import_ref Main//foo, inst+334, loaded [template = constants.%As.type.5] +// CHECK:STDOUT: %import_ref.44 = import_ref Main//foo, inst+335, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1418,13 +1421,13 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.8)] // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)] // CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.8) [symbolic = %.1 (constants.%.23)] -// CHECK:STDOUT: %.2: @As.%.1 (%.23) = assoc_entity element0, imports.%import_ref.33 [symbolic = %.2 (constants.%.24)] +// CHECK:STDOUT: %.2: @As.%.1 (%.23) = assoc_entity element0, imports.%import_ref.34 [symbolic = %.2 (constants.%.24)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.27 -// CHECK:STDOUT: .Convert = imports.%import_ref.28 -// CHECK:STDOUT: witness = (imports.%import_ref.29) +// CHECK:STDOUT: .Self = imports.%import_ref.28 +// CHECK:STDOUT: .Convert = imports.%import_ref.29 +// CHECK:STDOUT: witness = (imports.%import_ref.30) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1439,9 +1442,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)] // CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1456,9 +1459,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)] // CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.17)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: impl: imports.%import_ref.18 as imports.%import_ref.19 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: witness = imports.%import_ref.20 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1472,9 +1475,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.5) = struct_value () [symbolic = %Convert (constants.%Convert.5)] // CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.18)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: impl: imports.%import_ref.21 as imports.%import_ref.22 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: witness = imports.%import_ref.23 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1488,9 +1491,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)] // CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.21)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.24 as imports.%import_ref.25 { +// CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.26 +// CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1505,9 +1508,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)] // CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.25)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.30 as imports.%import_ref.31 { +// CHECK:STDOUT: impl: imports.%import_ref.31 as imports.%import_ref.32 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.32 +// CHECK:STDOUT: witness = imports.%import_ref.33 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1522,9 +1525,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)] // CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.27)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.34 as imports.%import_ref.35 { +// CHECK:STDOUT: impl: imports.%import_ref.35 as imports.%import_ref.36 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.36 +// CHECK:STDOUT: witness = imports.%import_ref.37 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1538,9 +1541,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.11) = struct_value () [symbolic = %Convert (constants.%Convert.11)] // CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.28)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.37 as imports.%import_ref.38 { +// CHECK:STDOUT: impl: imports.%import_ref.38 as imports.%import_ref.39 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.39 +// CHECK:STDOUT: witness = imports.%import_ref.40 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1554,9 +1557,9 @@ class Class(U:! type) { // CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.13) = struct_value () [symbolic = %Convert (constants.%Convert.13)] // CHECK:STDOUT: %.1: = interface_witness (%Convert) [symbolic = %.1 (constants.%.31)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.41 as imports.%import_ref.42 { +// CHECK:STDOUT: impl: imports.%import_ref.42 as imports.%import_ref.43 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.43 +// CHECK:STDOUT: witness = imports.%import_ref.44 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1572,10 +1575,10 @@ class Class(U:! type) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .n = imports.%import_ref.5 -// CHECK:STDOUT: .F = imports.%import_ref.6 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .n = imports.%import_ref.6 +// CHECK:STDOUT: .F = imports.%import_ref.7 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 9ef671c928cf..9ad6b11c6066 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -199,19 +199,23 @@ fn Run() { // CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+31, loaded [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+54, loaded [template = constants.%Incomplete] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.8 +// CHECK:STDOUT: .ImplicitAs = %import_ref.10 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+9, unloaded -// CHECK:STDOUT: %import_ref.7: %.37 = import_ref Main//a, inst+27, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.44 = import_ref Main//a, inst+32, unloaded -// CHECK:STDOUT: %import_ref.45: %F.type = import_ref Main//a, inst+39, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.46: %G.type = import_ref Main//a, inst+50, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//a, inst+29, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+9, unloaded +// CHECK:STDOUT: %import_ref.9: %.37 = import_ref Main//a, inst+27, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.46: = import_ref Main//a, inst+53, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.47 = import_ref Main//a, inst+32, unloaded -// CHECK:STDOUT: %import_ref.48 = import_ref Main//a, inst+39, unloaded -// CHECK:STDOUT: %import_ref.49 = import_ref Main//a, inst+50, unloaded +// CHECK:STDOUT: %import_ref.48: %F.type = import_ref Main//a, inst+39, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.49: %G.type = import_ref Main//a, inst+50, loaded [template = constants.%G] +// CHECK:STDOUT: %import_ref.50: = import_ref Main//a, inst+53, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.51 = import_ref Main//a, inst+32, unloaded +// CHECK:STDOUT: %import_ref.52 = import_ref Main//a, inst+39, unloaded +// CHECK:STDOUT: %import_ref.53 = import_ref Main//a, inst+50, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -230,31 +234,31 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Empty { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Field { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .x = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.6 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .x = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.44 -// CHECK:STDOUT: .F = imports.%import_ref.45 -// CHECK:STDOUT: .G = imports.%import_ref.46 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.47 +// CHECK:STDOUT: .F = imports.%import_ref.48 +// CHECK:STDOUT: .G = imports.%import_ref.49 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardDeclared.2 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.47 -// CHECK:STDOUT: .F = imports.%import_ref.48 -// CHECK:STDOUT: .G = imports.%import_ref.49 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.51 +// CHECK:STDOUT: .F = imports.%import_ref.52 +// CHECK:STDOUT: .G = imports.%import_ref.53 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Incomplete; @@ -284,7 +288,7 @@ fn Run() { // CHECK:STDOUT: %.loc9_26: init %Field = converted %.loc9_25.1, %.loc9_25.8 [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: %.37 = name_ref x, imports.%import_ref.7 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.37 = name_ref x, imports.%import_ref.9 [template = imports.%.1] // CHECK:STDOUT: %.loc10_4: ref %i32 = class_element_access %b.ref, element0 // CHECK:STDOUT: %.loc10_9: Core.IntLiteral = int_value 2 [template = constants.%.38] // CHECK:STDOUT: %.loc10_7.1: %Convert.type.2 = interface_witness_access constants.%.33, element0 [template = constants.%Convert.14] @@ -301,12 +305,12 @@ 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, imports.%import_ref.45 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.48 [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 %empty_tuple.type = 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, imports.%import_ref.46 [template = constants.%G] +// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.49 [template = constants.%G] // CHECK:STDOUT: %.loc14_4: = bound_method %c.ref.loc14, %G.ref // CHECK:STDOUT: %.loc14_3: %.42 = addr_of %c.ref.loc14 // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %.loc14_4(%.loc14_3) @@ -326,5 +330,5 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1](); // CHECK:STDOUT: -// CHECK:STDOUT: fn @G[addr .inst+399: %.42](); +// CHECK:STDOUT: fn @G[addr .inst+403: %.42](); // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 529889ce0236..60190fc4965f 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -173,18 +173,20 @@ fn Run() { // CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+3, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+47, loaded [template = constants.%Child] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.12 +// CHECK:STDOUT: .ImplicitAs = %import_ref.14 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+10, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+19, unloaded -// CHECK:STDOUT: %import_ref.6: %.44 = import_ref Main//a, inst+38, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+43, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+48, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//a, inst+52, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//a, inst+49, loaded [template = constants.%Base] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, inst+45, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//a, inst+10, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+19, unloaded +// CHECK:STDOUT: %import_ref.7: %.44 = import_ref Main//a, inst+38, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+43, unloaded +// CHECK:STDOUT: %import_ref.10: = import_ref Main//a, inst+54, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.11 = import_ref Main//a, inst+48, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Main//a, inst+52, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//a, inst+49, loaded [template = constants.%Base] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -201,20 +203,20 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Child { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.9 -// CHECK:STDOUT: .base = imports.%import_ref.10 -// CHECK:STDOUT: extend imports.%import_ref.11 -// CHECK:STDOUT: complete_type_witness = constants.%.6 +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: .base = imports.%import_ref.12 +// CHECK:STDOUT: extend imports.%import_ref.13 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: !members: -// 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: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .F = imports.%import_ref.5 +// CHECK:STDOUT: .Unused = imports.%import_ref.6 +// CHECK:STDOUT: .x = imports.%import_ref.7 +// CHECK:STDOUT: .unused = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -247,7 +249,7 @@ 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: %.44 = name_ref x, imports.%import_ref.6 [template = imports.%.1] +// CHECK:STDOUT: %x.ref: %.44 = name_ref x, imports.%import_ref.7 [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 @@ -259,7 +261,7 @@ fn Run() { // CHECK:STDOUT: %.loc8_7.4: init %i32 = converted %.loc8_9, %int.convert_checked.loc8 [template = constants.%.48] // CHECK:STDOUT: assign %.loc8_4.3, %.loc8_7.4 // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.5 [template = constants.%F] // CHECK:STDOUT: %.loc9_4: = bound_method %a.ref.loc9, %F.ref // CHECK:STDOUT: %.loc9_3.1: ref %Base = class_element_access %a.ref.loc9, element0 // CHECK:STDOUT: %.loc9_3.2: ref %Base = converted %a.ref.loc9, %.loc9_3.1 diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index 303495593bc9..8e1f7704bcac 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -148,7 +148,8 @@ var ptr: E* = &val; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -174,8 +175,8 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -206,7 +207,8 @@ var ptr: E* = &val; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -232,8 +234,8 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -260,14 +262,15 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//b, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+16, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//b, inst+26, unloaded +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//b, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+17, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//b, inst+27, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -293,8 +296,8 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -320,15 +323,16 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+16, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+26, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+17, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+27, unloaded // CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+3, loaded [template = constants.%C] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//a, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -354,8 +358,8 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -381,17 +385,18 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+16, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+26, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//c, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//c, inst+16, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//c, inst+26, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//b, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+17, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+27, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//c, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//c, inst+17, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//c, inst+27, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7 = import_ref Main//b, inst+9, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//b, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//b, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -419,8 +424,8 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -446,17 +451,18 @@ var ptr: E* = &val; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+16, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+26, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//b, inst+16, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//b, inst+26, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+17, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+27, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//b, inst+17, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//b, inst+27, unloaded // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.7 = import_ref Main//b, inst+9, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//b, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//b, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -484,8 +490,8 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = 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 c8551d18b6bb..bac31948f32a 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -81,8 +81,9 @@ fn Run() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+9, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+11, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -98,9 +99,9 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .a = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .a = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index 18628916efd4..393c25fc6796 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -98,8 +98,9 @@ fn Run() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Main//a, inst+17, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//a, inst+19, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.5: %.6 = import_ref Main//a, inst+17, loaded [template = %.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -116,9 +117,9 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @Cycle { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .c = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .c = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -129,7 +130,7 @@ fn Run() { // CHECK:STDOUT: %.loc7_12.1: ref %.1 = struct_access %a.ref.loc7_11, element0 // CHECK:STDOUT: %.loc7_12.2: %.1 = bind_value %.loc7_12.1 // CHECK:STDOUT: %.loc7_10: ref %Cycle = deref %.loc7_12.2 -// CHECK:STDOUT: %c.ref: %.6 = name_ref c, imports.%import_ref.4 [template = imports.%.1] +// CHECK:STDOUT: %c.ref: %.6 = name_ref c, imports.%import_ref.5 [template = imports.%.1] // CHECK:STDOUT: %.loc7_15: ref %.2 = class_element_access %.loc7_10, element0 // CHECK:STDOUT: %.loc7_17.1: ref %.1 = struct_access %.loc7_15, element0 // CHECK:STDOUT: %.loc7_17.2: %.1 = bind_value %.loc7_17.1 diff --git a/toolchain/check/testdata/class/no_prelude/export_name.carbon b/toolchain/check/testdata/class/no_prelude/export_name.carbon index 55c908e2aaf7..f730ce27bbe0 100644 --- a/toolchain/check/testdata/class/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/class/no_prelude/export_name.carbon @@ -71,7 +71,8 @@ var c: C = {}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -84,8 +85,8 @@ var c: C = {}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_export.carbon @@ -98,8 +99,9 @@ var c: C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+8, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+9, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+7, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -115,8 +117,8 @@ var c: C = {}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index 8101d8e93152..f8c89413b395 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -604,7 +604,8 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.2 = import_ref Main//def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//def, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//def, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -617,8 +618,8 @@ extern class C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_extern_decl_after_import_def.carbon @@ -630,7 +631,8 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.2 = import_ref Main//def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//def, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//def, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -643,7 +645,7 @@ extern class C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index 279971cfa692..86f9eb71739a 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -155,7 +155,8 @@ class B {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.2 = import_ref Main//redecl_after_def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//redecl_after_def, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//redecl_after_def, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -169,8 +170,8 @@ class B {} // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- redef_after_def.carbon @@ -207,7 +208,8 @@ class B {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//redef_after_def, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//redef_after_def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//redef_after_def, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//redef_after_def, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -221,8 +223,8 @@ class B {} // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @.1 { diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 89c49efa8c8c..e91b9c22e642 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -208,7 +208,8 @@ private class Redecl {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Test//def, inst+1, loaded [template = constants.%Def] -// CHECK:STDOUT: %import_ref.2 = import_ref Test//def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Test//def, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Test//def, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -225,8 +226,8 @@ private class Redecl {} // CHECK:STDOUT: // CHECK:STDOUT: class @Def { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -303,7 +304,8 @@ private class Redecl {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Test//forward_with_def, inst+1, loaded [template = constants.%ForwardWithDef] -// CHECK:STDOUT: %import_ref.2 = import_ref Test//forward_with_def, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Test//forward_with_def, inst+5, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Test//forward_with_def, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -320,8 +322,8 @@ private class Redecl {} // CHECK:STDOUT: // CHECK:STDOUT: class @ForwardWithDef { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { 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 acde352ad2a1..5612b9a0dd68 100644 --- a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +++ b/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon @@ -155,8 +155,9 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+3, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+8, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//a, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -169,15 +170,15 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- d.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//c, inst+9, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//c, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -197,9 +198,10 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+9, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+7, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+10, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst+7, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+8, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//c, inst+9, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -224,9 +226,9 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- f.carbon @@ -255,8 +257,9 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//a, inst+3, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//a, inst+8, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+3, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -273,9 +276,9 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -283,7 +286,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // 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.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return @@ -301,9 +304,10 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+9, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+7, unloaded -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//c, inst+8, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+10, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst+7, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+8, unloaded +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//c, inst+9, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -320,9 +324,9 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -330,7 +334,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // 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.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return @@ -348,9 +352,10 @@ var x: () = D.C.F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+9, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c, inst+7, unloaded -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//c, inst+8, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//c, inst+10, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c, inst+7, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c, inst+8, unloaded +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//c, inst+9, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -367,9 +372,9 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -377,7 +382,7 @@ var x: () = D.C.F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // 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.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return @@ -397,10 +402,12 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//e, inst+3, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//e, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//e, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//e, inst+9, unloaded -// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//e, inst+10, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//e, inst+14, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//e, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//e, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//e, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//e, inst+10, unloaded +// CHECK:STDOUT: %import_ref.7: %F.type = import_ref Main//e, inst+11, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -417,16 +424,16 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .C = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .F = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .F = imports.%import_ref.7 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -434,8 +441,8 @@ var x: () = D.C.F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // 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: %C.ref: type = name_ref C, imports.%import_ref.4 [template = constants.%C] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.7 [template = constants.%F] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return @@ -455,10 +462,12 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//e, inst+3, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//e, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//e, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//e, inst+9, unloaded -// CHECK:STDOUT: %import_ref.5: %F.type = import_ref Main//e, inst+10, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//e, inst+14, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//e, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Main//e, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//e, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//e, inst+10, unloaded +// CHECK:STDOUT: %import_ref.7: %F.type = import_ref Main//e, inst+11, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -475,16 +484,16 @@ var x: () = D.C.F(); // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .C = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .F = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .F = imports.%import_ref.7 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -492,8 +501,8 @@ var x: () = D.C.F(); // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // 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: %C.ref: type = name_ref C, imports.%import_ref.4 [template = constants.%C] +// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.7 [template = constants.%F] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref() // CHECK:STDOUT: assign file.%x.var, %F.call // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 3fad2802dd81..ed633c556063 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -589,7 +589,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -621,8 +622,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(constants.%a: %C) { @@ -976,7 +977,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1001,8 +1003,8 @@ fn Base.F[addr self: Base*]() { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @Foo(constants.%a: %C) { diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 37a13cae37a5..f54bd6b365d1 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -205,8 +205,9 @@ class Derived { // CHECK:STDOUT: import Modifiers//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Modifiers//default, inst+3, loaded [template = constants.%Base] -// CHECK:STDOUT: %import_ref.2 = import_ref Modifiers//default, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Modifiers//default, inst+11, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Modifiers//default, inst+5, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -237,9 +238,9 @@ class Derived { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .H = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .H = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: virtual fn @F(); @@ -266,8 +267,9 @@ class Derived { // CHECK:STDOUT: import Modifiers//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Modifiers//default, inst+3, loaded [template = constants.%Base] -// CHECK:STDOUT: %import_ref.2 = import_ref Modifiers//default, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Modifiers//default, inst+11, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.3 = import_ref Modifiers//default, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Modifiers//default, inst+5, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -283,9 +285,9 @@ class Derived { // CHECK:STDOUT: // CHECK:STDOUT: class @Base { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .H = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .H = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index d5da403f0c3a..0f2609017d52 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 @@ -204,7 +204,8 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %import_ref.5: %ReturnDUnused.type = import_ref Main//incomplete_return, inst+27, loaded [template = constants.%ReturnDUnused] // CHECK:STDOUT: %import_ref.6: %ReturnDUsed.type = import_ref Main//incomplete_return, inst+35, loaded [template = constants.%ReturnDUsed] // CHECK:STDOUT: %import_ref.7 = import_ref Main//incomplete_return, inst+38, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//incomplete_return, inst+4, unloaded +// CHECK:STDOUT: %import_ref.8: = import_ref Main//incomplete_return, inst+48, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.9 = import_ref Main//incomplete_return, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -226,8 +227,8 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallFAndGIncomplete() { diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index 3751bbcf283f..61b83c55aaaa 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -454,7 +454,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//two_file, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -486,8 +487,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo(%a.param_patt: %C) { @@ -788,7 +789,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -813,8 +815,8 @@ fn Foo(a: const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Foo(%a.param_patt: %C) { diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index 6510ab97aa0d..7e6b1505a681 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -152,7 +152,7 @@ import PackageGenericInterface; fn M() { var obj: PackageHasParam.AnyParam( PackageGenericInterface.GenericInterface) = {}; - // CHECK:STDERR: fail_todo_use_generic_interface_as_param.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Y` in type `AnyParam()` that does not implement that interface [MissingImplInMemberAccess] + // CHECK:STDERR: fail_todo_use_generic_interface_as_param.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Y` in type `AnyParam()` that does not implement that interface [MissingImplInMemberAccess] // CHECK:STDERR: obj.(PackageHasParam.Y.K)(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -300,15 +300,16 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %PackageA: = namespace file.%PackageA.import, [template] { // CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .HasF = %import_ref.3 +// CHECK:STDOUT: .HasF = %import_ref.4 // CHECK:STDOUT: import PackageA//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref PackageA//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.4 = import_ref PackageA//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst+10, unloaded -// CHECK:STDOUT: %import_ref.6: %F.type.2 = import_ref PackageA//default, inst+5, loaded [template = constants.%F.2] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, inst+15, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst+13, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst+3, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref PackageA//default, inst+10, unloaded +// CHECK:STDOUT: %import_ref.7: %F.type.2 = import_ref PackageA//default, inst+5, loaded [template = constants.%F.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -328,7 +329,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: impl_decl @impl.2 [template] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %PackageA.ref: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] -// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.3 [template = constants.%HasF.type] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.4 [template = constants.%HasF.type] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.3 [template] {} { // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [template = constants.%D] @@ -349,9 +350,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .F = imports.%import_ref.5 -// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .F = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl.1: %C.ref as %HasG.ref { @@ -391,8 +392,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.4 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G.1(@HasG.%Self: %HasG.type) { @@ -443,7 +444,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self: %HasF.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %HasF.type, %F.type.1 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.5: %.4 = 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: %.6: = interface_witness (%F.2) [template] @@ -452,18 +453,19 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %PackageA: = namespace file.%PackageA.import, [template] { // CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .HasF = %import_ref.3 +// CHECK:STDOUT: .HasF = %import_ref.4 // CHECK:STDOUT: import PackageA//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref PackageA//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.4 = import_ref PackageA//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.5: %.4 = import_ref PackageA//default, inst+10, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6 = import_ref PackageA//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.9: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.10: = import_ref PackageA//default, inst+24, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, inst+15, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst+13, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst+3, unloaded +// CHECK:STDOUT: %import_ref.6: %.4 = import_ref PackageA//default, inst+10, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageA//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.10: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.11: = import_ref PackageA//default, inst+24, loaded [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -485,28 +487,28 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .F = imports.%import_ref.5 -// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .F = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: impl @impl: imports.%import_ref.9 as imports.%import_ref.10 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: witness = imports.%import_ref.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestCF(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %PackageA.ref.loc7: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] -// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.3 [template = constants.%HasF.type] -// CHECK:STDOUT: %F.ref: %.4 = name_ref F, imports.%import_ref.5 [template = constants.%.5] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.4 [template = constants.%HasF.type] +// CHECK:STDOUT: %F.ref: %.4 = name_ref F, imports.%import_ref.6 [template = constants.%.5] // CHECK:STDOUT: %.loc7: %F.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %.loc7() // CHECK:STDOUT: return @@ -534,7 +536,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.1: %HasF.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %HasF.type, %F.type.1 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %HasG.type: type = facet_type <@HasG> [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] @@ -544,7 +546,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %PackageA: = namespace file.%PackageA.import, [template] { -// CHECK:STDOUT: .HasF = %import_ref.3 +// CHECK:STDOUT: .HasF = %import_ref.4 // CHECK:STDOUT: import PackageA//default // CHECK:STDOUT: } // CHECK:STDOUT: %PackageB: = namespace file.%PackageB.import, [template] { @@ -552,27 +554,29 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: import PackageB//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref PackageB//default, inst+14, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.2 = import_ref PackageB//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.4 = import_ref PackageA//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.5: %.4 = import_ref PackageA//default, inst+10, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6 = import_ref PackageA//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref PackageA//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.10: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.11 = import_ref PackageA//default, inst+24, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref PackageB//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref PackageB//default, inst+12, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.15: type = import_ref PackageB//default, inst+24, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.16: type = import_ref PackageB//default, inst+25, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.17 = import_ref PackageB//default, inst+31, unloaded -// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, inst+34, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.19: type = import_ref PackageB//default, inst+43, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.20: = import_ref PackageB//default, inst+52, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, inst+55, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.22: type = import_ref PackageB//default, inst+56, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.23 = import_ref PackageB//default, inst+62, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref PackageB//default, inst+17, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageB//default, inst+15, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageA//default, inst+1, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageA//default, inst+3, unloaded +// CHECK:STDOUT: %import_ref.6: %.4 = import_ref PackageA//default, inst+10, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageA//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref PackageA//default, inst+15, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, inst+13, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.13 = import_ref PackageA//default, inst+24, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, inst+12, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, inst+7, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, inst+25, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, inst+26, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, inst+32, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, inst+35, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, inst+44, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.22: = import_ref PackageB//default, inst+53, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.23: type = import_ref PackageB//default, inst+56, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, inst+57, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.25 = import_ref PackageB//default, inst+63, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -596,56 +600,56 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .F = imports.%import_ref.5 -// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .F = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasG { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.12 -// CHECK:STDOUT: .G = imports.%import_ref.13 -// CHECK:STDOUT: witness = (imports.%import_ref.14) +// CHECK:STDOUT: .Self = imports.%import_ref.14 +// CHECK:STDOUT: .G = imports.%import_ref.15 +// CHECK:STDOUT: witness = (imports.%import_ref.16) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.11 as imports.%import_ref.12 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.17 as imports.%import_ref.18 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: witness = imports.%import_ref.19 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.20 as imports.%import_ref.21 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: witness = imports.%import_ref.22 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.23 as imports.%import_ref.24 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: witness = imports.%import_ref.25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestDF(%d.param_patt: %D) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %D = name_ref d, %d // CHECK:STDOUT: %PackageA.ref: = name_ref PackageA, imports.%PackageA [template = imports.%PackageA] -// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.3 [template = constants.%HasF.type] -// CHECK:STDOUT: %F.ref: %.4 = name_ref F, imports.%import_ref.5 [template = constants.%.5] +// CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.4 [template = constants.%HasF.type] +// CHECK:STDOUT: %F.ref: %.4 = name_ref F, imports.%import_ref.6 [template = constants.%.5] // CHECK:STDOUT: %.loc8: %F.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %.loc8() // CHECK:STDOUT: return @@ -673,7 +677,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.1: %HasG.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %G.type.1: type = fn_type @G.1 [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %HasG.type, %G.type.1 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template] // CHECK:STDOUT: %D: type = class_type @D [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] @@ -687,31 +691,33 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: import PackageA//default // CHECK:STDOUT: } // CHECK:STDOUT: %PackageB: = namespace file.%PackageB.import, [template] { -// CHECK:STDOUT: .HasG = %import_ref.3 +// CHECK:STDOUT: .HasG = %import_ref.4 // CHECK:STDOUT: import PackageB//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref PackageA//default, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref PackageA//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref PackageB//default, inst+3, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.4 = import_ref PackageB//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.5: %.4 = import_ref PackageB//default, inst+12, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6 = import_ref PackageB//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref PackageA//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref PackageA//default, inst+10, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.13 = import_ref PackageA//default, inst+24, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref PackageB//default, inst+24, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.15: type = import_ref PackageB//default, inst+25, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.16: = import_ref PackageB//default, inst+31, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.17 = import_ref PackageB//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, inst+34, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.19: type = import_ref PackageB//default, inst+43, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.20 = import_ref PackageB//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, inst+55, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.22: type = import_ref PackageB//default, inst+56, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.23 = import_ref PackageB//default, inst+62, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref PackageA//default, inst+15, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageA//default, inst+13, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageB//default, inst+3, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageB//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.6: %.4 = import_ref PackageB//default, inst+12, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageB//default, inst+7, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref PackageA//default, inst+3, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref PackageA//default, inst+10, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref PackageA//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageA//default, inst+17, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.13: type = import_ref PackageA//default, inst+18, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.14 = import_ref PackageA//default, inst+24, unloaded +// CHECK:STDOUT: %import_ref.15: type = import_ref PackageB//default, inst+25, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.16: type = import_ref PackageB//default, inst+26, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.17: = import_ref PackageB//default, inst+32, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.18: = import_ref PackageB//default, inst+17, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, inst+15, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, inst+35, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, inst+44, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.22 = import_ref PackageB//default, inst+53, unloaded +// CHECK:STDOUT: %import_ref.23: type = import_ref PackageB//default, inst+56, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.24: type = import_ref PackageB//default, inst+57, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.25 = import_ref PackageB//default, inst+63, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -735,56 +741,56 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @HasG { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .G = imports.%import_ref.5 -// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .G = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: .F = imports.%import_ref.9 -// CHECK:STDOUT: witness = (imports.%import_ref.10) +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .F = imports.%import_ref.10 +// CHECK:STDOUT: witness = (imports.%import_ref.11) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.12 as imports.%import_ref.13 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: witness = imports.%import_ref.14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.15 as imports.%import_ref.16 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.20 as imports.%import_ref.21 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: witness = imports.%import_ref.22 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.21 as imports.%import_ref.22 { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.23 as imports.%import_ref.24 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.23 +// CHECK:STDOUT: witness = imports.%import_ref.25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.17 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.19 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestCG(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %PackageB.ref: = name_ref PackageB, imports.%PackageB [template = imports.%PackageB] -// CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%import_ref.3 [template = constants.%HasG.type] -// CHECK:STDOUT: %G.ref: %.4 = name_ref G, imports.%import_ref.5 [template = constants.%.5] +// CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%import_ref.4 [template = constants.%HasG.type] +// CHECK:STDOUT: %G.ref: %.4 = name_ref G, imports.%import_ref.6 [template = constants.%.5] // CHECK:STDOUT: %.loc8: %G.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%G.2] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %.loc8() // CHECK:STDOUT: return @@ -812,7 +818,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.1: %HasG.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %G.type.1: type = fn_type @G.1 [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %HasG.type, %G.type.1 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %HasF.type: type = facet_type <@HasF> [template] // CHECK:STDOUT: %G.type.2: type = fn_type @G.2 [template] @@ -823,28 +829,30 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %PackageB: = namespace file.%PackageB.import, [template] { // CHECK:STDOUT: .D = %import_ref.1 -// CHECK:STDOUT: .HasG = %import_ref.3 +// CHECK:STDOUT: .HasG = %import_ref.4 // CHECK:STDOUT: import PackageB//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref PackageB//default, inst+14, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.2 = import_ref PackageB//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref PackageB//default, inst+3, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.4 = import_ref PackageB//default, inst+5, unloaded -// CHECK:STDOUT: %import_ref.5: %.4 = import_ref PackageB//default, inst+12, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6 = import_ref PackageB//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref PackageB//default, inst+23, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref PackageB//default, inst+24, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.10: type = import_ref PackageB//default, inst+25, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.11 = import_ref PackageB//default, inst+31, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref PackageB//default, inst+40, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref PackageB//default, inst+41, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst+42, unloaded -// CHECK:STDOUT: %import_ref.15: type = import_ref PackageB//default, inst+34, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.16: type = import_ref PackageB//default, inst+43, loaded [template = constants.%HasF.type] -// CHECK:STDOUT: %import_ref.17 = import_ref PackageB//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, inst+55, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.19: type = import_ref PackageB//default, inst+56, loaded [template = constants.%HasG.type] -// CHECK:STDOUT: %import_ref.20: = import_ref PackageB//default, inst+62, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageB//default, inst+17, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageB//default, inst+15, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageB//default, inst+3, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageB//default, inst+5, unloaded +// CHECK:STDOUT: %import_ref.6: %.4 = import_ref PackageB//default, inst+12, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageB//default, inst+7, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref PackageB//default, inst+23, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref PackageB//default, inst+24, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref PackageB//default, inst+25, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.12: type = import_ref PackageB//default, inst+26, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.13 = import_ref PackageB//default, inst+32, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref PackageB//default, inst+41, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref PackageB//default, inst+42, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref PackageB//default, inst+43, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref PackageB//default, inst+35, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.18: type = import_ref PackageB//default, inst+44, loaded [template = constants.%HasF.type] +// CHECK:STDOUT: %import_ref.19 = import_ref PackageB//default, inst+53, unloaded +// CHECK:STDOUT: %import_ref.20: type = import_ref PackageB//default, inst+56, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.21: type = import_ref PackageB//default, inst+57, loaded [template = constants.%HasG.type] +// CHECK:STDOUT: %import_ref.22: = import_ref PackageB//default, inst+63, loaded [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -866,51 +874,51 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @HasG { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .G = imports.%import_ref.5 -// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .G = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @HasF { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.12 -// CHECK:STDOUT: .F = imports.%import_ref.13 -// CHECK:STDOUT: witness = (imports.%import_ref.14) +// CHECK:STDOUT: .Self = imports.%import_ref.14 +// CHECK:STDOUT: .F = imports.%import_ref.15 +// CHECK:STDOUT: witness = (imports.%import_ref.16) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.11 as imports.%import_ref.12 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.15 as imports.%import_ref.16 { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.17 as imports.%import_ref.18 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.17 +// CHECK:STDOUT: witness = imports.%import_ref.19 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.18 as imports.%import_ref.19 { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.20 as imports.%import_ref.21 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.20 +// CHECK:STDOUT: witness = imports.%import_ref.22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TestDG(%d.param_patt: %D) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %d.ref: %D = name_ref d, %d // CHECK:STDOUT: %PackageB.ref.loc7: = name_ref PackageB, imports.%PackageB [template = imports.%PackageB] -// CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%import_ref.3 [template = constants.%HasG.type] -// CHECK:STDOUT: %G.ref: %.4 = name_ref G, imports.%import_ref.5 [template = constants.%.5] +// CHECK:STDOUT: %HasG.ref: type = name_ref HasG, imports.%import_ref.4 [template = constants.%HasG.type] +// CHECK:STDOUT: %G.ref: %.4 = name_ref G, imports.%import_ref.6 [template = constants.%.5] // CHECK:STDOUT: %.loc7: %G.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%G.2] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %.loc7() // CHECK:STDOUT: return @@ -1176,21 +1184,22 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %L: %L.type = struct_value () [template] // CHECK:STDOUT: %struct: %AnyParam.3 = struct_value () [template] // CHECK:STDOUT: %.6: type = assoc_entity_type %Y.type, %K.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %PackageHasParam: = namespace file.%PackageHasParam.import, [template] { // CHECK:STDOUT: .AnyParam = %import_ref.1 -// CHECK:STDOUT: .Y = %import_ref.3 +// CHECK:STDOUT: .Y = %import_ref.4 // CHECK:STDOUT: import PackageHasParam//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %AnyParam.type = import_ref PackageHasParam//default, inst+14, loaded [template = constants.%AnyParam.1] -// CHECK:STDOUT: %import_ref.2 = import_ref PackageHasParam//default, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref PackageHasParam//default, inst+26, loaded [template = constants.%Y.type] -// CHECK:STDOUT: %import_ref.4 = import_ref PackageHasParam//default, inst+28, unloaded -// CHECK:STDOUT: %import_ref.5: %.6 = import_ref PackageHasParam//default, inst+34, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6: %K.type.2 = import_ref PackageHasParam//default, inst+30, loaded [template = constants.%K.2] +// CHECK:STDOUT: %import_ref.2: = import_ref PackageHasParam//default, inst+24, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageHasParam//default, inst+22, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref PackageHasParam//default, inst+26, loaded [template = constants.%Y.type] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageHasParam//default, inst+28, unloaded +// CHECK:STDOUT: %import_ref.6: %.6 = import_ref PackageHasParam//default, inst+34, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.7: %K.type.2 = import_ref PackageHasParam//default, inst+30, loaded [template = constants.%K.2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1213,7 +1222,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.1 = name_ref GenericInterface, file.%GenericInterface.decl [template = constants.%GenericInterface] // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.1, constants.%GenericInterface) [template = constants.%AnyParam.3] // CHECK:STDOUT: %PackageHasParam.ref.loc8_52: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] -// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.3 [template = constants.%Y.type] +// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.4 [template = constants.%Y.type] // CHECK:STDOUT: } // CHECK:STDOUT: %L.decl: %L.type = fn_decl @L [template = constants.%L] {} {} // CHECK:STDOUT: } @@ -1237,9 +1246,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @Y { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .K = imports.%import_ref.5 -// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .K = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @impl: %AnyParam as %Y.ref { @@ -1261,8 +1270,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1291,8 +1300,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: assign %obj.var, %.loc13_59 // CHECK:STDOUT: %obj.ref: ref %AnyParam.3 = name_ref obj, %obj // CHECK:STDOUT: %PackageHasParam.ref.loc14: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] -// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.3 [template = constants.%Y.type] -// CHECK:STDOUT: %K.ref: %.6 = name_ref K, imports.%import_ref.5 [template = constants.%.7] +// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.4 [template = constants.%Y.type] +// CHECK:STDOUT: %K.ref: %.6 = name_ref K, imports.%import_ref.6 [template = constants.%.7] // CHECK:STDOUT: %.loc14: %K.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%K.1] // CHECK:STDOUT: %K.call: init %empty_tuple.type = call %.loc14() // CHECK:STDOUT: return @@ -1361,27 +1370,28 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.3: %Y.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %K.type: type = fn_type @K [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %Y.type, %K.type [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.9 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %PackageHasParam: = namespace file.%PackageHasParam.import, [template] { // CHECK:STDOUT: .AnyParam = %import_ref.1 -// CHECK:STDOUT: .Y = %import_ref.5 +// CHECK:STDOUT: .Y = %import_ref.6 // CHECK:STDOUT: import PackageHasParam//default // CHECK:STDOUT: } // CHECK:STDOUT: %PackageGenericInterface: = namespace file.%PackageGenericInterface.import, [template] { -// CHECK:STDOUT: .GenericInterface = %import_ref.3 +// CHECK:STDOUT: .GenericInterface = %import_ref.4 // CHECK:STDOUT: import PackageGenericInterface//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %AnyParam.type = import_ref PackageHasParam//default, inst+14, loaded [template = constants.%AnyParam.1] -// CHECK:STDOUT: %import_ref.2 = import_ref PackageHasParam//default, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3: %GenericInterface.type.1 = import_ref PackageGenericInterface//default, inst+9, loaded [template = constants.%GenericInterface] -// CHECK:STDOUT: %import_ref.4 = import_ref PackageGenericInterface//default, inst+16, unloaded -// CHECK:STDOUT: %import_ref.5: type = import_ref PackageHasParam//default, inst+26, loaded [template = constants.%Y.type] -// CHECK:STDOUT: %import_ref.6 = import_ref PackageHasParam//default, inst+28, unloaded -// CHECK:STDOUT: %import_ref.7: %.4 = import_ref PackageHasParam//default, inst+34, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.8 = import_ref PackageHasParam//default, inst+30, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref PackageHasParam//default, inst+24, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref PackageHasParam//default, inst+22, unloaded +// CHECK:STDOUT: %import_ref.4: %GenericInterface.type.1 = import_ref PackageGenericInterface//default, inst+9, loaded [template = constants.%GenericInterface] +// CHECK:STDOUT: %import_ref.5 = import_ref PackageGenericInterface//default, inst+16, unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref PackageHasParam//default, inst+26, loaded [template = constants.%Y.type] +// CHECK:STDOUT: %import_ref.7 = import_ref PackageHasParam//default, inst+28, unloaded +// CHECK:STDOUT: %import_ref.8: %.4 = import_ref PackageHasParam//default, inst+34, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.9 = import_ref PackageHasParam//default, inst+30, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1405,16 +1415,16 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.5 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Y { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .K = imports.%import_ref.7 -// CHECK:STDOUT: witness = (imports.%import_ref.8) +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: .K = imports.%import_ref.8 +// CHECK:STDOUT: witness = (imports.%import_ref.9) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @AnyParam(constants.%T: type, constants.%X.2: @AnyParam.%T (%T)) { @@ -1427,8 +1437,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1437,7 +1447,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.ref.loc8: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] // CHECK:STDOUT: %AnyParam.ref: %AnyParam.type = name_ref AnyParam, imports.%import_ref.1 [template = constants.%AnyParam.1] // CHECK:STDOUT: %PackageGenericInterface.ref: = name_ref PackageGenericInterface, imports.%PackageGenericInterface [template = imports.%PackageGenericInterface] -// CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.1 = name_ref GenericInterface, imports.%import_ref.3 [template = constants.%GenericInterface] +// CHECK:STDOUT: %GenericInterface.ref: %GenericInterface.type.1 = name_ref GenericInterface, imports.%import_ref.4 [template = constants.%GenericInterface] // CHECK:STDOUT: %AnyParam: type = class_type @AnyParam, @AnyParam(constants.%GenericInterface.type.1, constants.%GenericInterface) [template = constants.%AnyParam.3] // CHECK:STDOUT: %obj.var: ref %AnyParam.3 = var obj // CHECK:STDOUT: %obj: ref %AnyParam.3 = bind_name obj, %obj.var @@ -1447,8 +1457,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: assign %obj.var, %.loc9_51 // CHECK:STDOUT: %obj.ref: ref %AnyParam.3 = name_ref obj, %obj // CHECK:STDOUT: %PackageHasParam.ref.loc14: = name_ref PackageHasParam, imports.%PackageHasParam [template = imports.%PackageHasParam] -// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.5 [template = constants.%Y.type] -// CHECK:STDOUT: %K.ref: %.4 = name_ref K, imports.%import_ref.7 [template = constants.%.5] +// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%import_ref.6 [template = constants.%Y.type] +// CHECK:STDOUT: %K.ref: %.4 = name_ref K, imports.%import_ref.8 [template = constants.%.5] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1719,7 +1729,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %I.type, %F.type [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %Extra8.type: type = facet_type <@Extra8> [template] // CHECK:STDOUT: %Extra7.type: type = facet_type <@Extra7> [template] // CHECK:STDOUT: %Extra6.type: type = facet_type <@Extra6> [template] @@ -1735,26 +1745,27 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %HasExtraInterfaces: = namespace file.%HasExtraInterfaces.import, [template] { // CHECK:STDOUT: .C = %import_ref.1 -// CHECK:STDOUT: .I = %import_ref.3 +// CHECK:STDOUT: .I = %import_ref.4 // CHECK:STDOUT: import HasExtraInterfaces//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %C.type = import_ref HasExtraInterfaces//default, inst+39, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.2 = import_ref HasExtraInterfaces//default, inst+45, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref HasExtraInterfaces//default, inst+49, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.4 = import_ref HasExtraInterfaces//default, inst+51, unloaded -// CHECK:STDOUT: %import_ref.5: %.4 = import_ref HasExtraInterfaces//default, inst+57, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6 = import_ref HasExtraInterfaces//default, inst+53, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref HasExtraInterfaces//default, inst+31, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref HasExtraInterfaces//default, inst+27, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref HasExtraInterfaces//default, inst+23, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref HasExtraInterfaces//default, inst+19, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref HasExtraInterfaces//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref HasExtraInterfaces//default, inst+11, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref HasExtraInterfaces//default, inst+7, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref HasExtraInterfaces//default, inst+3, unloaded -// CHECK:STDOUT: %import_ref.16: type = import_ref HasExtraInterfaces//default, inst+72, loaded [template = constants.%C.4] -// CHECK:STDOUT: %import_ref.17: type = import_ref HasExtraInterfaces//default, inst+74, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.18 = import_ref HasExtraInterfaces//default, inst+80, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref HasExtraInterfaces//default, inst+47, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref HasExtraInterfaces//default, inst+45, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref HasExtraInterfaces//default, inst+49, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.5 = import_ref HasExtraInterfaces//default, inst+51, unloaded +// CHECK:STDOUT: %import_ref.6: %.4 = import_ref HasExtraInterfaces//default, inst+57, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.7 = import_ref HasExtraInterfaces//default, inst+53, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref HasExtraInterfaces//default, inst+31, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref HasExtraInterfaces//default, inst+27, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref HasExtraInterfaces//default, inst+23, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref HasExtraInterfaces//default, inst+19, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref HasExtraInterfaces//default, inst+15, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref HasExtraInterfaces//default, inst+11, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref HasExtraInterfaces//default, inst+7, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref HasExtraInterfaces//default, inst+3, unloaded +// CHECK:STDOUT: %import_ref.17: type = import_ref HasExtraInterfaces//default, inst+72, loaded [template = constants.%C.4] +// CHECK:STDOUT: %import_ref.18: type = import_ref HasExtraInterfaces//default, inst+74, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.19 = import_ref HasExtraInterfaces//default, inst+80, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1777,62 +1788,62 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .F = imports.%import_ref.5 -// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .F = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra8 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .Self = imports.%import_ref.9 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra7 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.10 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra6 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: .Self = imports.%import_ref.11 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra5 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: .Self = imports.%import_ref.12 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra4 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.12 +// CHECK:STDOUT: .Self = imports.%import_ref.13 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra3 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.13 +// CHECK:STDOUT: .Self = imports.%import_ref.14 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra2 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.14 +// CHECK:STDOUT: .Self = imports.%import_ref.15 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @Extra1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.15 +// CHECK:STDOUT: .Self = imports.%import_ref.16 // CHECK:STDOUT: witness = () // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.16 as imports.%import_ref.17 { +// CHECK:STDOUT: impl @impl: imports.%import_ref.17 as imports.%import_ref.18 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.18 +// CHECK:STDOUT: witness = imports.%import_ref.19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%T: type) { @@ -1843,8 +1854,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1852,8 +1863,8 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C.3 = name_ref c, %c // CHECK:STDOUT: %HasExtraInterfaces.ref.loc11: = name_ref HasExtraInterfaces, imports.%HasExtraInterfaces [template = imports.%HasExtraInterfaces] -// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.3 [template = constants.%I.type] -// CHECK:STDOUT: %F.ref: %.4 = name_ref F, imports.%import_ref.5 [template = constants.%.5] +// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.4 [template = constants.%I.type] +// CHECK:STDOUT: %F.ref: %.4 = name_ref F, imports.%import_ref.6 [template = constants.%.5] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon index ed2b52f3f800..f16d5145cf4c 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon @@ -120,7 +120,7 @@ fn G(c: C) { // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %I.type, %F.type.1 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: %.6: = interface_witness (%F.2) [template] @@ -129,14 +129,15 @@ fn G(c: C) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extend_impl_library, inst+1, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//extend_impl_library, inst+12, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extend_impl_library, inst+13, unloaded -// CHECK:STDOUT: %import_ref.4: type = import_ref Main//extend_impl_library, inst+15, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//extend_impl_library, inst+3, unloaded -// CHECK:STDOUT: %import_ref.6: %.4 = import_ref Main//extend_impl_library, inst+10, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//extend_impl_library, inst+5, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//extend_impl_library, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//extend_impl_library, inst+15, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.11: = import_ref Main//extend_impl_library, inst+21, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//extend_impl_library, inst+24, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extend_impl_library, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5: type = import_ref Main//extend_impl_library, inst+15, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extend_impl_library, inst+3, unloaded +// CHECK:STDOUT: %import_ref.7: %.4 = import_ref Main//extend_impl_library, inst+10, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//extend_impl_library, inst+5, unloaded +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//extend_impl_library, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//extend_impl_library, inst+15, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.12: = import_ref Main//extend_impl_library, inst+21, loaded [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -158,31 +159,31 @@ fn G(c: C) { // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .F = imports.%import_ref.6 -// CHECK:STDOUT: witness = (imports.%import_ref.7) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .F = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: impl @impl: imports.%import_ref.10 as imports.%import_ref.11 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: witness = imports.%import_ref.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: extend imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: extend imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%c.param_patt: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, imports.%import_ref.2 [template = constants.%C] -// CHECK:STDOUT: %F.ref.loc7: %.4 = name_ref F, imports.%import_ref.6 [template = constants.%.5] +// CHECK:STDOUT: %F.ref.loc7: %.4 = name_ref F, imports.%import_ref.7 [template = constants.%.5] // CHECK:STDOUT: %.loc7: %F.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc7: init %empty_tuple.type = call %.loc7() // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %F.ref.loc8: %.4 = name_ref F, imports.%import_ref.6 [template = constants.%.5] +// CHECK:STDOUT: %F.ref.loc8: %.4 = name_ref F, imports.%import_ref.7 [template = constants.%.5] // CHECK:STDOUT: %.loc8: %F.type.1 = interface_witness_access constants.%.6, element0 [template = constants.%F.2] // CHECK:STDOUT: %F.call.loc8: init %empty_tuple.type = call %.loc8() // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon index 06b0b68e0464..2818d0e63af7 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -204,12 +204,13 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, inst+12, loaded [template = constants.%I] // CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5: type = import_ref Main//import_generic, inst+26, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+29, loaded [symbolic = @impl.1.%I.type.1 (constants.%I.type.2)] -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+38, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.2.%I.type (constants.%I.type.3)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//import_generic, inst+51, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//import_generic, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst+2, unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+26, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+29, loaded [symbolic = @impl.1.%I.type.1 (constants.%I.type.2)] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+38, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.2.%I.type (constants.%I.type.3)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//import_generic, inst+51, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -251,7 +252,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.5 as imports.%import_ref.6 { +// CHECK:STDOUT: impl: imports.%import_ref.6 as imports.%import_ref.7 { // CHECK:STDOUT: %.loc4: = interface_witness () [template = constants.%.4] // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -267,16 +268,16 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { @@ -341,12 +342,13 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %import_ref.1: type = import_ref Main//import_generic, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: %I.type.1 = import_ref Main//import_generic, inst+12, loaded [template = constants.%I] // CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5: type = import_ref Main//import_generic, inst+26, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+29, loaded [symbolic = @impl.1.%I.type (constants.%I.type.2)] -// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+38, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.2.%I.type.1 (constants.%I.type.3)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//import_generic, inst+51, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//import_generic, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst+2, unloaded +// CHECK:STDOUT: %import_ref.6: type = import_ref Main//import_generic, inst+26, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.7: type = import_ref Main//import_generic, inst+29, loaded [symbolic = @impl.1.%I.type (constants.%I.type.2)] +// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+38, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.2.%I.type.1 (constants.%I.type.3)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//import_generic, inst+51, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -387,7 +389,7 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)] // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%T)> [symbolic = %I.type (constants.%I.type.2)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.5 as imports.%import_ref.6; +// CHECK:STDOUT: impl: imports.%import_ref.6 as imports.%import_ref.7; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl.2(constants.%T: type) { @@ -398,16 +400,16 @@ impl forall [T:! type] C as I(T*) {} // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.7 as imports.%import_ref.8 { +// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.9 +// CHECK:STDOUT: witness = imports.%import_ref.10 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I(constants.%T) { diff --git a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon index 7eb813e4cf42..02db99b32a35 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon @@ -197,7 +197,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template] // CHECK:STDOUT: %.4: type = assoc_entity_type %I.type, %F.type.1 [template] -// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.7 [template] +// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic] // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic] // CHECK:STDOUT: %.6: = interface_witness (%F.2) [symbolic] @@ -212,13 +212,14 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %C.type = import_ref Main//import_generic, inst+7, loaded [template = constants.%C.1] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//import_generic, inst+17, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//import_generic, inst+13, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.5: %.4 = import_ref Main//import_generic, inst+25, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//import_generic, inst+21, unloaded -// CHECK:STDOUT: %import_ref.8: type = import_ref Main//import_generic, inst+32, loaded [symbolic = @impl.%C (constants.%C.2)] -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, inst+33, loaded [template = constants.%I.type] -// CHECK:STDOUT: %import_ref.10: = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.%.1 (constants.%.6)] +// CHECK:STDOUT: %import_ref.3: = import_ref Main//import_generic, inst+15, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst+13, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6: %.4 = import_ref Main//import_generic, inst+25, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//import_generic, inst+21, unloaded +// CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, inst+32, loaded [symbolic = @impl.%C (constants.%C.2)] +// CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic, inst+33, loaded [template = constants.%I.type] +// CHECK:STDOUT: %import_ref.11: = import_ref Main//import_generic, inst+43, loaded [symbolic = @impl.%.1 (constants.%.6)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -241,7 +242,7 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: } { // CHECK:STDOUT: %c.ref: ref %C.3 = name_ref c, file.%c // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.2 [template = constants.%I.type] -// CHECK:STDOUT: %F.ref: %.4 = name_ref F, imports.%import_ref.5 [template = constants.%.5] +// CHECK:STDOUT: %F.ref: %.4 = name_ref F, imports.%import_ref.6 [template = constants.%.5] // CHECK:STDOUT: %.loc15_12.1: %F.type.1 = interface_witness_access constants.%.7, element0 [template = constants.%F.3] // CHECK:STDOUT: %.loc15_12.2: = specific_function %.loc15_12.1, @F.2(constants.%.1) [template = constants.%.8] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %.loc15_12.2() @@ -255,9 +256,9 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: // CHECK:STDOUT: interface @I { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .F = imports.%import_ref.5 -// CHECK:STDOUT: witness = (imports.%import_ref.6) +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .F = imports.%import_ref.6 +// CHECK:STDOUT: witness = (imports.%import_ref.7) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic impl @impl(constants.%T: type) { @@ -270,9 +271,9 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)] // CHECK:STDOUT: %.1: = interface_witness (%F) [symbolic = %.1 (constants.%.6)] // CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 { +// CHECK:STDOUT: impl: imports.%import_ref.9 as imports.%import_ref.10 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.10 +// CHECK:STDOUT: witness = imports.%import_ref.11 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -284,8 +285,8 @@ fn F() -> c.(I.F)() {} // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index 7ccd50148539..6cd679511d2d 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -270,14 +270,14 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1, @Action(%T) [symbolic] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = assoc_entity_type %Action.type.2, %Op.type.1 [symbolic] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.15 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.17 [symbolic] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op.1, @Action(%B) [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type %Action.type.3, %Op.type.2 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.16 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.18 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %.8: %.3 = assoc_entity element0, imports.%import_ref.17 [symbolic] +// CHECK:STDOUT: %.8: %.3 = assoc_entity element0, imports.%import_ref.19 [symbolic] // CHECK:STDOUT: %Op.type.3: type = fn_type @Op.2 [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %.9: = interface_witness (%Op.3) [template] @@ -289,16 +289,18 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %import_ref.3: type = import_ref Main//action, inst+33, loaded [template = constants.%B] // CHECK:STDOUT: %import_ref.4 = import_ref Main//action, inst+36, unloaded // CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+61, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+34, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+14, unloaded -// CHECK:STDOUT: %import_ref.8: @Action.%.1 (%.3) = import_ref Main//action, inst+20, loaded [symbolic = @Action.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//action, inst+16, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+29, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//action, inst+39, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//action, inst+42, loaded [template = constants.%Action.type.3] -// CHECK:STDOUT: %import_ref.13: = import_ref Main//action, inst+53, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+45, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, inst+35, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+34, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+14, unloaded +// CHECK:STDOUT: %import_ref.9: @Action.%.1 (%.3) = import_ref Main//action, inst+20, loaded [symbolic = @Action.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.11: = import_ref Main//action, inst+31, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+29, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//action, inst+39, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, inst+42, loaded [template = constants.%Action.type.3] +// CHECK:STDOUT: %import_ref.15: = import_ref Main//action, inst+53, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, inst+45, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+16, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -332,32 +334,32 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @Action(%T) [symbolic = %Op.type (constants.%Op.type.1)] // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.1) = struct_value () [symbolic = %Op (constants.%Op.1)] // CHECK:STDOUT: %.1: type = assoc_entity_type @Action.%Action.type (%Action.type.2), @Action.%Op.type (%Op.type.1) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %.2: @Action.%.1 (%.3) = assoc_entity element0, imports.%import_ref.15 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: %.2: @Action.%.1 (%.3) = assoc_entity element0, imports.%import_ref.17 [symbolic = %.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: .Op = imports.%import_ref.8 -// CHECK:STDOUT: witness = (imports.%import_ref.9) +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .Op = imports.%import_ref.9 +// CHECK:STDOUT: witness = (imports.%import_ref.10) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: impl @impl: imports.%import_ref.13 as imports.%import_ref.14 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Op = imports.%import_ref.14 -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: .Op = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.12 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op.1(constants.%T: type, constants.%Self.1: @Action.%Action.type (%Action.type.2)) { @@ -371,7 +373,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Action.ref: %Action.type.1 = name_ref Action, imports.%import_ref.1 [template = constants.%Action] // CHECK:STDOUT: %B.ref: type = name_ref B, imports.%import_ref.3 [template = constants.%B] // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%B)> [template = constants.%Action.type.3] -// CHECK:STDOUT: %.loc4_26: %.5 = specific_constant imports.%import_ref.8, @Action(constants.%B) [template = constants.%.6] +// CHECK:STDOUT: %.loc4_26: %.5 = specific_constant imports.%import_ref.9, @Action(constants.%B) [template = constants.%.6] // CHECK:STDOUT: %Op.ref: %.5 = name_ref Op, %.loc4_26 [template = constants.%.6] // CHECK:STDOUT: %.loc4_15: %Op.type.2 = interface_witness_access constants.%.9, element0 [template = constants.%Op.3] // CHECK:STDOUT: %Op.call: init %empty_tuple.type = call %.loc4_15() @@ -423,11 +425,11 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Op.type.1: type = fn_type @Op, @Action(%T) [symbolic] // CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = assoc_entity_type %Action.type.2, %Op.type.1 [symbolic] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.15 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.17 [symbolic] // CHECK:STDOUT: %Op.type.2: type = fn_type @Op, @Action(%B) [template] // CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type %Action.type.3, %Op.type.2 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.16 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.18 [template] // CHECK:STDOUT: %G.type: type = fn_type @G [template] // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: %C: type = class_type @C [template] @@ -435,8 +437,8 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Op.type.3: type = fn_type @Op, @Action(%C) [template] // CHECK:STDOUT: %Op.3: %Op.type.3 = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type %Action.type.4, %Op.type.3 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.15 [template] -// CHECK:STDOUT: %.10: %.3 = assoc_entity element0, imports.%import_ref.18 [symbolic] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.17 [template] +// CHECK:STDOUT: %.10: %.3 = assoc_entity element0, imports.%import_ref.21 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -445,17 +447,20 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %import_ref.3 = import_ref Main//action, inst+33, unloaded // CHECK:STDOUT: %import_ref.4: type = import_ref Main//action, inst+36, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5 = import_ref Main//action, inst+61, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//action, inst+34, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+14, unloaded -// CHECK:STDOUT: %import_ref.8: @Action.%.1 (%.3) = import_ref Main//action, inst+20, loaded [symbolic = @Action.%.2 (constants.%.10)] -// CHECK:STDOUT: %import_ref.9 = import_ref Main//action, inst+16, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+29, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Main//action, inst+39, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.12: type = import_ref Main//action, inst+42, loaded [template = constants.%Action.type.3] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//action, inst+53, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//action, inst+45, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+16, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+37, unloaded +// CHECK:STDOUT: %import_ref.6: = import_ref Main//action, inst+35, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//action, inst+34, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//action, inst+14, unloaded +// CHECK:STDOUT: %import_ref.9: @Action.%.1 (%.3) = import_ref Main//action, inst+20, loaded [symbolic = @Action.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.11: = import_ref Main//action, inst+31, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.12 = import_ref Main//action, inst+29, unloaded +// CHECK:STDOUT: %import_ref.13: type = import_ref Main//action, inst+39, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.14: type = import_ref Main//action, inst+42, loaded [template = constants.%Action.type.3] +// CHECK:STDOUT: %import_ref.15 = import_ref Main//action, inst+53, unloaded +// CHECK:STDOUT: %import_ref.16 = import_ref Main//action, inst+45, unloaded +// CHECK:STDOUT: %import_ref.17 = import_ref Main//action, inst+16, unloaded +// CHECK:STDOUT: %import_ref.19: = import_ref Main//action, inst+38, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.20 = import_ref Main//action, inst+37, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -489,38 +494,38 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Op.type: type = fn_type @Op, @Action(%T) [symbolic = %Op.type (constants.%Op.type.1)] // CHECK:STDOUT: %Op: @Action.%Op.type (%Op.type.1) = struct_value () [symbolic = %Op (constants.%Op.1)] // CHECK:STDOUT: %.1: type = assoc_entity_type @Action.%Action.type (%Action.type.2), @Action.%Op.type (%Op.type.1) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %.2: @Action.%.1 (%.3) = assoc_entity element0, imports.%import_ref.15 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: %.2: @Action.%.1 (%.3) = assoc_entity element0, imports.%import_ref.17 [symbolic = %.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: .Op = imports.%import_ref.8 -// CHECK:STDOUT: witness = (imports.%import_ref.9) +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .Op = imports.%import_ref.9 +// CHECK:STDOUT: witness = (imports.%import_ref.10) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.11 as imports.%import_ref.12 { +// CHECK:STDOUT: impl @impl: imports.%import_ref.13 as imports.%import_ref.14 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Op = imports.%import_ref.14 -// CHECK:STDOUT: witness = imports.%import_ref.13 +// CHECK:STDOUT: .Op = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.12 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.17 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.20 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Op(constants.%T: type, constants.%Self.1: @Action.%Action.type (%Action.type.2)) { @@ -534,7 +539,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Action.ref: %Action.type.1 = name_ref Action, imports.%import_ref.1 [template = constants.%Action] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %Action.type: type = facet_type <@Action, @Action(constants.%C)> [template = constants.%Action.type.4] -// CHECK:STDOUT: %.loc8: %.8 = specific_constant imports.%import_ref.8, @Action(constants.%C) [template = constants.%.9] +// CHECK:STDOUT: %.loc8: %.8 = specific_constant imports.%import_ref.9, @Action(constants.%C) [template = constants.%.9] // CHECK:STDOUT: %Op.ref: %.8 = name_ref Op, %.loc8 [template = constants.%.9] // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -748,14 +753,14 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Make.type.1: type = fn_type @Make.1, @Factory(%T) [symbolic] // CHECK:STDOUT: %Make.1: %Make.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = assoc_entity_type %Factory.type.2, %Make.type.1 [symbolic] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.13 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.15 [symbolic] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make.1, @Factory(%B) [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type %Factory.type.3, %Make.type.2 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.14 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.16 [template] // CHECK:STDOUT: %MakeB.type: type = fn_type @MakeB [template] // CHECK:STDOUT: %MakeB: %MakeB.type = struct_value () [template] -// CHECK:STDOUT: %.8: %.3 = assoc_entity element0, imports.%import_ref.15 [symbolic] +// CHECK:STDOUT: %.8: %.3 = assoc_entity element0, imports.%import_ref.17 [symbolic] // CHECK:STDOUT: %Make.type.3: type = fn_type @Make.2 [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] // CHECK:STDOUT: %.9: = interface_witness (%Make.3) [template] @@ -765,16 +770,18 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, inst+7, loaded [template = constants.%Factory] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+34, loaded [template = constants.%A] // CHECK:STDOUT: %import_ref.3: type = import_ref Main//factory, inst+39, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+40, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.6: @Factory.%.1 (%.3) = import_ref Main//factory, inst+26, loaded [symbolic = @Factory.%.2 (constants.%.8)] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//factory, inst+21, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+35, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//factory, inst+42, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//factory, inst+45, loaded [template = constants.%Factory.type.3] -// CHECK:STDOUT: %import_ref.11: = import_ref Main//factory, inst+61, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+53, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, inst+21, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, inst+41, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+40, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+14, unloaded +// CHECK:STDOUT: %import_ref.7: @Factory.%.1 (%.3) = import_ref Main//factory, inst+26, loaded [symbolic = @Factory.%.2 (constants.%.8)] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+21, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref Main//factory, inst+37, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+35, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//factory, inst+42, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, inst+45, loaded [template = constants.%Factory.type.3] +// CHECK:STDOUT: %import_ref.13: = import_ref Main//factory, inst+61, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, inst+53, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -811,32 +818,32 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Make.type: type = fn_type @Make.1, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.1)] // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)] // CHECK:STDOUT: %.1: type = assoc_entity_type @Factory.%Factory.type (%Factory.type.2), @Factory.%Make.type (%Make.type.1) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %.2: @Factory.%.1 (%.3) = assoc_entity element0, imports.%import_ref.13 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: %.2: @Factory.%.1 (%.3) = assoc_entity element0, imports.%import_ref.15 [symbolic = %.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .Make = imports.%import_ref.6 -// CHECK:STDOUT: witness = (imports.%import_ref.7) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Make = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: impl @impl: imports.%import_ref.11 as imports.%import_ref.12 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Make = imports.%import_ref.12 -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: .Make = imports.%import_ref.14 +// CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @Make.1(constants.%T: type, constants.%Self.1: @Factory.%Factory.type (%Factory.type.2)) { @@ -851,7 +858,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Factory.ref: %Factory.type.1 = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory] // CHECK:STDOUT: %B.ref.loc5: type = name_ref B, imports.%import_ref.3 [template = constants.%B] // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%B)> [template = constants.%Factory.type.3] -// CHECK:STDOUT: %.loc5_23: %.5 = specific_constant imports.%import_ref.6, @Factory(constants.%B) [template = constants.%.6] +// CHECK:STDOUT: %.loc5_23: %.5 = specific_constant imports.%import_ref.7, @Factory(constants.%B) [template = constants.%.6] // CHECK:STDOUT: %Make.ref: %.5 = name_ref Make, %.loc5_23 [template = constants.%.6] // CHECK:STDOUT: %.loc5_11: %Make.type.2 = interface_witness_access constants.%.9, element0 [template = constants.%Make.3] // CHECK:STDOUT: %.loc4_16.2: ref %B = splice_block %return {} @@ -906,11 +913,11 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Make.type.1: type = fn_type @Make, @Factory(%T) [symbolic] // CHECK:STDOUT: %Make.1: %Make.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.3: type = assoc_entity_type %Factory.type.2, %Make.type.1 [symbolic] -// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.13 [symbolic] +// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.15 [symbolic] // CHECK:STDOUT: %Make.type.2: type = fn_type @Make, @Factory(%B) [template] // CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template] // CHECK:STDOUT: %.5: type = assoc_entity_type %Factory.type.3, %Make.type.2 [template] -// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.14 [template] +// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.16 [template] // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: %MakeC.type: type = fn_type @MakeC [template] // CHECK:STDOUT: %MakeC: %MakeC.type = struct_value () [template] @@ -918,24 +925,26 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Make.type.3: type = fn_type @Make, @Factory(%C) [template] // CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type %Factory.type.4, %Make.type.3 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.13 [template] -// CHECK:STDOUT: %.10: %.3 = assoc_entity element0, imports.%import_ref.15 [symbolic] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.15 [template] +// CHECK:STDOUT: %.10: %.3 = assoc_entity element0, imports.%import_ref.17 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Factory.type.1 = import_ref Main//factory, inst+7, loaded [template = constants.%Factory] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//factory, inst+34, loaded [template = constants.%A] // CHECK:STDOUT: %import_ref.3 = import_ref Main//factory, inst+39, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//factory, inst+40, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+14, unloaded -// CHECK:STDOUT: %import_ref.6: @Factory.%.1 (%.3) = import_ref Main//factory, inst+26, loaded [symbolic = @Factory.%.2 (constants.%.10)] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//factory, inst+21, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+35, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Main//factory, inst+42, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.10: type = import_ref Main//factory, inst+45, loaded [template = constants.%Factory.type.3] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//factory, inst+61, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//factory, inst+53, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, inst+21, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//factory, inst+41, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//factory, inst+40, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//factory, inst+14, unloaded +// CHECK:STDOUT: %import_ref.7: @Factory.%.1 (%.3) = import_ref Main//factory, inst+26, loaded [symbolic = @Factory.%.2 (constants.%.10)] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//factory, inst+21, unloaded +// CHECK:STDOUT: %import_ref.9: = import_ref Main//factory, inst+37, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.10 = import_ref Main//factory, inst+35, unloaded +// CHECK:STDOUT: %import_ref.11: type = import_ref Main//factory, inst+42, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.12: type = import_ref Main//factory, inst+45, loaded [template = constants.%Factory.type.3] +// CHECK:STDOUT: %import_ref.13 = import_ref Main//factory, inst+61, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Main//factory, inst+53, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Main//factory, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -974,32 +983,32 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Factory(%T) [symbolic = %Make.type (constants.%Make.type.1)] // CHECK:STDOUT: %Make: @Factory.%Make.type (%Make.type.1) = struct_value () [symbolic = %Make (constants.%Make.1)] // CHECK:STDOUT: %.1: type = assoc_entity_type @Factory.%Factory.type (%Factory.type.2), @Factory.%Make.type (%Make.type.1) [symbolic = %.1 (constants.%.3)] -// CHECK:STDOUT: %.2: @Factory.%.1 (%.3) = assoc_entity element0, imports.%import_ref.13 [symbolic = %.2 (constants.%.4)] +// CHECK:STDOUT: %.2: @Factory.%.1 (%.3) = assoc_entity element0, imports.%import_ref.15 [symbolic = %.2 (constants.%.4)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .Make = imports.%import_ref.6 -// CHECK:STDOUT: witness = (imports.%import_ref.7) +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .Make = imports.%import_ref.7 +// CHECK:STDOUT: witness = (imports.%import_ref.8) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: imports.%import_ref.9 as imports.%import_ref.10 { +// CHECK:STDOUT: impl @impl: imports.%import_ref.11 as imports.%import_ref.12 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Make = imports.%import_ref.12 -// CHECK:STDOUT: witness = imports.%import_ref.11 +// CHECK:STDOUT: .Make = imports.%import_ref.14 +// CHECK:STDOUT: witness = imports.%import_ref.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @B { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.8 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.9 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { @@ -1022,7 +1031,7 @@ fn MakeC(a: A) -> C { // CHECK:STDOUT: %Factory.ref: %Factory.type.1 = name_ref Factory, imports.%import_ref.1 [template = constants.%Factory] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %Factory.type: type = facet_type <@Factory, @Factory(constants.%C)> [template = constants.%Factory.type.4] -// CHECK:STDOUT: %.loc10: %.8 = specific_constant imports.%import_ref.6, @Factory(constants.%C) [template = constants.%.9] +// CHECK:STDOUT: %.loc10: %.8 = specific_constant imports.%import_ref.7, @Factory(constants.%C) [template = constants.%.9] // CHECK:STDOUT: %Make.ref: %.8 = name_ref Make, %.loc10 [template = constants.%.9] // CHECK:STDOUT: return to %return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index 411ec7fffd1c..d5650d15782d 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -643,7 +643,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: %import_ref.2: type = import_ref Main//two_file, inst+7, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3: %Foo.type = import_ref Main//two_file, inst+15, loaded [template = constants.%Foo] // CHECK:STDOUT: %import_ref.4: %Bar.type = import_ref Main//two_file, inst+26, loaded [template = constants.%Bar] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//two_file, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -723,8 +724,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { @@ -1096,7 +1097,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//alias_two_file, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: %Foo.type = import_ref Main//alias_two_file, inst+13, loaded [template = constants.%Foo] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//alias_two_file, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//alias_two_file, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//alias_two_file, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1145,8 +1147,8 @@ interface Foo(a:! const (const C)) {} // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @Foo(constants.%a) { diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon index 365bfdf6104b..630cff4d2ffe 100644 --- a/toolchain/check/testdata/namespace/merging_with_indirections.carbon +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -99,7 +99,8 @@ fn Run() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3 = import_ref Other//a, inst+5, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Other//a, inst+7, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Other//a, inst+5, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -136,8 +137,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> %return: %A { @@ -171,15 +172,16 @@ fn Run() { // CHECK:STDOUT: import Other//b // CHECK:STDOUT: import Other//a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//b, inst+22, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//b, inst+16, unloaded -// CHECK:STDOUT: %import_ref.3: = import_ref Other//b, inst+4, loaded -// CHECK:STDOUT: %NS1: = namespace %import_ref.3, [template] { -// CHECK:STDOUT: .A = %import_ref.4 +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//b, inst+23, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//b, inst+16, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//b, inst+17, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Other//b, inst+4, loaded +// CHECK:STDOUT: %NS1: = namespace %import_ref.4, [template] { +// CHECK:STDOUT: .A = %import_ref.5 // CHECK:STDOUT: import Other//b // CHECK:STDOUT: import Other//a // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4: type = import_ref Other//a, inst+4, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.5: type = import_ref Other//a, inst+4, loaded [template = constants.%A] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -195,8 +197,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: class @A { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -208,7 +210,7 @@ fn Run() { // CHECK:STDOUT: %.loc7_10.2: ref %A = temporary %.loc7_10.1, %F.call.loc7 // CHECK:STDOUT: %Other.ref.loc10: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %NS1.ref: = name_ref NS1, imports.%NS1 [template = imports.%NS1] -// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.4 [template = constants.%A] +// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.5 [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a // CHECK:STDOUT: %a: ref %A = bind_name a, %a.var // CHECK:STDOUT: %a.ref: ref %A = name_ref a, %a 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 ff256650e7e7..26ebd8b1d7df 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -289,8 +289,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -303,9 +304,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name_copy.carbon @@ -319,8 +320,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -333,9 +335,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name_indirect.carbon @@ -348,9 +350,10 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -363,9 +366,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_export_import.carbon @@ -386,8 +389,9 @@ alias C = Other.C; // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -404,9 +408,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -441,8 +445,9 @@ alias C = Other.C; // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -459,9 +464,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -496,8 +501,9 @@ alias C = Other.C; // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -514,9 +520,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -548,9 +554,10 @@ alias C = Other.C; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -567,9 +574,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -602,9 +609,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//export_name_copy // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -621,9 +629,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -655,9 +663,10 @@ alias C = Other.C; // CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name_indirect, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name_indirect, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name_indirect, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name_indirect, inst+8, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name_indirect, inst+9, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name_indirect, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -674,9 +683,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -714,9 +723,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -733,9 +743,9 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -829,9 +839,10 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+10, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+8, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Other//export_name, inst+8, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Other//export_name, inst+10, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -847,8 +858,8 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // 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 68878d905ca1..f16a258ff06b 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -279,8 +279,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -296,9 +297,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -327,8 +328,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -345,9 +347,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -376,8 +378,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+2, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -394,9 +397,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -425,8 +428,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -442,9 +446,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -473,8 +477,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -490,9 +495,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -521,8 +526,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -538,9 +544,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -569,8 +575,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -586,9 +593,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -617,8 +624,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -634,9 +642,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -665,8 +673,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -682,9 +691,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -724,8 +733,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -741,9 +751,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -771,10 +781,11 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//use_non_export_then_base, inst+13, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//use_non_export_then_base, inst+14, unloaded // CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -791,9 +802,9 @@ var indirect_c: C = {.x = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // 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 0e94da2f29f7..88c5eba13b55 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -187,8 +187,9 @@ var d: D = {.y = ()}; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+11, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -202,9 +203,9 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name.carbon @@ -219,8 +220,9 @@ var d: D = {.y = ()}; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+11, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -234,15 +236,15 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_name_then_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export_name, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -264,9 +266,10 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst+9, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -282,9 +285,9 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -312,9 +315,10 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_name, inst+9, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Main//export_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_name, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -330,9 +334,9 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -360,9 +364,10 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst+9, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -378,9 +383,9 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -404,7 +409,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref = import_ref Main//export_import_then_name, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -438,9 +443,10 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export_import_then_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_import_then_name, inst+9, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+10, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+11, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -456,9 +462,9 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -490,12 +496,14 @@ var d: D = {.y = ()}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_import_then_name, inst+12, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+11, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_import_then_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//export_import_then_name, inst+9, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.4 = import_ref Main//export_import_then_name, inst+10, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+16, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_import_then_name, inst+11, unloaded +// CHECK:STDOUT: %import_ref.6: = import_ref Main//base, inst+18, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, inst+16, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -516,16 +524,16 @@ var d: D = {.y = ()}; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.7 +// CHECK:STDOUT: .y = imports.%import_ref.8 +// CHECK:STDOUT: complete_type_witness = 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 32f055a4fcf3..86212c5d5151 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -269,10 +269,12 @@ private export C; // CHECK:STDOUT: .NSC = file.%NSC // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+17, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//base, inst+19, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, inst+13, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//base, inst+17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -287,22 +289,22 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .y = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.4 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .y = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- not_reexporting.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.1 = import_ref Main//export, inst+14, unloaded // CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 @@ -330,16 +332,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = file.%NSC // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+20, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst+11, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+18, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst+19, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -354,16 +358,16 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .y = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.4 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .y = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_in_impl.carbon @@ -388,16 +392,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+20, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst+11, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+18, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst+19, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -419,16 +425,16 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .y = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .y = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -468,16 +474,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+14, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+20, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export_export, inst+11, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+18, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export_export, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export_export, inst+19, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export_export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export_export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -500,16 +508,16 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .y = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .y = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -549,16 +557,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+14, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+20, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export_export, inst+11, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+18, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export_export, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export_export, inst+19, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export_export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export_export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -580,16 +590,16 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .y = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .y = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -669,8 +679,9 @@ private export C; // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -683,9 +694,9 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_both.carbon @@ -710,10 +721,12 @@ private export C; // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+13, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+17, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//base, inst+19, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//base, inst+13, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//base, inst+17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -735,16 +748,16 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .y = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .y = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -784,16 +797,18 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+13, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+20, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+11, unloaded +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4: = import_ref Main//export, inst+11, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+18, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.7: = import_ref Main//export, inst+19, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.8 = import_ref Main//export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -815,16 +830,16 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.6 -// CHECK:STDOUT: .y = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.5 +// CHECK:STDOUT: .Self = imports.%import_ref.8 +// CHECK:STDOUT: .y = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -878,8 +893,9 @@ private export C; // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -893,9 +909,9 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_repeat_export.carbon @@ -910,9 +926,10 @@ private export C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//repeat_export, inst+13, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//repeat_export, inst+11, unloaded +// CHECK:STDOUT: %import_ref.1: type = import_ref Main//repeat_export, inst+14, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2: = import_ref Main//repeat_export, inst+11, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Main//repeat_export, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//repeat_export, inst+13, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -928,9 +945,9 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .x = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -961,8 +978,9 @@ private export C; // CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { // CHECK:STDOUT: .NSC = %import_ref.3 // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.4: = import_ref Main//base, inst+9, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -976,8 +994,8 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: .x = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.5 +// CHECK:STDOUT: .x = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = 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 2f206d903584..f246a4c8a108 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 @@ -73,8 +73,9 @@ export C.n; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Foo//a, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Foo//a, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Foo//a, inst+8, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Foo//a, inst+10, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.3 = import_ref Foo//a, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Foo//a, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -86,8 +87,8 @@ export C.n; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: .n = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .n = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: 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 56445e69c6a9..edc70b197f07 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -332,8 +332,10 @@ import Other library "o1"; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//mix_current_package, inst+2, loaded [template = constants.%C1] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//c2, inst+1, loaded [template = constants.%C2] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//c1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//c2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//c1, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//c1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//c2, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Main//c2, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -355,14 +357,14 @@ import Other library "o1"; // CHECK:STDOUT: // CHECK:STDOUT: class @C1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C2 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -402,7 +404,8 @@ import Other library "o1"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//dup_c1, inst+2, loaded [template = constants.%C1] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//c1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//c1, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//c1, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -419,8 +422,8 @@ import Other library "o1"; // CHECK:STDOUT: // CHECK:STDOUT: class @C1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -463,7 +466,8 @@ import Other library "o1"; // CHECK:STDOUT: .C = %import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.2: type = import_ref Main//use_ns, inst+4, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//ns, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Main//ns, inst+5, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//ns, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -481,8 +485,8 @@ import Other library "o1"; // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -523,14 +527,16 @@ import Other library "o1"; // CHECK:STDOUT: imports { // CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: .O1 = %import_ref.1 -// CHECK:STDOUT: .O2 = %import_ref.3 +// CHECK:STDOUT: .O2 = %import_ref.4 // CHECK:STDOUT: import Other//o2 // CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, inst+1, loaded [template = constants.%O1] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//o1, inst+2, unloaded -// CHECK:STDOUT: %import_ref.3: type = import_ref Other//o2, inst+1, loaded [template = constants.%O2] -// CHECK:STDOUT: %import_ref.4 = import_ref Other//o2, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//o1, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//o1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.4: type = import_ref Other//o2, inst+1, loaded [template = constants.%O2] +// CHECK:STDOUT: %import_ref.5: = import_ref Other//o2, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Other//o2, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -547,21 +553,21 @@ import Other library "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, imports.%Other [template = imports.%Other] -// CHECK:STDOUT: %O2.ref: type = name_ref O2, imports.%import_ref.3 [template = constants.%O2] +// CHECK:STDOUT: %O2.ref: type = name_ref O2, imports.%import_ref.4 [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 = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @O2 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.4 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -607,7 +613,8 @@ import Other library "o1"; // CHECK:STDOUT: import Other//o1 // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//o1, inst+1, loaded [template = constants.%O1] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//o1, inst+2, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Other//o1, inst+4, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.3 = import_ref Other//o1, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -626,8 +633,8 @@ import Other library "o1"; // CHECK:STDOUT: // CHECK:STDOUT: class @O1 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 -// CHECK:STDOUT: complete_type_witness = constants.%.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon index 7f728bf2b8ea..b746a5aa9078 100644 --- a/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon +++ b/toolchain/check/testdata/return/no_prelude/import_convert_function.carbon @@ -1056,14 +1056,14 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic] // CHECK:STDOUT: %.9: type = facet_access_type %Self.2 [symbolic] // CHECK:STDOUT: %.10: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.12 [symbolic] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.14 [symbolic] // CHECK:STDOUT: %.12: type = facet_access_type %Self.1 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template] // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template] // CHECK:STDOUT: %.13: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.12 [template] -// CHECK:STDOUT: %.15: %.10 = assoc_entity element0, imports.%import_ref.13 [symbolic] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.14 [template] +// CHECK:STDOUT: %.15: %.10 = assoc_entity element0, imports.%import_ref.15 [symbolic] // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template] // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template] // CHECK:STDOUT: %.16: = interface_witness (%Convert.3) [template] @@ -1075,7 +1075,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.1, @ImplicitAs(%D) [template] // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [template] // CHECK:STDOUT: %.20: type = assoc_entity_type %ImplicitAs.type.4, %Convert.type.4 [template] -// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.21: %.20 = assoc_entity element0, imports.%import_ref.14 [template] // CHECK:STDOUT: %.22: %i32 = int_value 1 [template] // CHECK:STDOUT: %C.4: type = class_type @C, @C(%.22) [template] // CHECK:STDOUT: %.23: %i32 = int_value 2 [template] @@ -1142,53 +1142,55 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: imports { // CHECK:STDOUT: %P: = namespace file.%P.import, [template] { // CHECK:STDOUT: .D = %import_ref.2 -// CHECK:STDOUT: .C = %import_ref.6 -// CHECK:STDOUT: .Make = %import_ref.41 +// CHECK:STDOUT: .C = %import_ref.7 +// CHECK:STDOUT: .Make = %import_ref.43 // CHECK:STDOUT: import P//library // CHECK:STDOUT: } // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.8 +// CHECK:STDOUT: .ImplicitAs = %import_ref.10 // CHECK:STDOUT: import Core//default // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.2: type = import_ref P//library, inst+34, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.3 = import_ref P//library, inst+35, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref P//library, inst+41, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref P//library, inst+46, unloaded -// CHECK:STDOUT: %import_ref.6: %C.type = import_ref P//library, inst+25, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.7 = import_ref P//library, inst+30, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Core//default, inst+36, unloaded -// CHECK:STDOUT: %import_ref.10: @ImplicitAs.%.1 (%.10) = import_ref Core//default, inst+60, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Core//default, inst+52, unloaded -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, inst+71, loaded [template = Core.IntLiteral] -// CHECK:STDOUT: %import_ref.15: type = import_ref Core//default, inst+79, loaded [template = constants.%ImplicitAs.type.3] -// CHECK:STDOUT: %import_ref.16: = import_ref Core//default, inst+103, loaded [template = constants.%.16] -// CHECK:STDOUT: %import_ref.17: type = import_ref P//library, inst+148, loaded [template = constants.%C.3] -// CHECK:STDOUT: %import_ref.18: type = import_ref P//library, inst+153, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.19: = import_ref P//library, inst+174, loaded [template = constants.%.29] -// CHECK:STDOUT: %import_ref.20: type = import_ref P//library, inst+191, loaded [template = constants.%C.4] -// CHECK:STDOUT: %import_ref.21: type = import_ref P//library, inst+196, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.22: = import_ref P//library, inst+212, loaded [template = constants.%.32] -// CHECK:STDOUT: %import_ref.23: type = import_ref P//library, inst+228, loaded [template = constants.%C.5] -// CHECK:STDOUT: %import_ref.24: type = import_ref P//library, inst+233, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.25: = import_ref P//library, inst+249, loaded [template = constants.%.35] -// CHECK:STDOUT: %import_ref.26: type = import_ref P//library, inst+265, loaded [template = constants.%C.6] -// CHECK:STDOUT: %import_ref.27: type = import_ref P//library, inst+270, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.28: = import_ref P//library, inst+286, loaded [template = constants.%.38] -// CHECK:STDOUT: %import_ref.29: type = import_ref P//library, inst+302, loaded [template = constants.%C.7] -// CHECK:STDOUT: %import_ref.30: type = import_ref P//library, inst+307, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.31: = import_ref P//library, inst+323, loaded [template = constants.%.41] -// CHECK:STDOUT: %import_ref.32: type = import_ref P//library, inst+339, loaded [template = constants.%C.8] -// CHECK:STDOUT: %import_ref.33: type = import_ref P//library, inst+344, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.34: = import_ref P//library, inst+360, loaded [template = constants.%.44] -// CHECK:STDOUT: %import_ref.35: type = import_ref P//library, inst+376, loaded [template = constants.%C.9] -// CHECK:STDOUT: %import_ref.36: type = import_ref P//library, inst+381, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.37: = import_ref P//library, inst+397, loaded [template = constants.%.47] -// CHECK:STDOUT: %import_ref.38: type = import_ref P//library, inst+413, loaded [template = constants.%C.10] -// CHECK:STDOUT: %import_ref.39: type = import_ref P//library, inst+418, loaded [template = constants.%ImplicitAs.type.4] -// CHECK:STDOUT: %import_ref.40: = import_ref P//library, inst+434, loaded [template = constants.%.50] -// CHECK:STDOUT: %import_ref.41: %Make.type = import_ref P//library, inst+55, loaded [template = constants.%Make] +// CHECK:STDOUT: %import_ref.3: = import_ref P//library, inst+48, loaded [template = constants.%.3] +// CHECK:STDOUT: %import_ref.4 = import_ref P//library, inst+35, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref P//library, inst+41, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref P//library, inst+46, unloaded +// CHECK:STDOUT: %import_ref.7: %C.type = import_ref P//library, inst+25, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.8: = import_ref P//library, inst+32, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.9 = import_ref P//library, inst+30, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Core//default, inst+36, unloaded +// CHECK:STDOUT: %import_ref.12: @ImplicitAs.%.1 (%.10) = import_ref Core//default, inst+60, loaded [symbolic = @ImplicitAs.%.2 (constants.%.15)] +// CHECK:STDOUT: %import_ref.13 = import_ref Core//default, inst+52, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Core//default, inst+52, unloaded +// CHECK:STDOUT: %import_ref.16: type = import_ref Core//default, inst+71, loaded [template = Core.IntLiteral] +// CHECK:STDOUT: %import_ref.17: type = import_ref Core//default, inst+79, loaded [template = constants.%ImplicitAs.type.3] +// CHECK:STDOUT: %import_ref.18: = import_ref Core//default, inst+103, loaded [template = constants.%.16] +// CHECK:STDOUT: %import_ref.19: type = import_ref P//library, inst+148, loaded [template = constants.%C.3] +// CHECK:STDOUT: %import_ref.20: type = import_ref P//library, inst+153, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.21: = import_ref P//library, inst+174, loaded [template = constants.%.29] +// CHECK:STDOUT: %import_ref.22: type = import_ref P//library, inst+191, loaded [template = constants.%C.4] +// CHECK:STDOUT: %import_ref.23: type = import_ref P//library, inst+196, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.24: = import_ref P//library, inst+212, loaded [template = constants.%.32] +// CHECK:STDOUT: %import_ref.25: type = import_ref P//library, inst+228, loaded [template = constants.%C.5] +// CHECK:STDOUT: %import_ref.26: type = import_ref P//library, inst+233, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.27: = import_ref P//library, inst+249, loaded [template = constants.%.35] +// CHECK:STDOUT: %import_ref.28: type = import_ref P//library, inst+265, loaded [template = constants.%C.6] +// CHECK:STDOUT: %import_ref.29: type = import_ref P//library, inst+270, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.30: = import_ref P//library, inst+286, loaded [template = constants.%.38] +// CHECK:STDOUT: %import_ref.31: type = import_ref P//library, inst+302, loaded [template = constants.%C.7] +// CHECK:STDOUT: %import_ref.32: type = import_ref P//library, inst+307, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.33: = import_ref P//library, inst+323, loaded [template = constants.%.41] +// CHECK:STDOUT: %import_ref.34: type = import_ref P//library, inst+339, loaded [template = constants.%C.8] +// CHECK:STDOUT: %import_ref.35: type = import_ref P//library, inst+344, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.36: = import_ref P//library, inst+360, loaded [template = constants.%.44] +// CHECK:STDOUT: %import_ref.37: type = import_ref P//library, inst+376, loaded [template = constants.%C.9] +// CHECK:STDOUT: %import_ref.38: type = import_ref P//library, inst+381, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.39: = import_ref P//library, inst+397, loaded [template = constants.%.47] +// CHECK:STDOUT: %import_ref.40: type = import_ref P//library, inst+413, loaded [template = constants.%C.10] +// CHECK:STDOUT: %import_ref.41: type = import_ref P//library, inst+418, loaded [template = constants.%ImplicitAs.type.4] +// CHECK:STDOUT: %import_ref.42: = import_ref P//library, inst+434, loaded [template = constants.%.50] +// CHECK:STDOUT: %import_ref.43: %Make.type = import_ref P//library, inst+55, loaded [template = constants.%Make] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1228,67 +1230,67 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic = %Convert.type (constants.%Convert.type.1)] // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)] // CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.10)] -// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.10) = assoc_entity element0, imports.%import_ref.12 [symbolic = %.2 (constants.%.11)] +// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.10) = assoc_entity element0, imports.%import_ref.14 [symbolic = %.2 (constants.%.11)] // CHECK:STDOUT: // CHECK:STDOUT: interface { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.9 -// CHECK:STDOUT: .Convert = imports.%import_ref.10 -// CHECK:STDOUT: witness = (imports.%import_ref.11) +// CHECK:STDOUT: .Self = imports.%import_ref.11 +// CHECK:STDOUT: .Convert = imports.%import_ref.12 +// CHECK:STDOUT: witness = (imports.%import_ref.13) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.1: imports.%import_ref.14 as imports.%import_ref.15 { +// CHECK:STDOUT: impl @impl.1: imports.%import_ref.16 as imports.%import_ref.17 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.16 +// CHECK:STDOUT: witness = imports.%import_ref.18 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.2: imports.%import_ref.17 as imports.%import_ref.18 { +// CHECK:STDOUT: impl @impl.2: imports.%import_ref.19 as imports.%import_ref.20 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.19 +// CHECK:STDOUT: witness = imports.%import_ref.21 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3: imports.%import_ref.20 as imports.%import_ref.21 { +// CHECK:STDOUT: impl @impl.3: imports.%import_ref.22 as imports.%import_ref.23 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.22 +// CHECK:STDOUT: witness = imports.%import_ref.24 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4: imports.%import_ref.23 as imports.%import_ref.24 { +// CHECK:STDOUT: impl @impl.4: imports.%import_ref.25 as imports.%import_ref.26 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.25 +// CHECK:STDOUT: witness = imports.%import_ref.27 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.5: imports.%import_ref.26 as imports.%import_ref.27 { +// CHECK:STDOUT: impl @impl.5: imports.%import_ref.28 as imports.%import_ref.29 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.28 +// CHECK:STDOUT: witness = imports.%import_ref.30 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.6: imports.%import_ref.29 as imports.%import_ref.30 { +// CHECK:STDOUT: impl @impl.6: imports.%import_ref.31 as imports.%import_ref.32 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.31 +// CHECK:STDOUT: witness = imports.%import_ref.33 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.7: imports.%import_ref.32 as imports.%import_ref.33 { +// CHECK:STDOUT: impl @impl.7: imports.%import_ref.34 as imports.%import_ref.35 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.34 +// CHECK:STDOUT: witness = imports.%import_ref.36 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.8: imports.%import_ref.35 as imports.%import_ref.36 { +// CHECK:STDOUT: impl @impl.8: imports.%import_ref.37 as imports.%import_ref.38 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.37 +// CHECK:STDOUT: witness = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.9: imports.%import_ref.38 as imports.%import_ref.39 { +// CHECK:STDOUT: impl @impl.9: imports.%import_ref.40 as imports.%import_ref.41 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%import_ref.40 +// CHECK:STDOUT: witness = imports.%import_ref.42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .n = imports.%import_ref.4 -// CHECK:STDOUT: .m = imports.%import_ref.5 -// CHECK:STDOUT: complete_type_witness = constants.%.3 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .n = imports.%import_ref.5 +// CHECK:STDOUT: .m = imports.%import_ref.6 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic class @C(constants.%N: %i32) { @@ -1299,8 +1301,8 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.7 -// CHECK:STDOUT: complete_type_witness = constants.%.7 +// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.8 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1314,7 +1316,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.then.loc8: // CHECK:STDOUT: %.loc8_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc8: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %C.ref.loc8: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref.loc8: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.1] // CHECK:STDOUT: %.loc8_33: Core.IntLiteral = int_value 0 [template = constants.%.8] // CHECK:STDOUT: %.loc8_32.1: %Convert.type.2 = interface_witness_access constants.%.16, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %.loc8_32.2: = bound_method %.loc8_33, %.loc8_32.1 [template = constants.%.17] @@ -1341,7 +1343,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.then.loc9: // CHECK:STDOUT: %.loc9_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc9: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref.loc9: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.1] // CHECK:STDOUT: %.loc9_33: Core.IntLiteral = int_value 1 [template = constants.%.30] // CHECK:STDOUT: %.loc9_32.1: %Convert.type.2 = interface_witness_access constants.%.16, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %.loc9_32.2: = bound_method %.loc9_33, %.loc9_32.1 [template = constants.%.31] @@ -1368,7 +1370,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.then.loc10: // CHECK:STDOUT: %.loc10_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc10: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref.loc10: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.1] // CHECK:STDOUT: %.loc10_33: Core.IntLiteral = int_value 2 [template = constants.%.33] // CHECK:STDOUT: %.loc10_32.1: %Convert.type.2 = interface_witness_access constants.%.16, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %.loc10_32.2: = bound_method %.loc10_33, %.loc10_32.1 [template = constants.%.34] @@ -1395,7 +1397,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.then.loc11: // CHECK:STDOUT: %.loc11_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc11: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref.loc11: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.1] // CHECK:STDOUT: %.loc11_33: Core.IntLiteral = int_value 3 [template = constants.%.36] // CHECK:STDOUT: %.loc11_32.1: %Convert.type.2 = interface_witness_access constants.%.16, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %.loc11_32.2: = bound_method %.loc11_33, %.loc11_32.1 [template = constants.%.37] @@ -1422,7 +1424,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.then.loc12: // CHECK:STDOUT: %.loc12_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc12: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref.loc12: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.1] // CHECK:STDOUT: %.loc12_33: Core.IntLiteral = int_value 4 [template = constants.%.39] // CHECK:STDOUT: %.loc12_32.1: %Convert.type.2 = interface_witness_access constants.%.16, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %.loc12_32.2: = bound_method %.loc12_33, %.loc12_32.1 [template = constants.%.40] @@ -1449,7 +1451,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.then.loc13: // CHECK:STDOUT: %.loc13_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc13: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %C.ref.loc13: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref.loc13: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.1] // CHECK:STDOUT: %.loc13_33: Core.IntLiteral = int_value 5 [template = constants.%.42] // CHECK:STDOUT: %.loc13_32.1: %Convert.type.2 = interface_witness_access constants.%.16, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %.loc13_32.2: = bound_method %.loc13_33, %.loc13_32.1 [template = constants.%.43] @@ -1476,7 +1478,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.then.loc14: // CHECK:STDOUT: %.loc14_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc14: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref.loc14: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.1] // CHECK:STDOUT: %.loc14_33: Core.IntLiteral = int_value 6 [template = constants.%.45] // CHECK:STDOUT: %.loc14_32.1: %Convert.type.2 = interface_witness_access constants.%.16, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %.loc14_32.2: = bound_method %.loc14_33, %.loc14_32.1 [template = constants.%.46] @@ -1503,7 +1505,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: !if.then.loc15: // CHECK:STDOUT: %.loc15_24.1: %.6 = struct_literal () // CHECK:STDOUT: %P.ref.loc15: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %C.ref.loc15: %C.type = name_ref C, imports.%import_ref.6 [template = constants.%C.1] +// CHECK:STDOUT: %C.ref.loc15: %C.type = name_ref C, imports.%import_ref.7 [template = constants.%C.1] // CHECK:STDOUT: %.loc15_33: Core.IntLiteral = int_value 7 [template = constants.%.48] // CHECK:STDOUT: %.loc15_32.1: %Convert.type.2 = interface_witness_access constants.%.16, element0 [template = constants.%Convert.3] // CHECK:STDOUT: %.loc15_32.2: = bound_method %.loc15_33, %.loc15_32.1 [template = constants.%.49] @@ -1525,7 +1527,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc15: // CHECK:STDOUT: %P.ref.loc16: = name_ref P, imports.%P [template = imports.%P] -// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%import_ref.41 [template = constants.%Make] +// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%import_ref.43 [template = constants.%Make] // CHECK:STDOUT: %.loc7_15.2: ref %D = splice_block %return {} // CHECK:STDOUT: %Make.call: init %D = call %Make.ref() to %.loc7_15.2 // CHECK:STDOUT: return %Make.call to %return diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 51869135fc15..c25e6b79aecf 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -43,10 +43,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); @@ -355,7 +355,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] // CHECK:STDOUT: %.35: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] // CHECK:STDOUT: %.36: %.35 = assoc_entity element0, imports.%import_ref.11 [template] -// CHECK:STDOUT: %.37: %.2 = assoc_entity element0, imports.%import_ref.42 [symbolic] +// CHECK:STDOUT: %.37: %.2 = assoc_entity element0, imports.%import_ref.43 [symbolic] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.21) [template] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] // CHECK:STDOUT: %.38: = interface_witness (%Convert.14) [template] @@ -378,7 +378,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+460, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.39 -// CHECK:STDOUT: .ImplicitAs = %import_ref.41 +// CHECK:STDOUT: .ImplicitAs = %import_ref.42 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -414,7 +414,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+298, loaded [symbolic = @impl.8.%uN (constants.%uN)] // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+299, loaded [template = constants.%As.type.5] // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+300, unloaded -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+421, unloaded +// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, inst+423, loaded [template = constants.%.29] +// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst+421, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -659,8 +660,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.40 -// CHECK:STDOUT: complete_type_witness = constants.%.29 +// CHECK:STDOUT: .Self = imports.%import_ref.41 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.40 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1218,7 +1219,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+298, loaded [symbolic = @impl.8.%uN (constants.%uN)] // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+299, loaded [template = constants.%As.type.5] // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+300, unloaded -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+421, unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, inst+423, loaded [template = constants.%.22] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+421, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1421,8 +1423,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.39 -// CHECK:STDOUT: complete_type_witness = constants.%.22 +// CHECK:STDOUT: .Self = imports.%import_ref.40 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1875,7 +1877,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] // CHECK:STDOUT: %.29: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] // CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.11 [template] -// CHECK:STDOUT: %.31: %.2 = assoc_entity element0, imports.%import_ref.41 [symbolic] +// CHECK:STDOUT: %.31: %.2 = assoc_entity element0, imports.%import_ref.42 [symbolic] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.23) [template] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] // CHECK:STDOUT: %.32: = interface_witness (%Convert.14) [template] @@ -1906,7 +1908,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+416, loaded [template = constants.%C.1] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+460, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.40 +// CHECK:STDOUT: .ImplicitAs = %import_ref.41 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1942,7 +1944,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+298, loaded [symbolic = @impl.8.%uN (constants.%uN)] // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+299, loaded [template = constants.%As.type.5] // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+300, unloaded -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+421, unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, inst+423, loaded [template = constants.%.22] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+421, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -2160,8 +2163,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.39 -// CHECK:STDOUT: complete_type_witness = constants.%.22 +// CHECK:STDOUT: .Self = imports.%import_ref.40 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index 650501bedd54..c25ef86b51b3 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -45,10 +45,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C()` to `C()` [ImplicitAsConversionFailure] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C()` does not implement interface `ImplicitAs(C())` [MissingImplInMemberAccessNote] // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); @@ -386,7 +386,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] // CHECK:STDOUT: %.29: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] // CHECK:STDOUT: %.30: %.29 = assoc_entity element0, imports.%import_ref.11 [template] -// CHECK:STDOUT: %.31: %.2 = assoc_entity element0, imports.%import_ref.42 [symbolic] +// CHECK:STDOUT: %.31: %.2 = assoc_entity element0, imports.%import_ref.43 [symbolic] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.21) [template] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] // CHECK:STDOUT: %.32: = interface_witness (%Convert.14) [template] @@ -409,7 +409,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+487, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: .Int = %import_ref.39 -// CHECK:STDOUT: .ImplicitAs = %import_ref.41 +// CHECK:STDOUT: .ImplicitAs = %import_ref.42 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -445,7 +445,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+300, loaded [symbolic = @impl.8.%uN (constants.%uN)] // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+301, loaded [template = constants.%As.type.5] // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+302, unloaded -// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+458, unloaded +// CHECK:STDOUT: %import_ref.40: = import_ref Implicit//default, inst+460, loaded [template = constants.%.26] +// CHECK:STDOUT: %import_ref.41 = import_ref Implicit//default, inst+458, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -699,8 +700,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.40 -// CHECK:STDOUT: complete_type_witness = constants.%.26 +// CHECK:STDOUT: .Self = imports.%import_ref.41 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.40 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1267,7 +1268,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+300, loaded [symbolic = @impl.8.%uN (constants.%uN)] // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+301, loaded [template = constants.%As.type.5] // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+302, unloaded -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+458, unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, inst+460, loaded [template = constants.%.22] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+458, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1471,8 +1473,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.39 -// CHECK:STDOUT: complete_type_witness = constants.%.22 +// CHECK:STDOUT: .Self = imports.%import_ref.40 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1925,7 +1927,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template] // CHECK:STDOUT: %.27: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template] // CHECK:STDOUT: %.28: %.27 = assoc_entity element0, imports.%import_ref.11 [template] -// CHECK:STDOUT: %.29: %.2 = assoc_entity element0, imports.%import_ref.41 [symbolic] +// CHECK:STDOUT: %.29: %.2 = assoc_entity element0, imports.%import_ref.42 [symbolic] // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.23) [template] // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template] // CHECK:STDOUT: %.30: = interface_witness (%Convert.14) [template] @@ -1956,7 +1958,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+453, loaded [template = constants.%C.1] // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+487, loaded [template = constants.%F] // CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .ImplicitAs = %import_ref.40 +// CHECK:STDOUT: .ImplicitAs = %import_ref.41 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -1992,7 +1994,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+300, loaded [symbolic = @impl.8.%uN (constants.%uN)] // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+301, loaded [template = constants.%As.type.5] // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+302, unloaded -// CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+458, unloaded +// CHECK:STDOUT: %import_ref.39: = import_ref Implicit//default, inst+460, loaded [template = constants.%.22] +// CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+458, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -2210,8 +2213,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.39 -// CHECK:STDOUT: complete_type_witness = constants.%.22 +// CHECK:STDOUT: .Self = imports.%import_ref.40 +// CHECK:STDOUT: complete_type_witness = imports.%import_ref.39 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/generic.carbon b/toolchain/lower/testdata/class/generic.carbon new file mode 100644 index 000000000000..8edd02c4660a --- /dev/null +++ b/toolchain/lower/testdata/class/generic.carbon @@ -0,0 +1,92 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/class/generic.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/class/generic.carbon + +// --- classes.carbon + +package Classes; + +base class Base(T:! type) { + var b: T; +} + +class Derived(T:! type) { + extend base: Base(T); + var d: T; +} + +class Adapter(T:! type) { + extend adapt Derived(T); +} + +// --- create.carbon + +package Create; + +import Classes; + +fn CreateDerived() -> Classes.Derived(i32) { + return {.base = {.b = 1}, .d = 2}; +} + +fn CreateAdapter() -> Classes.Adapter(i32) { + return CreateDerived() as Classes.Adapter(i32); +} + +// CHECK:STDOUT: ; ModuleID = 'classes.carbon' +// CHECK:STDOUT: source_filename = "classes.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "classes.carbon", directory: "") +// CHECK:STDOUT: ; ModuleID = 'create.carbon' +// CHECK:STDOUT: source_filename = "create.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: @struct.2.loc7_36 = internal constant { { i32 }, i32 } { { i32 } { i32 1 }, i32 2 } +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_CCreateDerived.Create(ptr sret({ { i32 }, i32 }) %return) !dbg !4 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc7_35.2.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 0, !dbg !7 +// CHECK:STDOUT: %.loc7_26.6.b = getelementptr inbounds nuw { i32 }, ptr %.loc7_35.2.base, i32 0, i32 0, !dbg !8 +// CHECK:STDOUT: %.loc7_35.8.d = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 1, !dbg !7 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @struct.2.loc7_36, i64 8, i1 false), !dbg !9 +// CHECK:STDOUT: ret void, !dbg !9 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: define void @_CCreateAdapter.Create(ptr sret({ { i32 }, i32 }) %return) !dbg !10 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CCreateDerived.Create(ptr %return), !dbg !11 +// CHECK:STDOUT: ret void, !dbg !12 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "create.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "CreateDerived", linkageName: "_CCreateDerived.Create", scope: null, file: !3, line: 6, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = !DILocation(line: 7, column: 10, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 7, column: 19, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 7, column: 3, scope: !4) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "CreateAdapter", linkageName: "_CCreateAdapter.Create", scope: null, file: !3, line: 10, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !11 = !DILocation(line: 11, column: 10, scope: !10) +// CHECK:STDOUT: !12 = !DILocation(line: 11, column: 3, scope: !10)