Add a location to indirect imports. (#4098)

By adding an `ImportDecl` instruction, this creates something that can
be referenced through `ImportIRInst`.
packages/no_prelude/implicit_imports_entities.carbon is getting a test
of this (import_conflict and import_conflict_reverse).

Also re-packs ImportIR from 24 bytes to 16 on 64-bit, since I'm touching
everywhere that makes one anyways.
This commit is contained in:
Jon Ross-Perkins
2024-07-03 17:34:39 +00:00
committed by GitHub
parent d437e4bffe
commit 5ebcbae2e8
488 changed files with 4158 additions and 2886 deletions
+6 -5
View File
@@ -33,10 +33,11 @@ var arr: [i32; Add(1, 2)];
// CHECK:STDOUT: .Add = %Add.decl
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -53,7 +54,7 @@ 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+3, loaded [template = constants.%Int32]
// 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]
@@ -25,10 +25,11 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Add = %Add.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -58,10 +58,11 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: .B = %B.decl.loc21
// CHECK:STDOUT: .C = %C.decl.loc31
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -78,9 +79,9 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+3, 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: %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]
@@ -97,9 +98,9 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref ir3, inst+3, 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: %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]
@@ -116,9 +117,9 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref ir3, inst+3, 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: %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]
@@ -135,9 +136,9 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref ir3, inst+3, 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: %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]
@@ -154,9 +155,9 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref ir3, inst+3, 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: %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]
@@ -26,7 +26,8 @@ fn UnknownBuiltin() = "unknown.builtin.name";
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .UnknownBuiltin = %UnknownBuiltin.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %UnknownBuiltin.decl: %UnknownBuiltin.type = fn_decl @UnknownBuiltin [template = constants.%UnknownBuiltin] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
+7 -6
View File
@@ -47,19 +47,20 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: .I = %I.decl
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+3, 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: %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]
@@ -120,7 +120,8 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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
@@ -84,7 +84,8 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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]
@@ -32,9 +32,10 @@ fn Run() {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
@@ -90,9 +90,10 @@ fn Main() {
// CHECK:STDOUT: .Run2 = %Run2.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// 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]
@@ -100,8 +101,8 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, 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: %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]
@@ -39,8 +39,9 @@ fn F() {
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -39,8 +39,9 @@ fn Run() {
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref ir3, inst+31, loaded [template = constants.%Float]
// 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]
@@ -49,7 +50,7 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type";
+5 -4
View File
@@ -35,9 +35,10 @@ fn Main() {
// CHECK:STDOUT: .Echo = %Echo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -50,7 +51,7 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
@@ -40,9 +40,10 @@ fn Main() {
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -56,7 +57,7 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
+3 -2
View File
@@ -33,8 +33,9 @@ fn Main() {
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -34,8 +34,9 @@ fn Main() {
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
+4 -3
View File
@@ -34,9 +34,10 @@ fn Main() {
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -35,9 +35,10 @@ fn Main() {
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -28,9 +28,10 @@ fn F(n: i32, a: [i32; n]*);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -31,9 +31,10 @@ fn F(n: i32, n: i32);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
+178 -154
View File
@@ -92,14 +92,13 @@ var e: () = NS.E();
library "merge";
import library "api";
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+65]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:4:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn A();
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE-7]]:1: In import.
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+59]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:4:1: Name is previously declared here.
@@ -107,12 +106,12 @@ import library "api";
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+52]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:5:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn B(b: i32) -> i32;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE-20]]:1: In import.
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+46]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:5:1: Name is previously declared here.
@@ -120,12 +119,12 @@ import library "api";
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+39]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:6:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32};
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE-33]]:1: In import.
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+33]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:6:1: Name is previously declared here.
@@ -133,12 +132,12 @@ import library "api";
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+26]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:7:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn D();
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE-46]]:1: In import.
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+20]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:7:1: Name is previously declared here.
@@ -146,18 +145,19 @@ import library "api";
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+13]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:10:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn NS.E();
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE-59]]:1: In import.
// CHECK:STDERR: fail_todo_merge.carbon:[[@LINE+7]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:10:1: Name is previously declared here.
// CHECK:STDERR: fn NS.E();
// CHECK:STDERR: ^~~~~~~~~~
// CHECK:STDERR:
import library "api";
import library "extern_api";
var a: () = A();
@@ -170,14 +170,13 @@ var e: () = NS.E();
library "merge_reverse";
import library "extern_api";
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+65]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:4:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: fn A();
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE-7]]:1: In import.
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+59]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:4:1: Name is previously declared here.
@@ -185,12 +184,12 @@ import library "extern_api";
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+52]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:5:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: fn B(b: i32) -> i32;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE-20]]:1: In import.
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+46]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:5:1: Name is previously declared here.
@@ -198,12 +197,12 @@ import library "extern_api";
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+39]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:6:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32};
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE-33]]:1: In import.
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+33]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:6:1: Name is previously declared here.
@@ -211,12 +210,12 @@ import library "extern_api";
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+26]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:7:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn D();
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE-46]]:1: In import.
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+20]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:7:1: Name is previously declared here.
@@ -224,18 +223,19 @@ import library "extern_api";
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+13]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:10:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: fn NS.E();
// CHECK:STDERR: ^~~~~~~~~~
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE-59]]:1: In import.
// CHECK:STDERR: fail_todo_merge_reverse.carbon:[[@LINE+7]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:10:1: Name is previously declared here.
// CHECK:STDERR: extern fn NS.E();
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR:
import library "extern_api";
import library "api";
var a: () = A();
@@ -300,14 +300,13 @@ import library "extern_api";
library "loaded_merge";
import library "api";
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+64]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:4:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn A();
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE-7]]:1: In import.
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+58]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:4:1: Name is previously declared here.
@@ -315,12 +314,12 @@ import library "api";
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+51]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:5:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn B(b: i32) -> i32;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE-20]]:1: In import.
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+45]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:5:1: Name is previously declared here.
@@ -328,12 +327,12 @@ import library "api";
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+38]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:6:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32};
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE-33]]:1: In import.
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+32]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:6:1: Name is previously declared here.
@@ -341,12 +340,12 @@ import library "api";
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+25]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:7:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn D();
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE-46]]:1: In import.
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+19]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:7:1: Name is previously declared here.
@@ -354,17 +353,18 @@ import library "api";
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+12]]:1: In import.
// CHECK:STDERR: import library "extern_api";
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: extern_api.carbon:10:1: ERROR: Duplicate name being declared in the same scope.
// CHECK:STDERR: extern fn NS.E();
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE-59]]:1: In import.
// CHECK:STDERR: fail_todo_loaded_merge.carbon:[[@LINE+6]]:1: In import.
// CHECK:STDERR: import library "api";
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR: api.carbon:10:1: Name is previously declared here.
// CHECK:STDERR: fn NS.E();
// CHECK:STDERR: ^~~~~~~~~~
import library "api";
import library "extern_api";
// CHECK:STDOUT: --- api.carbon
@@ -397,10 +397,11 @@ import library "extern_api";
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, 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]
@@ -412,8 +413,8 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, 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: %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)
@@ -477,10 +478,11 @@ import library "extern_api";
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, 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]
@@ -492,8 +494,8 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, 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: %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)
@@ -563,27 +565,29 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+21, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+43, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+46, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+50, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// 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+3, loaded [template = constants.%Int32]
// 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]
@@ -675,19 +679,21 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+21, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+43, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+46, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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 = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+50, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+3, 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: %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]
@@ -699,8 +705,8 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+3, 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: %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)
@@ -721,13 +727,13 @@ 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+3, loaded [template = constants.%Int32]
// 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+3, loaded [template = constants.%Int32]
// 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]
@@ -819,19 +825,21 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+21, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+43, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+46, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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 = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+50, loaded [template = constants.%E]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref ir4, inst+3, 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: %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]
@@ -843,8 +851,8 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref ir4, inst+3, 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: %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)
@@ -865,13 +873,13 @@ 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+3, loaded [template = constants.%Int32]
// 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+3, loaded [template = constants.%Int32]
// 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]
@@ -962,32 +970,34 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+21, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+43, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+46, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+50, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+21, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+46, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// 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+3, loaded [template = constants.%Int32]
// 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]
@@ -1078,32 +1088,34 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2: %B.type = import_ref ir1, inst+21, loaded [template = constants.%B]
// CHECK:STDOUT: %import_ref.3: %C.type = import_ref ir1, inst+43, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+46, loaded [template = constants.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6: %E.type = import_ref ir1, inst+50, loaded [template = constants.%E]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+21, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+46, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// 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+3, loaded [template = constants.%Int32]
// 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]
@@ -1176,16 +1188,18 @@ import library "extern_api";
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+43, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+46, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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
@@ -1225,21 +1239,23 @@ import library "extern_api";
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+43, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+46, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// 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]
@@ -1280,16 +1296,18 @@ import library "extern_api";
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+43, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+46, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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
@@ -1318,16 +1336,18 @@ import library "extern_api";
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+43, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+46, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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
@@ -1341,16 +1361,18 @@ import library "extern_api";
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+43, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+46, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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
@@ -1364,20 +1386,22 @@ import library "extern_api";
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+43, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+46, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// 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: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+21, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+43, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+46, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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:
@@ -67,6 +67,7 @@ var f: () = F();
// 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: }
@@ -86,7 +87,8 @@ var f: () = F();
// CHECK:STDOUT: .F = %import_ref
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: %F.type = import_ref ir1, inst+6, loaded [template = constants.%F]
// 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
@@ -181,6 +181,7 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: .Call = %import_ref.7
// CHECK:STDOUT: .CallFAndGIncomplete = %CallFAndGIncomplete.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import = import <invalid>
// 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]
@@ -96,6 +96,8 @@ extern fn A();
// 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: }
@@ -134,6 +136,8 @@ extern fn A();
// 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: }
@@ -169,6 +173,8 @@ extern fn A();
// 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: }
@@ -100,6 +100,8 @@ fn D();
// 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] {}
@@ -122,6 +124,8 @@ fn D();
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %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:
@@ -148,6 +152,8 @@ fn D();
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .B = %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:
@@ -180,6 +186,8 @@ fn D();
// 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: }
@@ -204,6 +212,8 @@ fn D();
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
// CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -30,8 +30,9 @@ fn G(a: i32);
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -39,7 +40,7 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+4, loaded [template = constants.%Int32]
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
+37 -27
View File
@@ -122,10 +122,11 @@ fn D() {}
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, 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]
@@ -137,8 +138,8 @@ 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, 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: %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)
@@ -195,7 +196,8 @@ fn D() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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: }
// CHECK:STDOUT:
@@ -230,22 +232,24 @@ fn D() {}
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, 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+46, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+58, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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+3, loaded [template = constants.%Int32]
// 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+3, loaded [template = constants.%Int32]
// 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]
@@ -301,14 +305,16 @@ fn D() {}
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %A.type = import_ref ir1, inst+2, 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 = import_ref ir1, inst+46, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+58, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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 = 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+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir4, inst+3, loaded [template = constants.%Int32]
// 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: %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]
@@ -344,8 +350,10 @@ fn D() {}
// CHECK:STDOUT: .A = %A.decl.loc6
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: %A.type = import_ref ir1, inst+2, loaded [template = constants.%A]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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] {}
// CHECK:STDOUT: }
@@ -371,11 +379,13 @@ fn D() {}
// CHECK:STDOUT: .D = %D.decl.loc13
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+22, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+46, unloaded
// CHECK:STDOUT: %import_ref.4: %D.type = import_ref ir1, inst+58, loaded [template = constants.%D]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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] {}
// CHECK:STDOUT: }
@@ -148,7 +148,8 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Def [private] = %Def.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Def.decl: %Def.type = fn_decl @Def [template = constants.%Def] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -170,7 +171,8 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .ForwardWithDef [private] = %ForwardWithDef.decl.loc4
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %ForwardWithDef.decl.loc4: %ForwardWithDef.type = fn_decl @ForwardWithDef [template = constants.%ForwardWithDef] {}
// CHECK:STDOUT: %ForwardWithDef.decl.loc6: %ForwardWithDef.type = fn_decl @ForwardWithDef [template = constants.%ForwardWithDef] {}
// CHECK:STDOUT: }
@@ -193,7 +195,8 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Forward [private] = %Forward.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Forward.decl: %Forward.type = fn_decl @Forward [template = constants.%Forward] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -213,8 +216,11 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: %Def.type = import_ref ir0, inst+2, loaded [template = constants.%Def]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -242,7 +248,9 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -268,8 +276,10 @@ private fn Redecl() {}
// CHECK:STDOUT: .Test = %Test
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Test: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Test.import = import Test
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Test: <namespace> = namespace %Test.import, [template] {}
// CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -298,8 +308,11 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: %ForwardWithDef.type = import_ref ir0, inst+2, loaded [template = constants.%ForwardWithDef]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -327,7 +340,9 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -353,8 +368,10 @@ private fn Redecl() {}
// CHECK:STDOUT: .Test = %Test
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Test: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Test.import = import Test
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Test: <namespace> = namespace %Test.import, [template] {}
// CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -383,8 +400,11 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: %Forward.type = import_ref ir0, inst+2, loaded [template = constants.%Forward]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// 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]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -416,7 +436,9 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %default.import = import <invalid>
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -442,8 +464,10 @@ private fn Redecl() {}
// CHECK:STDOUT: .Test = %Test
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Test: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Test.import = import Test
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Test: <namespace> = namespace %Test.import, [template] {}
// CHECK:STDOUT: %.loc9_9.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc9_9.2: type = converted %.loc9_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %f.var: ref %.1 = var f
@@ -471,7 +495,8 @@ private fn Redecl() {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Redecl [private] = %Redecl.decl.loc4
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %Redecl.decl.loc4: %Redecl.type = fn_decl @Redecl [template = constants.%Redecl] {}
// CHECK:STDOUT: %Redecl.decl.loc6: %Redecl.type = fn_decl @Redecl [template = constants.%Redecl] {}
// CHECK:STDOUT: }
@@ -153,6 +153,8 @@ fn B() {}
// 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: }
@@ -191,6 +193,8 @@ fn B() {}
// 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: }
@@ -229,6 +233,8 @@ fn B() {}
// 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: }
@@ -270,6 +276,8 @@ fn B() {}
// 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: }
@@ -308,6 +316,8 @@ fn B() {}
// 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: }
@@ -352,6 +362,8 @@ fn B() {}
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %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] {}
@@ -25,8 +25,9 @@ fn Foo(a: i32) {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -25,8 +25,9 @@ fn Foo(a: i32,) {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -25,9 +25,10 @@ fn Foo(a: i32, b: i32) {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -25,9 +25,10 @@ fn Foo(a: i32, b: i32,) {}
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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,9 +29,10 @@ fn F(N:! i32, a: [i32; N]*);
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
+8 -4
View File
@@ -116,7 +116,8 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F.decl.loc4
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %T.loc4_6.1: type = param T
// CHECK:STDOUT: %T.loc4_6.2: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = constants.%T]
@@ -163,7 +164,8 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %T.loc4_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = constants.%T]
@@ -217,7 +219,8 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %T.loc4_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = constants.%T.1]
@@ -271,7 +274,8 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Core: <namespace> = namespace %Core.import, [template] {}
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %T.loc4_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = constants.%T.1]