Move import refs to their own block. (#4103)

This executes on a TODO in AddImportRef to add instructions to their own
block instead of the File block. This has an important consequence of
removing a pattern from InstBlockStack that added to blocks not
currently at the top, cleaning up an issue for ArrayStack. The delta
here is then mostly in different formatting of the import refs, a
consequence of the separation.
This commit is contained in:
Jon Ross-Perkins
2024-07-03 18:21:12 +00:00
committed by GitHub
parent 00a1559c01
commit 9581a1867d
384 changed files with 5593 additions and 3769 deletions
+7 -4
View File
@@ -27,6 +27,13 @@ var arr: [i32; Add(1, 2)];
// CHECK:STDOUT: %.6: type = ptr_type %.5 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -35,9 +42,6 @@ var arr: [i32; Add(1, 2)];
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
@@ -54,7 +58,6 @@ var arr: [i32; Add(1, 2)];
// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32]
// CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add]
// CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.2]
@@ -20,6 +20,12 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: %Add: %Add.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -27,9 +33,6 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
@@ -51,6 +51,27 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: %C: %C.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -60,9 +81,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %A.decl.loc11: %A.type = fn_decl @A [template = constants.%A] {
// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32]
@@ -79,9 +97,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11_25, %.loc11_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc11: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %A.decl.loc19: %A.type = fn_decl @A [template = constants.%A] {
// CHECK:STDOUT: %int.make_type_32.loc19_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_32.loc19_9 [template = i32]
@@ -98,9 +113,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32]
// CHECK:STDOUT: @A.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %B.decl.loc21: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %int.make_type_32.loc21_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc21_9.1: type = value_of_initializer %int.make_type_32.loc21_9 [template = i32]
@@ -117,9 +129,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: %.loc21_25.2: type = converted %int.make_type_32.loc21_25, %.loc21_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc21: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %B.decl.loc29: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %int.make_type_32.loc29_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc29_9.1: type = value_of_initializer %int.make_type_32.loc29_9 [template = i32]
@@ -136,9 +145,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: %.loc29_25.2: type = converted %int.make_type_32.loc29_25, %.loc29_25.1 [template = i32]
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %C.decl.loc31: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %int.make_type_32.loc31_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc31_9.1: type = value_of_initializer %int.make_type_32.loc31_9 [template = i32]
@@ -155,9 +161,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: %.loc31_25.2: type = converted %int.make_type_32.loc31_25, %.loc31_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc31: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %C.decl.loc38: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %int.make_type_32.loc38_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc38_9.1: type = value_of_initializer %int.make_type_32.loc38_9 [template = i32]
+8 -5
View File
@@ -41,6 +41,14 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: %.11: type = ptr_type %.10 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -50,17 +58,12 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32.loc15, %.loc15_6.1 [template = i32]
// CHECK:STDOUT: %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc19_16: i32 = int_literal 1 [template = constants.%.6]
// CHECK:STDOUT: %I.ref.loc19: type = name_ref I, %I.decl [template = constants.%.1]
@@ -102,7 +102,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: type = assoc_entity_type @Add, %Op.type.2 [template]
// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, file.%import_ref.8 [template]
// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template]
// CHECK:STDOUT: %.8: <bound method> = bound_method %.4, %Op.1 [template]
// CHECK:STDOUT: %.9: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.10: type = array_type %.9, i32 [template]
@@ -115,6 +115,18 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %array: %.10 = tuple_value (%.9, %.12, %.14) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+8, unloaded
// CHECK:STDOUT: %import_ref.4: %.6 = import_ref ir1, inst+28, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref ir1, inst+24, loaded [template = constants.%Op.2]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+24, unloaded
// CHECK:STDOUT: %import_ref.9: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -122,24 +134,16 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+8, unloaded
// CHECK:STDOUT: %import_ref.4: %.6 = import_ref ir1, inst+28, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref ir1, inst+24, loaded [template = constants.%Op.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32]
// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32.loc6, %.loc6_6.1 [template = i32]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.2 [template = constants.%.2]
// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.2 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+24, unloaded
// CHECK:STDOUT: %.1: %Op.type.2 = interface_witness_access @impl.%.1, element0 [template = constants.%Op.1]
// CHECK:STDOUT: %.loc10_18: <bound method> = bound_method %.loc10_16, %.1 [template = constants.%.8]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18(%.loc10_16, %.loc10_20) [template = constants.%.9]
@@ -148,14 +152,13 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.10]
// CHECK:STDOUT: %arr.var: ref %.10 = var arr
// CHECK:STDOUT: %arr: ref %.10 = bind_name arr, %arr.var
// CHECK:STDOUT: %import_ref.9: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Add {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = file.%import_ref.3
// CHECK:STDOUT: .Op = file.%import_ref.4
// CHECK:STDOUT: witness = (file.%import_ref.5)
// CHECK:STDOUT: .Self = imports.%import_ref.3
// CHECK:STDOUT: .Op = imports.%import_ref.4
// CHECK:STDOUT: witness = (imports.%import_ref.5)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: i32 as %.2 {
@@ -79,6 +79,11 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: %array: %.5 = tuple_value (%.2, %.3, %.4) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref ir1, inst+20, loaded [template = constants.%TestAdd]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -86,11 +91,9 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir1, inst+2, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref ir1, inst+20, loaded [template = constants.%TestAdd]
// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, %import_ref.2 [template = constants.%TestAdd]
// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.2 [template = constants.%TestAdd]
// CHECK:STDOUT: %.loc4_29: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_32: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %int.sadd: init i32 = call %TestAdd.ref(%.loc4_29, %.loc4_32) [template = constants.%.4]
@@ -27,6 +27,10 @@ fn Run() {
// CHECK:STDOUT: %.3: String = string_literal "hello" [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -35,7 +39,6 @@ fn Run() {
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
@@ -82,6 +82,12 @@ fn Main() {
// CHECK:STDOUT: %.3: i32 = int_literal 0 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -93,7 +99,6 @@ fn Main() {
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Run0.decl: %Run0.type = fn_decl @Run0 [template = constants.%Run0] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Run1.decl: %Run1.type = fn_decl @Run1 [template = constants.%Run1] {
// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc12_12.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32]
@@ -101,8 +106,6 @@ fn Main() {
// CHECK:STDOUT: %a.loc12_9.1: i32 = param a
// CHECK:STDOUT: @Run1.%a: i32 = bind_name a, %a.loc12_9.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Run2.decl: %Run2.type = fn_decl @Run2 [template = constants.%Run2] {
// CHECK:STDOUT: %int.make_type_32.loc13_12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_12.1: type = value_of_initializer %int.make_type_32.loc13_12 [template = i32]
@@ -33,6 +33,10 @@ fn F() {
// CHECK:STDOUT: %.2: f64 = float_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -41,7 +45,6 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
@@ -33,6 +33,11 @@ fn Run() {
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -41,7 +46,6 @@ fn Run() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+32, loaded [template = constants.%Float]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %.loc11_13.1: i32 = int_literal 64 [template = constants.%.1]
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64]
@@ -50,7 +54,6 @@ fn Run() {
// CHECK:STDOUT: @Foo.%return: ref f64 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {}
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type";
+6 -3
View File
@@ -29,6 +29,12 @@ fn Main() {
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -37,8 +43,6 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] {
// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32]
@@ -51,7 +55,6 @@ fn Main() {
// CHECK:STDOUT: @Echo.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {}
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
@@ -34,6 +34,12 @@ fn Main() {
// CHECK:STDOUT: %.6: i32 = int_literal 6 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -42,8 +48,6 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
@@ -57,7 +61,6 @@ fn Main() {
// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc11_16.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {}
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
+4 -1
View File
@@ -27,6 +27,10 @@ fn Main() {
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -35,7 +39,6 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
@@ -28,6 +28,10 @@ fn Main() {
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -36,7 +40,6 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
+5 -2
View File
@@ -28,6 +28,11 @@ fn Main() {
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -36,8 +41,6 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
@@ -29,6 +29,11 @@ fn Main() {
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -37,8 +42,6 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
@@ -23,6 +23,11 @@ fn F(n: i32, a: [i32; n]*);
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -30,8 +35,6 @@ fn F(n: i32, a: [i32; n]*);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32]
@@ -26,6 +26,11 @@ fn F(n: i32, n: i32);
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -33,8 +38,6 @@ fn F(n: i32, n: i32);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32.loc17_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc17_9.1: type = value_of_initializer %int.make_type_32.loc17_9 [template = i32]
+219 -180
View File
@@ -388,6 +388,13 @@ import library "extern_api";
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -400,8 +407,6 @@ import library "extern_api";
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32]
@@ -413,8 +418,6 @@ import library "extern_api";
// CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32]
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc6_14.1: %.2 = tuple_literal (%int.make_type_32.loc6_10)
@@ -469,6 +472,13 @@ import library "extern_api";
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -481,8 +491,6 @@ import library "extern_api";
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %int.make_type_32.loc5_16: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc5_16.1: type = value_of_initializer %int.make_type_32.loc5_16 [template = i32]
@@ -494,8 +502,6 @@ import library "extern_api";
// CHECK:STDOUT: %.loc5_24.2: type = converted %int.make_type_32.loc5_24, %.loc5_24.1 [template = i32]
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %int.make_type_32.loc6_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc6_21.1: %.2 = tuple_literal (%int.make_type_32.loc6_17)
@@ -551,12 +557,22 @@ import library "extern_api";
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
@@ -567,27 +583,20 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref %.1 = var a
// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32]
// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32]
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32]
// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32]
@@ -618,25 +627,25 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.call: init %.1 = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc8_25: %.4 = tuple_literal (%.loc8_23)
// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc8_23) [template = constants.%tuple]
// CHECK:STDOUT: %.loc8_21: %.4 = converted %.loc8_25, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc8_21)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%import_ref.4 [template = constants.%D]
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D]
// CHECK:STDOUT: %D.call: init %.1 = call %D.ref()
// CHECK:STDOUT: assign file.%d.var, %D.call
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%import_ref.6 [template = constants.%E]
// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E]
// CHECK:STDOUT: %E.call: init %.1 = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -665,6 +674,20 @@ import library "extern_api";
// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
@@ -681,19 +704,12 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7_16 [template = i32]
@@ -705,8 +721,6 @@ import library "extern_api";
// CHECK:STDOUT: %.loc7_24.2: type = converted %int.make_type_32.loc7_24, %.loc7_24.1 [template = i32]
// CHECK:STDOUT: %return.var.loc7: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %int.make_type_32.loc8_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc8_21.1: %.2 = tuple_literal (%int.make_type_32.loc8_17)
@@ -727,13 +741,11 @@ import library "extern_api";
// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref %.1 = var a
// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32]
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b.loc13: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32]
// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14, %.loc14_13.1 [template = i32]
@@ -811,6 +823,20 @@ import library "extern_api";
// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
@@ -827,19 +853,12 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7_16 [template = i32]
@@ -851,8 +870,6 @@ import library "extern_api";
// CHECK:STDOUT: %.loc7_24.2: type = converted %int.make_type_32.loc7_24, %.loc7_24.1 [template = i32]
// CHECK:STDOUT: %return.var.loc7: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %int.make_type_32.loc8_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc8_21.1: %.2 = tuple_literal (%int.make_type_32.loc8_17)
@@ -873,13 +890,11 @@ import library "extern_api";
// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref %.1 = var a
// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_8.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
// CHECK:STDOUT: %.loc13_8.2: type = converted %int.make_type_32.loc13, %.loc13_8.1 [template = i32]
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b.loc13: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32]
// CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14, %.loc14_13.1 [template = i32]
@@ -956,12 +971,27 @@ import library "extern_api";
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+22, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+44, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+47, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+51, unloaded
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
@@ -972,32 +1002,20 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+22, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+44, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+47, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+51, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc72_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref %.1 = var a
// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc73: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc73_8.1: type = value_of_initializer %int.make_type_32.loc73 [template = i32]
// CHECK:STDOUT: %.loc73_8.2: type = converted %int.make_type_32.loc73, %.loc73_8.1 [template = i32]
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc74: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc74_13.1: type = value_of_initializer %int.make_type_32.loc74 [template = i32]
// CHECK:STDOUT: %.loc74_13.2: type = converted %int.make_type_32.loc74, %.loc74_13.1 [template = i32]
@@ -1028,25 +1046,25 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.call: init %.1 = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %.loc73: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc73)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %.loc74_23: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc74_25: %.4 = tuple_literal (%.loc74_23)
// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc74_23) [template = constants.%tuple]
// CHECK:STDOUT: %.loc74_21: %.4 = converted %.loc74_25, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc74_21)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%import_ref.4 [template = constants.%D]
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D]
// CHECK:STDOUT: %D.call: init %.1 = call %D.ref()
// CHECK:STDOUT: assign file.%d.var, %D.call
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%import_ref.6 [template = constants.%E]
// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E]
// CHECK:STDOUT: %E.call: init %.1 = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -1074,12 +1092,27 @@ import library "extern_api";
// CHECK:STDOUT: %E: %E.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+22, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+44, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+47, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+51, unloaded
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
@@ -1090,32 +1123,20 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+22, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+44, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+47, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+51, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+22, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+44, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+47, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+51, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc72_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref %.1 = var a
// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc73: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc73_8.1: type = value_of_initializer %int.make_type_32.loc73 [template = i32]
// CHECK:STDOUT: %.loc73_8.2: type = converted %int.make_type_32.loc73, %.loc73_8.1 [template = i32]
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref ir5, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc74: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc74_13.1: type = value_of_initializer %int.make_type_32.loc74 [template = i32]
// CHECK:STDOUT: %.loc74_13.2: type = converted %int.make_type_32.loc74, %.loc74_13.1 [template = i32]
@@ -1146,25 +1167,25 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.call: init %.1 = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %.loc73: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc73)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %.loc74_23: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc74_25: %.4 = tuple_literal (%.loc74_23)
// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc74_23) [template = constants.%tuple]
// CHECK:STDOUT: %.loc74_21: %.4 = converted %.loc74_25, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %C.call: init %.3 = call %C.ref(%.loc74_21)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%import_ref.4 [template = constants.%D]
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D]
// CHECK:STDOUT: %D.call: init %.1 = call %D.ref()
// CHECK:STDOUT: assign file.%d.var, %D.call
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%import_ref.6 [template = constants.%E]
// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E]
// CHECK:STDOUT: %E.call: init %.1 = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -1178,27 +1199,30 @@ import library "extern_api";
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
@@ -1211,7 +1235,7 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.call: init %.1 = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: return
@@ -1229,33 +1253,36 @@ import library "extern_api";
// CHECK:STDOUT: %.2: %.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref %.1 = var a
// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
@@ -1272,7 +1299,7 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.call: init %.1 = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: return
@@ -1286,27 +1313,30 @@ import library "extern_api";
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
@@ -1319,7 +1349,7 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.call: init %.1 = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: return
@@ -1327,81 +1357,90 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: --- unloaded.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- unloaded_extern.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_todo_loaded_merge.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+22, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+44, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+47, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+51, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+44, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: %import_ref: <namespace> = import_ref ir1, inst+50, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref, [template] {
// CHECK:STDOUT: .E = imports.%import_ref.5
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+51, unloaded
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+22, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+44, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+47, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+51, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -63,13 +63,16 @@ var f: () = F();
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+1, loaded [template = constants.%F]
// CHECK:STDOUT: %F: %F.type = export F, %import_ref [template = constants.%F]
// CHECK:STDOUT: %F: %F.type = export F, imports.%import_ref [template = constants.%F]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F();
@@ -82,13 +85,16 @@ var f: () = F();
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+7, loaded [template = constants.%F]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %import_ref
// CHECK:STDOUT: .F = imports.%import_ref
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+7, loaded [template = constants.%F]
// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -99,7 +105,7 @@ var f: () = F();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%import_ref [template = constants.%F]
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref [template = constants.%F]
// CHECK:STDOUT: %F.call: init %.1 = call %F.ref()
// CHECK:STDOUT: assign file.%f.var, %F.call
// CHECK:STDOUT: return
@@ -170,18 +170,7 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: %ReturnDUsed: %ReturnDUsed.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .C = %import_ref.1
// CHECK:STDOUT: .D = %import_ref.2
// CHECK:STDOUT: .ReturnCUnused = %import_ref.3
// CHECK:STDOUT: .ReturnCUsed = %import_ref.4
// CHECK:STDOUT: .ReturnDUnused = %import_ref.5
// CHECK:STDOUT: .ReturnDUsed = %import_ref.6
// CHECK:STDOUT: .Call = %import_ref.7
// CHECK:STDOUT: .CallFAndGIncomplete = %CallFAndGIncomplete.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3: %ReturnCUnused.type = import_ref ir1, inst+7, loaded [template = constants.%ReturnCUnused]
@@ -189,28 +178,42 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: %import_ref.5: %ReturnDUnused.type = import_ref ir1, inst+18, loaded [template = constants.%ReturnDUnused]
// CHECK:STDOUT: %import_ref.6: %ReturnDUsed.type = import_ref ir1, inst+23, loaded [template = constants.%ReturnDUsed]
// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %CallFAndGIncomplete.decl: %CallFAndGIncomplete.type = fn_decl @CallFAndGIncomplete [template = constants.%CallFAndGIncomplete] {}
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+4, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .C = imports.%import_ref.1
// CHECK:STDOUT: .D = imports.%import_ref.2
// CHECK:STDOUT: .ReturnCUnused = imports.%import_ref.3
// CHECK:STDOUT: .ReturnCUsed = imports.%import_ref.4
// CHECK:STDOUT: .ReturnDUnused = imports.%import_ref.5
// CHECK:STDOUT: .ReturnDUsed = imports.%import_ref.6
// CHECK:STDOUT: .Call = imports.%import_ref.7
// CHECK:STDOUT: .CallFAndGIncomplete = %CallFAndGIncomplete.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %CallFAndGIncomplete.decl: %CallFAndGIncomplete.type = fn_decl @CallFAndGIncomplete [template = constants.%CallFAndGIncomplete] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C;
// CHECK:STDOUT:
// CHECK:STDOUT: class @D {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = file.%import_ref.8
// CHECK:STDOUT: .Self = imports.%import_ref.8
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallFAndGIncomplete() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %ReturnCUnused.ref: %ReturnCUnused.type = name_ref ReturnCUnused, file.%import_ref.3 [template = constants.%ReturnCUnused]
// CHECK:STDOUT: %ReturnCUnused.ref: %ReturnCUnused.type = name_ref ReturnCUnused, imports.%import_ref.3 [template = constants.%ReturnCUnused]
// CHECK:STDOUT: %ReturnCUnused.call: init <error> = call %ReturnCUnused.ref()
// CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, file.%import_ref.4 [template = constants.%ReturnCUsed]
// CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, imports.%import_ref.4 [template = constants.%ReturnCUsed]
// CHECK:STDOUT: %ReturnCUsed.call: init <error> = call %ReturnCUsed.ref()
// CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, file.%import_ref.5 [template = constants.%ReturnDUnused]
// CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, imports.%import_ref.5 [template = constants.%ReturnDUnused]
// CHECK:STDOUT: %.loc24_16.1: ref %D = temporary_storage
// CHECK:STDOUT: %ReturnDUnused.call: init %D = call %ReturnDUnused.ref() to %.loc24_16.1
// CHECK:STDOUT: %.loc24_16.2: ref %D = temporary %.loc24_16.1, %ReturnDUnused.call
// CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, file.%import_ref.6 [template = constants.%ReturnDUsed]
// CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%import_ref.6 [template = constants.%ReturnDUsed]
// CHECK:STDOUT: %ReturnDUsed.call: init <error> = call %ReturnDUsed.ref()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -92,13 +92,16 @@ extern fn A();
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -132,13 +135,16 @@ extern fn A();
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -169,13 +175,16 @@ extern fn A();
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -96,13 +96,16 @@ fn D();
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl.loc4
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl.loc4: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %A.decl.loc6: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
@@ -120,13 +123,16 @@ fn D();
// CHECK:STDOUT:
// CHECK:STDOUT: --- use_decl_in_api.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref
// CHECK:STDOUT: .A = imports.%import_ref
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- decl_only_in_api.carbon
@@ -148,13 +154,16 @@ fn D();
// CHECK:STDOUT:
// CHECK:STDOUT: --- decl_only_in_api.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref = import_ref ir0, inst+1, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .B = %import_ref
// CHECK:STDOUT: .B = imports.%import_ref
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref = import_ref ir0, inst+1, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- decl_in_api_decl_in_impl.carbon
@@ -182,13 +191,16 @@ fn D();
// CHECK:STDOUT: %C: %C.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %C.type = import_ref ir0, inst+1, loaded [template = constants.%C]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %C.type = import_ref ir0, inst+1, loaded [template = constants.%C]
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -24,6 +24,11 @@ fn G(a: i32);
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -32,7 +37,6 @@ fn G(a: i32);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32]
@@ -40,7 +44,6 @@ fn G(a: i32);
// CHECK:STDOUT: %a.loc11_6.1: i32 = param a
// CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc11_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
+52 -37
View File
@@ -114,6 +114,13 @@ fn D() {}
// CHECK:STDOUT: %D: %D.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -125,8 +132,6 @@ fn D() {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32]
@@ -138,8 +143,6 @@ fn D() {}
// CHECK:STDOUT: %.loc5_17.2: type = converted %int.make_type_32.loc5_17, %.loc5_17.1 [template = i32]
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc6_14.1: %.2 = tuple_literal (%int.make_type_32.loc6_10)
@@ -221,12 +224,21 @@ fn D() {}
// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.2) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+23, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+47, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+59, unloaded
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .b = %b
@@ -234,22 +246,16 @@ fn D() {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+23, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+47, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+59, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref %.1 = var a
// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc7_8.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32]
// CHECK:STDOUT: %.loc7_8.2: type = converted %int.make_type_32.loc7, %.loc7_8.1 [template = i32]
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32]
// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32]
@@ -268,14 +274,14 @@ fn D() {}
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A]
// CHECK:STDOUT: %A.call: init %.1 = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B]
// CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C]
// CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc8_25: %.4 = tuple_literal (%.loc8_23)
// CHECK:STDOUT: %tuple: %.4 = tuple_value (%.loc8_23) [template = constants.%tuple]
@@ -297,24 +303,27 @@ fn D() {}
// CHECK:STDOUT: %B: %B.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+23, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+59, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = imports.%import_ref.4
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %int.make_type_32.loc27_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc27_9.1: type = value_of_initializer %int.make_type_32.loc27_9 [template = i32]
@@ -345,6 +354,10 @@ fn D() {}
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl.loc6
@@ -352,7 +365,6 @@ fn D() {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir1, inst+3, loaded [template = constants.%A]
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %A.decl.loc6: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: %A.decl.loc7: %A.type = fn_decl @A [template = constants.%A] {}
@@ -371,20 +383,23 @@ fn D() {}
// CHECK:STDOUT: %D: %D.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+59, loaded [template = constants.%D]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: .C = imports.%import_ref.3
// CHECK:STDOUT: .D = %D.decl.loc13
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+47, unloaded
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+59, loaded [template = constants.%D]
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %D.decl.loc6: %D.type = fn_decl @D [template = constants.%D] {}
// CHECK:STDOUT: %D.decl.loc13: %D.type = fn_decl @D [template = constants.%D] {}
@@ -210,16 +210,19 @@ private fn Redecl() {}
// CHECK:STDOUT: %Def: %Def.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Def.type = import_ref ir0, inst+3, loaded [template = constants.%Def]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Def [private] = %import_ref
// CHECK:STDOUT: .Def [private] = imports.%import_ref
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %Test.import = import Test
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %import_ref: %Def.type = import_ref ir0, inst+3, loaded [template = constants.%Def]
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1]
@@ -231,7 +234,7 @@ private fn Redecl() {}
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Def.ref: %Def.type = name_ref Def, file.%import_ref [template = constants.%Def]
// CHECK:STDOUT: %Def.ref: %Def.type = name_ref Def, imports.%import_ref [template = constants.%Def]
// CHECK:STDOUT: %Def.call: init %.1 = call %Def.ref()
// CHECK:STDOUT: assign file.%f.var, %Def.call
// CHECK:STDOUT: return
@@ -302,16 +305,19 @@ private fn Redecl() {}
// CHECK:STDOUT: %ForwardWithDef: %ForwardWithDef.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %ForwardWithDef.type = import_ref ir0, inst+3, loaded [template = constants.%ForwardWithDef]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .ForwardWithDef [private] = %import_ref
// CHECK:STDOUT: .ForwardWithDef [private] = imports.%import_ref
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %Test.import = import Test
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %import_ref: %ForwardWithDef.type = import_ref ir0, inst+3, loaded [template = constants.%ForwardWithDef]
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1]
@@ -323,7 +329,7 @@ private fn Redecl() {}
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %ForwardWithDef.ref: %ForwardWithDef.type = name_ref ForwardWithDef, file.%import_ref [template = constants.%ForwardWithDef]
// CHECK:STDOUT: %ForwardWithDef.ref: %ForwardWithDef.type = name_ref ForwardWithDef, imports.%import_ref [template = constants.%ForwardWithDef]
// CHECK:STDOUT: %ForwardWithDef.call: init %.1 = call %ForwardWithDef.ref()
// CHECK:STDOUT: assign file.%f.var, %ForwardWithDef.call
// CHECK:STDOUT: return
@@ -394,6 +400,10 @@ private fn Redecl() {}
// CHECK:STDOUT: %Forward: %Forward.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Forward.type = import_ref ir0, inst+3, loaded [template = constants.%Forward]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Forward [private] = %Forward.decl
@@ -403,7 +413,6 @@ private fn Redecl() {}
// CHECK:STDOUT: %Test.import = import Test
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %import_ref: %Forward.type = import_ref ir0, inst+3, loaded [template = constants.%Forward]
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1]
@@ -419,7 +428,7 @@ private fn Redecl() {}
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Forward.ref: %Forward.type = name_ref Forward, file.%import_ref [template = constants.%Forward]
// CHECK:STDOUT: %Forward.ref: %Forward.type = name_ref Forward, imports.%import_ref [template = constants.%Forward]
// CHECK:STDOUT: %Forward.call: init %.1 = call %Forward.ref()
// CHECK:STDOUT: assign file.%f.var, %Forward.call
// CHECK:STDOUT: return
@@ -149,13 +149,16 @@ fn B() {}
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -189,13 +192,16 @@ fn B() {}
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -229,13 +235,16 @@ fn B() {}
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -272,13 +281,16 @@ fn B() {}
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -312,13 +324,16 @@ fn B() {}
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir0, inst+1, loaded [template = constants.%A]
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -357,15 +372,18 @@ fn B() {}
// CHECK:STDOUT: %.2: %.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: %A.type = import_ref ir0, inst+6, loaded [template = constants.%A]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .A = imports.%import_ref.1
// CHECK:STDOUT: .B = imports.%import_ref.2
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %import_ref.1 = import_ref ir0, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: %A.type = import_ref ir0, inst+6, loaded [template = constants.%A]
// CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -20,6 +20,10 @@ fn Foo(a: i32) {}
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -27,7 +31,6 @@ fn Foo(a: i32) {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
@@ -20,6 +20,10 @@ fn Foo(a: i32,) {}
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -27,7 +31,6 @@ fn Foo(a: i32,) {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
@@ -20,6 +20,11 @@ fn Foo(a: i32, b: i32) {}
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -27,8 +32,6 @@ fn Foo(a: i32, b: i32) {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
@@ -20,6 +20,11 @@ fn Foo(a: i32, b: i32,) {}
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -27,8 +32,6 @@ fn Foo(a: i32, b: i32,) {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
@@ -24,6 +24,11 @@ fn F(N:! i32, a: [i32; N]*);
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
@@ -31,8 +36,6 @@ fn F(N:! i32, a: [i32; N]*);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32.loc14_10: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14_10 [template = i32]