Switch type literals to use builtin functions. (#3978)

Modifies the core package and literal handling to use factory functions
for standard type literals.

Updates function/builtin/import.carbon to stop depending on the prelude,
since it would list all the impls in the core file. Updates
alias/builtins.carbon to be failing (the type values cannot be aliased).
This commit is contained in:
Jon Ross-Perkins
2024-05-23 16:00:08 +00:00
committed by GitHub
parent 5c8fa6ad5c
commit 55300d1ebb
314 changed files with 12506 additions and 4323 deletions
+24 -4
View File
@@ -11,9 +11,11 @@ var arr: [i32; Add(1, 2)];
// CHECK:STDOUT: --- call.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Add: type = fn_type @Add [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Add = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Add: type = fn_type @Add [template]
// CHECK:STDOUT: %struct.2: Add = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.4: i32 = int_literal 3 [template]
@@ -28,21 +30,39 @@ var arr: [i32; Add(1, 2)];
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Add.decl: Add = fn_decl @Add [template = constants.%struct] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Add.decl: Add = fn_decl @Add [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc7_16.1
// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32]
// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32]
// CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Add.ref: Add = name_ref Add, %Add.decl [template = constants.%struct]
// CHECK:STDOUT: %import_ref.4: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %Add.ref: Add = name_ref Add, %Add.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc9_20: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc9_23: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc9_20, %.loc9_23) [template = constants.%.4]
// CHECK:STDOUT: %.loc9_11.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32]
// CHECK:STDOUT: %.loc9_11.2: type = converted %int.make_type_32.loc9, %.loc9_11.1 [template = i32]
// CHECK:STDOUT: %.loc9_25: type = array_type %int.sadd, i32 [template = constants.%.5]
// CHECK:STDOUT: %arr.var: ref [i32; 3] = var arr
// CHECK:STDOUT: %arr: ref [i32; 3] = bind_name arr, %arr.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
+19 -3
View File
@@ -9,9 +9,11 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: --- definition.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Add: type = fn_type @Add [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Add = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Add: type = fn_type @Add [template]
// CHECK:STDOUT: %struct.2: Add = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -20,14 +22,28 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: .Add = %Add.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Add.decl: Add = fn_decl @Add [template = constants.%struct] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Add.decl: Add = fn_decl @Add [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc7_16.1
// CHECK:STDOUT: %int.make_type_32.loc7_27: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_27.1: type = value_of_initializer %int.make_type_32.loc7_27 [template = i32]
// CHECK:STDOUT: %.loc7_27.2: type = converted %int.make_type_32.loc7_27, %.loc7_27.1 [template = i32]
// CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Add(%a: i32, %b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
@@ -36,13 +36,15 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: --- fail_redefined.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %struct.2: A = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -53,50 +55,124 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: .C = %C.decl.loc27
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.decl.loc7: A = fn_decl @A [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %A.decl.loc7: A = fn_decl @A [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_9.1: type = value_of_initializer %int.make_type_32.loc7_9 [template = i32]
// CHECK:STDOUT: %.loc7_9.2: type = converted %int.make_type_32.loc7_9, %.loc7_9.1 [template = i32]
// CHECK:STDOUT: %n.loc7_6.1: i32 = param n
// CHECK:STDOUT: %n.loc7_6.2: i32 = bind_name n, %n.loc7_6.1
// CHECK:STDOUT: %int.make_type_32.loc7_17: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_17.1: type = value_of_initializer %int.make_type_32.loc7_17 [template = i32]
// CHECK:STDOUT: %.loc7_17.2: type = converted %int.make_type_32.loc7_17, %.loc7_17.1 [template = i32]
// CHECK:STDOUT: %m.loc7_14.1: i32 = param m
// CHECK:STDOUT: %m.loc7_14.2: i32 = bind_name m, %m.loc7_14.1
// CHECK:STDOUT: %int.make_type_32.loc7_25: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_25.1: type = value_of_initializer %int.make_type_32.loc7_25 [template = i32]
// CHECK:STDOUT: %.loc7_25.2: type = converted %int.make_type_32.loc7_25, %.loc7_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc7: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.decl.loc15: A = fn_decl @A [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref.4: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.5: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.6: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %A.decl.loc15: A = fn_decl @A [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc15_9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15_9 [template = i32]
// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_32.loc15_9, %.loc15_9.1 [template = i32]
// CHECK:STDOUT: %n.loc15_6.1: i32 = param n
// CHECK:STDOUT: @A.%n: i32 = bind_name n, %n.loc15_6.1
// CHECK:STDOUT: %int.make_type_32.loc15_17: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc15_17.1: type = value_of_initializer %int.make_type_32.loc15_17 [template = i32]
// CHECK:STDOUT: %.loc15_17.2: type = converted %int.make_type_32.loc15_17, %.loc15_17.1 [template = i32]
// CHECK:STDOUT: %m.loc15_14.1: i32 = param m
// CHECK:STDOUT: @A.%m: i32 = bind_name m, %m.loc15_14.1
// CHECK:STDOUT: %int.make_type_32.loc15_25: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc15_25.1: type = value_of_initializer %int.make_type_32.loc15_25 [template = i32]
// CHECK:STDOUT: %.loc15_25.2: type = converted %int.make_type_32.loc15_25, %.loc15_25.1 [template = i32]
// CHECK:STDOUT: @A.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %B.decl.loc17: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.7: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.8: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.9: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %B.decl.loc17: B = fn_decl @B [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc17_9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc17_9.1: type = value_of_initializer %int.make_type_32.loc17_9 [template = i32]
// CHECK:STDOUT: %.loc17_9.2: type = converted %int.make_type_32.loc17_9, %.loc17_9.1 [template = i32]
// CHECK:STDOUT: %n.loc17_6.1: i32 = param n
// CHECK:STDOUT: %n.loc17_6.2: i32 = bind_name n, %n.loc17_6.1
// CHECK:STDOUT: %int.make_type_32.loc17_17: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc17_17.1: type = value_of_initializer %int.make_type_32.loc17_17 [template = i32]
// CHECK:STDOUT: %.loc17_17.2: type = converted %int.make_type_32.loc17_17, %.loc17_17.1 [template = i32]
// CHECK:STDOUT: %m.loc17_14.1: i32 = param m
// CHECK:STDOUT: %m.loc17_14.2: i32 = bind_name m, %m.loc17_14.1
// CHECK:STDOUT: %int.make_type_32.loc17_25: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc17_25.1: type = value_of_initializer %int.make_type_32.loc17_25 [template = i32]
// CHECK:STDOUT: %.loc17_25.2: type = converted %int.make_type_32.loc17_25, %.loc17_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc17: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %B.decl.loc25: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.10: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.11: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.12: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %B.decl.loc25: B = fn_decl @B [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc25_9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc25_9.1: type = value_of_initializer %int.make_type_32.loc25_9 [template = i32]
// CHECK:STDOUT: %.loc25_9.2: type = converted %int.make_type_32.loc25_9, %.loc25_9.1 [template = i32]
// CHECK:STDOUT: %n.loc25_6.1: i32 = param n
// CHECK:STDOUT: @B.%n: i32 = bind_name n, %n.loc25_6.1
// CHECK:STDOUT: %int.make_type_32.loc25_17: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc25_17.1: type = value_of_initializer %int.make_type_32.loc25_17 [template = i32]
// CHECK:STDOUT: %.loc25_17.2: type = converted %int.make_type_32.loc25_17, %.loc25_17.1 [template = i32]
// CHECK:STDOUT: %m.loc25_14.1: i32 = param m
// CHECK:STDOUT: @B.%m: i32 = bind_name m, %m.loc25_14.1
// CHECK:STDOUT: %int.make_type_32.loc25_25: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc25_25.1: type = value_of_initializer %int.make_type_32.loc25_25 [template = i32]
// CHECK:STDOUT: %.loc25_25.2: type = converted %int.make_type_32.loc25_25, %.loc25_25.1 [template = i32]
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl.loc27: C = fn_decl @C [template = constants.%struct.3] {
// CHECK:STDOUT: %import_ref.13: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.14: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.15: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %C.decl.loc27: C = fn_decl @C [template = constants.%struct.4] {
// CHECK:STDOUT: %int.make_type_32.loc27_9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc27_9.1: type = value_of_initializer %int.make_type_32.loc27_9 [template = i32]
// CHECK:STDOUT: %.loc27_9.2: type = converted %int.make_type_32.loc27_9, %.loc27_9.1 [template = i32]
// CHECK:STDOUT: %n.loc27_6.1: i32 = param n
// CHECK:STDOUT: %n.loc27_6.2: i32 = bind_name n, %n.loc27_6.1
// CHECK:STDOUT: %int.make_type_32.loc27_17: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc27_17.1: type = value_of_initializer %int.make_type_32.loc27_17 [template = i32]
// CHECK:STDOUT: %.loc27_17.2: type = converted %int.make_type_32.loc27_17, %.loc27_17.1 [template = i32]
// CHECK:STDOUT: %m.loc27_14.1: i32 = param m
// CHECK:STDOUT: %m.loc27_14.2: i32 = bind_name m, %m.loc27_14.1
// CHECK:STDOUT: %int.make_type_32.loc27_25: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc27_25.1: type = value_of_initializer %int.make_type_32.loc27_25 [template = i32]
// CHECK:STDOUT: %.loc27_25.2: type = converted %int.make_type_32.loc27_25, %.loc27_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc27: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl.loc34: C = fn_decl @C [template = constants.%struct.3] {
// CHECK:STDOUT: %import_ref.16: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.17: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.18: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %C.decl.loc34: C = fn_decl @C [template = constants.%struct.4] {
// CHECK:STDOUT: %int.make_type_32.loc34_9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc34_9.1: type = value_of_initializer %int.make_type_32.loc34_9 [template = i32]
// CHECK:STDOUT: %.loc34_9.2: type = converted %int.make_type_32.loc34_9, %.loc34_9.1 [template = i32]
// CHECK:STDOUT: %n.loc34_6.1: i32 = param n
// CHECK:STDOUT: @C.%n: i32 = bind_name n, %n.loc34_6.1
// CHECK:STDOUT: %int.make_type_32.loc34_17: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc34_17.1: type = value_of_initializer %int.make_type_32.loc34_17 [template = i32]
// CHECK:STDOUT: %.loc34_17.2: type = converted %int.make_type_32.loc34_17, %.loc34_17.1 [template = i32]
// CHECK:STDOUT: %m.loc34_14.1: i32 = param m
// CHECK:STDOUT: @C.%m: i32 = bind_name m, %m.loc34_14.1
// CHECK:STDOUT: %int.make_type_32.loc34_25: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc34_25.1: type = value_of_initializer %int.make_type_32.loc34_25 [template = i32]
// CHECK:STDOUT: %.loc34_25.2: type = converted %int.make_type_32.loc34_25, %.loc34_25.1 [template = i32]
// CHECK:STDOUT: @C.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A(%n: i32, %m: i32) -> i32 = "int.sadd" {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n
+29 -5
View File
@@ -24,11 +24,13 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %.3: type = assoc_entity_type @I, F [template]
// CHECK:STDOUT: %.4: <associated F in I> = assoc_entity element0, @I.%F.decl [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %F.2: type = fn_type @F.2 [template]
// CHECK:STDOUT: %struct.2: F = struct_value () [template]
// CHECK:STDOUT: %.5: <witness> = interface_witness (%struct.2) [template]
// CHECK:STDOUT: %struct.3: F = struct_value () [template]
// CHECK:STDOUT: %.5: <witness> = interface_witness (%struct.3) [template]
// CHECK:STDOUT: %.6: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.7: <bound method> = bound_method %.6, %struct.2 [template]
// CHECK:STDOUT: %.7: <bound method> = bound_method %.6, %struct.3 [template]
// CHECK:STDOUT: %.8: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.9: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.10: type = array_type %.9, i32 [template]
@@ -43,16 +45,27 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc11_6.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32]
// CHECK:STDOUT: %.loc11_6.2: type = converted %int.make_type_32.loc11, %.loc11_6.1 [template = i32]
// CHECK:STDOUT: %I.ref.loc11: type = name_ref I, %I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.5: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc15_16: i32 = int_literal 1 [template = constants.%.6]
// CHECK:STDOUT: %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.1]
// CHECK:STDOUT: %F.ref: <associated F in I> = name_ref F, @I.%.loc8_40 [template = constants.%.4]
// CHECK:STDOUT: %.1: F = interface_witness_access @impl.%.1, element0 [template = constants.%struct.2]
// CHECK:STDOUT: %.1: F = interface_witness_access @impl.%.1, element0 [template = constants.%struct.3]
// CHECK:STDOUT: %.loc15_17: <bound method> = bound_method %.loc15_16, %.1 [template = constants.%.7]
// CHECK:STDOUT: %.loc15_24: i32 = int_literal 2 [template = constants.%.8]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc15_17(%.loc15_16, %.loc15_24) [template = constants.%.9]
// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_32.loc15, %.loc15_11.1 [template = i32]
// CHECK:STDOUT: %.loc15_26: type = array_type %int.sadd, i32 [template = constants.%.10]
// CHECK:STDOUT: %arr.var: ref [i32; 3] = var arr
// CHECK:STDOUT: %arr: ref [i32; 3] = bind_name arr, %arr.var
@@ -85,11 +98,20 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: i32 as I {
// CHECK:STDOUT: %F.decl: F = fn_decl @F.2 [template = constants.%struct.2] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F.2 [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc12_14: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc12_14.1: type = value_of_initializer %int.make_type_32.loc12_14 [template = i32]
// CHECK:STDOUT: %.loc12_14.2: type = converted %int.make_type_32.loc12_14, %.loc12_14.1 [template = i32]
// CHECK:STDOUT: %self.loc12_8.1: i32 = param self
// CHECK:STDOUT: %self.loc12_8.2: i32 = bind_name self, %self.loc12_8.1
// CHECK:STDOUT: %int.make_type_32.loc12_26: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc12_26.1: type = value_of_initializer %int.make_type_32.loc12_26 [template = i32]
// CHECK:STDOUT: %.loc12_26.2: type = converted %int.make_type_32.loc12_26, %.loc12_26.1 [template = i32]
// CHECK:STDOUT: %other.loc12_19.1: i32 = param other
// CHECK:STDOUT: %other.loc12_19.2: i32 = bind_name other, %other.loc12_19.1
// CHECK:STDOUT: %int.make_type_32.loc12_34: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc12_34.1: type = value_of_initializer %int.make_type_32.loc12_34 [template = i32]
// CHECK:STDOUT: %.loc12_34.2: type = converted %int.make_type_32.loc12_34, %.loc12_34.1 [template = i32]
// CHECK:STDOUT: %return.var: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: <witness> = interface_witness (%F.decl) [template = constants.%.5]
@@ -101,5 +123,7 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.1[@I.%self.loc8_8.2: Self](@I.%other.loc8_20.2: Self) -> Self;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2[@impl.%self.loc12_8.2: i32](@impl.%other.loc12_19.2: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
@@ -84,24 +84,26 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: --- user.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @Add [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %.2: type = interface_type @Add [template]
// CHECK:STDOUT: %Self: Add = bind_symbolic_name Self 0 [symbolic]
// CHECK:STDOUT: %Op.1: type = fn_type @Op.1 [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Op = struct_value () [template]
// CHECK:STDOUT: %Op.2: type = fn_type @Op.2 [template]
// CHECK:STDOUT: %struct.2: Op = struct_value () [template]
// CHECK:STDOUT: %.3: <witness> = interface_witness (%struct.1) [template]
// CHECK:STDOUT: %Op.2: type = fn_type @Op.2 [template]
// CHECK:STDOUT: %struct.3: Op = struct_value () [template]
// CHECK:STDOUT: %.3: <witness> = interface_witness (%struct.2) [template]
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: type = assoc_entity_type @Add, Op [template]
// CHECK:STDOUT: %.7: <associated Op in Add> = assoc_entity element0, file.%import_ref.6 [template]
// CHECK:STDOUT: %.8: <bound method> = bound_method %.4, %struct.1 [template]
// CHECK:STDOUT: %.7: <associated Op in Add> = assoc_entity element0, file.%import_ref.8 [template]
// CHECK:STDOUT: %.8: <bound method> = bound_method %.4, %struct.2 [template]
// CHECK:STDOUT: %.9: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.10: type = array_type %.9, i32 [template]
// CHECK:STDOUT: %.11: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.12: i32 = int_literal 4 [template]
// CHECK:STDOUT: %.13: <bound method> = bound_method %.9, %struct.1 [template]
// CHECK:STDOUT: %.13: <bound method> = bound_method %.9, %struct.2 [template]
// CHECK:STDOUT: %.14: i32 = int_literal 7 [template]
// CHECK:STDOUT: %.15: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.16: i32 = int_literal 0 [template]
@@ -114,36 +116,44 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+6, loaded [template = constants.%.1]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+8, unloaded
// CHECK:STDOUT: %import_ref.3: <associated Op in Add> = import_ref ir1, inst+28, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir1, inst+24, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+8, unloaded
// CHECK:STDOUT: %import_ref.4: <associated Op in Add> = import_ref ir1, inst+28, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.5: Op = import_ref ir1, inst+24, loaded [template = constants.%struct.3]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32]
// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32.loc6, %.loc6_6.1 [template = i32]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.1]
// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.2 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: Int32 = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %import_ref.5: type = import_ref ir1, inst+6, loaded [template = constants.%.1]
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+24, unloaded
// CHECK:STDOUT: %.1: Op = interface_witness_access @impl.%.1, element0 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+24, unloaded
// CHECK:STDOUT: %.1: Op = interface_witness_access @impl.%.1, element0 [template = constants.%struct.2]
// CHECK:STDOUT: %.loc10_18: <bound method> = bound_method %.loc10_16, %.1 [template = constants.%.8]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18(%.loc10_16, %.loc10_20) [template = constants.%.9]
// CHECK:STDOUT: %.loc10_11.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32]
// CHECK:STDOUT: %.loc10_11.2: type = converted %int.make_type_32.loc10, %.loc10_11.1 [template = i32]
// CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.10]
// CHECK:STDOUT: %arr.var: ref [i32; 3] = var arr
// CHECK:STDOUT: %arr: ref [i32; 3] = bind_name arr, %arr.var
// CHECK:STDOUT: %import_ref.7: type = import_ref ir1, inst+6, loaded [template = constants.%.1]
// CHECK:STDOUT: %import_ref.9: type = import_ref ir1, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Add {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = file.%import_ref.2
// CHECK:STDOUT: .Op = file.%import_ref.3
// CHECK:STDOUT: witness = (file.%import_ref.4)
// CHECK:STDOUT: .Self = file.%import_ref.3
// CHECK:STDOUT: .Op = file.%import_ref.4
// CHECK:STDOUT: witness = (file.%import_ref.5)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: i32 as Add {
// CHECK:STDOUT: %Op.decl: Op = fn_decl @Op.1 [template = constants.%struct.1] {
// CHECK:STDOUT: %Op.decl: Op = fn_decl @Op.1 [template = constants.%struct.2] {
// CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, i32 [template = i32]
// CHECK:STDOUT: %self.loc7_9.1: i32 = param self
// CHECK:STDOUT: %self.loc7_9.2: i32 = bind_name self, %self.loc7_9.1
@@ -160,6 +170,8 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: witness = %.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Op.1[@impl.%self.loc7_9.2: i32](@impl.%other.loc7_21.2: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Op.2[%self: Self](%other: Self) -> Self;
@@ -170,7 +182,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %.loc10_29: i32 = int_literal 4 [template = constants.%.12]
// CHECK:STDOUT: %.loc10_32: i32 = int_literal 3 [template = constants.%.9]
// CHECK:STDOUT: %.loc10_36: i32 = int_literal 4 [template = constants.%.12]
// CHECK:STDOUT: %.1: Op = interface_witness_access @impl.%.1, element0 [template = constants.%struct.1]
// CHECK:STDOUT: %.1: Op = interface_witness_access @impl.%.1, element0 [template = constants.%struct.2]
// CHECK:STDOUT: %.loc10_34: <bound method> = bound_method %.loc10_32, %.1 [template = constants.%.13]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_34(%.loc10_32, %.loc10_36) [template = constants.%.14]
// CHECK:STDOUT: %.loc10_37.1: (i32, i32, i32) = tuple_literal (%.loc10_26, %.loc10_29, %int.sadd)
@@ -8,6 +8,7 @@
package Core library "test";
fn Int32() -> type = "int.make_type_32";
fn TestAdd(a: i32, b: i32) -> i32 = "int.sadd";
// --- use.carbon
@@ -19,32 +20,51 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: --- core.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %TestAdd: type = fn_type @TestAdd [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: TestAdd = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %TestAdd: type = fn_type @TestAdd [template]
// CHECK:STDOUT: %struct.2: TestAdd = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Int32 = %Int32.decl
// CHECK:STDOUT: .TestAdd = %TestAdd.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %TestAdd.decl: TestAdd = fn_decl @TestAdd [template = constants.%struct] {
// CHECK:STDOUT: %a.loc4_12.1: i32 = param a
// CHECK:STDOUT: @TestAdd.%a: i32 = bind_name a, %a.loc4_12.1
// CHECK:STDOUT: %b.loc4_20.1: i32 = param b
// CHECK:STDOUT: @TestAdd.%b: i32 = bind_name b, %b.loc4_20.1
// CHECK:STDOUT: %Int32.decl: Int32 = fn_decl @Int32 [template = constants.%struct.1] {
// CHECK:STDOUT: @Int32.%return: ref type = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %TestAdd.decl: TestAdd = fn_decl @TestAdd [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc5_15: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_32.loc5_15 [template = i32]
// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_32.loc5_15, %.loc5_15.1 [template = i32]
// CHECK:STDOUT: %a.loc5_12.1: i32 = param a
// CHECK:STDOUT: @TestAdd.%a: i32 = bind_name a, %a.loc5_12.1
// CHECK:STDOUT: %int.make_type_32.loc5_23: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_32.loc5_23 [template = i32]
// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_32.loc5_23, %.loc5_23.1 [template = i32]
// CHECK:STDOUT: %b.loc5_20.1: i32 = param b
// CHECK:STDOUT: @TestAdd.%b: i32 = bind_name b, %b.loc5_20.1
// CHECK:STDOUT: %int.make_type_32.loc5_31: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc5_31.1: type = value_of_initializer %int.make_type_32.loc5_31 [template = i32]
// CHECK:STDOUT: %.loc5_31.2: type = converted %int.make_type_32.loc5_31, %.loc5_31.1 [template = i32]
// CHECK:STDOUT: @TestAdd.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @TestAdd(%a: i32, %b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
// CHECK:STDOUT: --- use.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %TestAdd: type = fn_type @TestAdd [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: TestAdd = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %TestAdd: type = fn_type @TestAdd [template]
// CHECK:STDOUT: %struct.2: TestAdd = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.4: i32 = int_literal 3 [template]
@@ -61,17 +81,23 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %import_ref: TestAdd = import_ref ir2, inst+6, loaded [template = constants.%struct]
// CHECK:STDOUT: %TestAdd.ref: TestAdd = name_ref TestAdd, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %import_ref.2: TestAdd = import_ref ir1, inst+20, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %TestAdd.ref: TestAdd = name_ref TestAdd, %import_ref.2 [template = constants.%struct.2]
// CHECK:STDOUT: %.loc4_29: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_32: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %int.sadd: init i32 = call %TestAdd.ref(%.loc4_29, %.loc4_32) [template = constants.%.4]
// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32]
// CHECK:STDOUT: %.loc4_34: type = array_type %int.sadd, i32 [template = constants.%.5]
// CHECK:STDOUT: %arr.var: ref [i32; 3] = var arr
// CHECK:STDOUT: %arr: ref [i32; 3] = bind_name arr, %arr.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @TestAdd(%a: i32, %b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
@@ -16,7 +16,9 @@ fn Run() {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Run: type = fn_type @Run [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Run = struct_value () [template]
// CHECK:STDOUT: %struct.1: Run = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %.2: type = ptr_type String [template]
// CHECK:STDOUT: %.3: String = string_literal "hello" [template]
// CHECK:STDOUT: }
@@ -27,15 +29,21 @@ fn Run() {
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.1] {}
// CHECK:STDOUT: %import_ref: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc11_10.2: type = converted %int.make_type_32, %.loc11_10.1 [template = i32]
// CHECK:STDOUT: %x.var: ref i32 = var x
// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var
// CHECK:STDOUT: %.loc11: String = string_literal "hello" [template = constants.%.3]
// CHECK:STDOUT: %.loc11_16: String = string_literal "hello" [template = constants.%.3]
// CHECK:STDOUT: assign %x.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
@@ -66,12 +66,14 @@ fn Main() {
// CHECK:STDOUT: %Run0: type = fn_type @Run0 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Run0 = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %Run1: type = fn_type @Run1 [template]
// CHECK:STDOUT: %struct.2: Run1 = struct_value () [template]
// CHECK:STDOUT: %struct.3: Run1 = struct_value () [template]
// CHECK:STDOUT: %Run2: type = fn_type @Run2 [template]
// CHECK:STDOUT: %struct.3: Run2 = struct_value () [template]
// CHECK:STDOUT: %struct.4: Run2 = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.4: Main = struct_value () [template]
// CHECK:STDOUT: %struct.5: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 0 [template]
// CHECK:STDOUT: }
@@ -86,17 +88,29 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run0.decl: Run0 = fn_decl @Run0 [template = constants.%struct.1] {}
// CHECK:STDOUT: %Run1.decl: Run1 = fn_decl @Run1 [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %Run1.decl: Run1 = fn_decl @Run1 [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc8_12.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32]
// CHECK:STDOUT: %.loc8_12.2: type = converted %int.make_type_32.loc8, %.loc8_12.1 [template = i32]
// CHECK:STDOUT: %a.loc8_9.1: i32 = param a
// CHECK:STDOUT: @Run1.%a: i32 = bind_name a, %a.loc8_9.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Run2.decl: Run2 = fn_decl @Run2 [template = constants.%struct.3] {
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %Run2.decl: Run2 = fn_decl @Run2 [template = constants.%struct.4] {
// CHECK:STDOUT: %int.make_type_32.loc9_12: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc9_12.1: type = value_of_initializer %int.make_type_32.loc9_12 [template = i32]
// CHECK:STDOUT: %.loc9_12.2: type = converted %int.make_type_32.loc9_12, %.loc9_12.1 [template = i32]
// CHECK:STDOUT: %a.loc9_9.1: i32 = param a
// CHECK:STDOUT: @Run2.%a: i32 = bind_name a, %a.loc9_9.1
// CHECK:STDOUT: %int.make_type_32.loc9_20: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc9_20.1: type = value_of_initializer %int.make_type_32.loc9_20 [template = i32]
// CHECK:STDOUT: %.loc9_20.2: type = converted %int.make_type_32.loc9_20, %.loc9_20.1 [template = i32]
// CHECK:STDOUT: %b.loc9_17.1: i32 = param b
// CHECK:STDOUT: @Run2.%b: i32 = bind_name b, %b.loc9_17.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.4] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.5] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run0() {
@@ -104,6 +118,8 @@ fn Main() {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run1(%a: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -123,15 +139,15 @@ fn Main() {
// CHECK:STDOUT: %.loc27_8: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc27_11: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Run0.call.loc27: init () = call %Run0.ref.loc27(<invalid>) [template = <error>]
// CHECK:STDOUT: %Run1.ref.loc36: Run1 = name_ref Run1, file.%Run1.decl [template = constants.%struct.2]
// CHECK:STDOUT: %Run1.ref.loc36: Run1 = name_ref Run1, file.%Run1.decl [template = constants.%struct.3]
// CHECK:STDOUT: %Run1.call.loc36: init () = call %Run1.ref.loc36(<invalid>) [template = <error>]
// CHECK:STDOUT: %Run1.ref.loc44: Run1 = name_ref Run1, file.%Run1.decl [template = constants.%struct.2]
// CHECK:STDOUT: %Run1.ref.loc44: Run1 = name_ref Run1, file.%Run1.decl [template = constants.%struct.3]
// CHECK:STDOUT: %.loc44_8: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc44_11: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Run1.call.loc44: init () = call %Run1.ref.loc44(<invalid>) [template = <error>]
// CHECK:STDOUT: %Run2.ref.loc53: Run2 = name_ref Run2, file.%Run2.decl [template = constants.%struct.3]
// CHECK:STDOUT: %Run2.ref.loc53: Run2 = name_ref Run2, file.%Run2.decl [template = constants.%struct.4]
// CHECK:STDOUT: %Run2.call.loc53: init () = call %Run2.ref.loc53(<invalid>) [template = <error>]
// CHECK:STDOUT: %Run2.ref.loc60: Run2 = name_ref Run2, file.%Run2.decl [template = constants.%struct.3]
// CHECK:STDOUT: %Run2.ref.loc60: Run2 = name_ref Run2, file.%Run2.decl [template = constants.%struct.4]
// CHECK:STDOUT: %.loc60: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %Run2.call.loc60: init () = call %Run2.ref.loc60(<invalid>) [template = <error>]
// CHECK:STDOUT: return
@@ -19,11 +19,13 @@ fn F() {
// CHECK:STDOUT: --- fail_param_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %G: type = fn_type @G [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: G = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %G: type = fn_type @G [template]
// CHECK:STDOUT: %struct.2: G = struct_value () [template]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %struct.2: F = struct_value () [template]
// CHECK:STDOUT: %struct.3: F = struct_value () [template]
// CHECK:STDOUT: %.2: f64 = float_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -34,13 +36,19 @@ fn F() {
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc7_9.2: type = converted %int.make_type_32, %.loc7_9.1 [template = i32]
// CHECK:STDOUT: %a.loc7_6.1: i32 = param a
// CHECK:STDOUT: @G.%a: i32 = bind_name a, %a.loc7_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.3] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G(%a: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -48,7 +56,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %G.ref: G = name_ref G, file.%G.decl [template = constants.%struct.1]
// CHECK:STDOUT: %G.ref: G = name_ref G, file.%G.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc16: f64 = float_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %G.call: init () = call %G.ref(<invalid>) [template = <error>]
// CHECK:STDOUT: return
@@ -16,12 +16,17 @@ fn Run() {
// CHECK:STDOUT: --- fail_return_type_mismatch.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 64 [template]
// CHECK:STDOUT: %Float: type = fn_type @Float [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Float = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Foo = struct_value () [template]
// CHECK:STDOUT: %.2: f64 = float_literal 1 [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: %.3: f64 = float_literal 1 [template]
// CHECK:STDOUT: %Run: type = fn_type @Run [template]
// CHECK:STDOUT: %struct.2: Run = struct_value () [template]
// CHECK:STDOUT: %struct.3: Run = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.4: Int32 = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -31,25 +36,38 @@ fn Run() {
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref.1: Float = import_ref ir3, inst+31, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %.loc7_13.1: i32 = int_literal 64 [template = constants.%.1]
// CHECK:STDOUT: %float.make_type: init type = call constants.%struct.1(%.loc7_13.1) [template = f64]
// CHECK:STDOUT: %.loc7_13.2: type = value_of_initializer %float.make_type [template = f64]
// CHECK:STDOUT: %.loc7_13.3: type = converted %float.make_type, %.loc7_13.2 [template = f64]
// CHECK:STDOUT: @Foo.%return: ref f64 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.2] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.3] {}
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.4]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Float(%size: i32) -> type = "float.make_type";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo() -> f64 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc7: f64 = float_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc7: f64 = float_literal 1 [template = constants.%.3]
// CHECK:STDOUT: return %.loc7
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.4() [template = i32]
// CHECK:STDOUT: %.loc13_10.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc13_10.2: type = converted %int.make_type_32, %.loc13_10.1 [template = i32]
// CHECK:STDOUT: %x.var: ref i32 = var x
// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %Foo.call: init f64 = call %Foo.ref()
// CHECK:STDOUT: assign %x.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
+24 -8
View File
@@ -15,11 +15,13 @@ fn Main() {
// CHECK:STDOUT: --- i32.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Echo: type = fn_type @Echo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Echo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Echo: type = fn_type @Echo [template]
// CHECK:STDOUT: %struct.2: Echo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %struct.3: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -30,14 +32,25 @@ fn Main() {
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Echo.decl: Echo = fn_decl @Echo [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Echo.decl: Echo = fn_decl @Echo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_12: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_12.1: type = value_of_initializer %int.make_type_32.loc7_12 [template = i32]
// CHECK:STDOUT: %.loc7_12.2: type = converted %int.make_type_32.loc7_12, %.loc7_12.1 [template = i32]
// CHECK:STDOUT: %a.loc7_9.1: i32 = param a
// CHECK:STDOUT: @Echo.%a: i32 = bind_name a, %a.loc7_9.1
// CHECK:STDOUT: %int.make_type_32.loc7_20: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_20.1: type = value_of_initializer %int.make_type_32.loc7_20 [template = i32]
// CHECK:STDOUT: %.loc7_20.2: type = converted %int.make_type_32.loc7_20, %.loc7_20.1 [template = i32]
// CHECK:STDOUT: @Echo.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.3] {}
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Echo(%a: i32) -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %a.ref: i32 = name_ref a, %a
@@ -46,11 +59,14 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32, %.loc12_10.1 [template = i32]
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %Echo.ref: Echo = name_ref Echo, file.%Echo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %.loc12: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Echo.call: init i32 = call %Echo.ref(%.loc12)
// CHECK:STDOUT: %Echo.ref: Echo = name_ref Echo, file.%Echo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc12_21: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Echo.call: init i32 = call %Echo.ref(%.loc12_21)
// CHECK:STDOUT: assign %b.var, %Echo.call
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+24 -8
View File
@@ -15,11 +15,13 @@ fn Main() {
// CHECK:STDOUT: --- more_param_ir.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %struct.3: Main = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
@@ -35,15 +37,26 @@ fn Main() {
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc7_16.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.3] {}
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -51,8 +64,11 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc10_15.1: (type,) = tuple_literal (i32)
// CHECK:STDOUT: %.loc10_15.2: type = converted %.loc10_15.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc10_15.1: (type,) = tuple_literal (%int.make_type_32)
// CHECK:STDOUT: %.loc10_15.2: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc10_15.3: type = converted %int.make_type_32, %.loc10_15.2 [template = i32]
// CHECK:STDOUT: %.loc10_15.4: type = converted %.loc10_15.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %x.var: ref (i32,) = var x
// CHECK:STDOUT: %x: ref (i32,) = bind_name x, %x.var
// CHECK:STDOUT: %.loc10_20: i32 = int_literal 1 [template = constants.%.4]
@@ -60,7 +76,7 @@ fn Main() {
// CHECK:STDOUT: %.loc10_22.2: init (i32,) = tuple_init (%.loc10_20) to %x.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc10_23: init (i32,) = converted %.loc10_22.1, %.loc10_22.2 [template = constants.%tuple]
// CHECK:STDOUT: assign %x.var, %.loc10_23
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %x.ref: ref (i32,) = name_ref x, %x
// CHECK:STDOUT: %.loc12_9: i32 = int_literal 0 [template = constants.%.5]
// CHECK:STDOUT: %.loc12_10.1: ref i32 = tuple_index %x.ref, %.loc12_9
+14 -6
View File
@@ -13,11 +13,13 @@ fn Main() {
// CHECK:STDOUT: --- params_one.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %struct.3: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -28,13 +30,19 @@ fn Main() {
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.3] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -42,7 +50,7 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Foo.call: init () = call %Foo.ref(%.loc10)
// CHECK:STDOUT: return
@@ -14,11 +14,13 @@ fn Main() {
// CHECK:STDOUT: --- params_one_comma.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %struct.3: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -29,13 +31,19 @@ fn Main() {
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.3] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -43,10 +51,10 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref.loc10: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.ref.loc10: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Foo.call.loc10: init () = call %Foo.ref.loc10(%.loc10)
// CHECK:STDOUT: %Foo.ref.loc11: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.ref.loc11: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc11: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Foo.call.loc11: init () = call %Foo.ref.loc11(%.loc11)
// CHECK:STDOUT: return
+18 -6
View File
@@ -13,11 +13,13 @@ fn Main() {
// CHECK:STDOUT: --- params_two.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %struct.3: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: }
@@ -29,15 +31,25 @@ fn Main() {
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc7_16.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.3] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -45,7 +57,7 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc10_10: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %Foo.call: init () = call %Foo.ref(%.loc10_7, %.loc10_10)
@@ -14,11 +14,13 @@ fn Main() {
// CHECK:STDOUT: --- params_two_comma.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %struct.3: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: }
@@ -30,15 +32,25 @@ fn Main() {
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc7_16.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.3] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -46,11 +58,11 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref.loc10: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.ref.loc10: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc10_10: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %Foo.call.loc10: init () = call %Foo.ref.loc10(%.loc10_7, %.loc10_10)
// CHECK:STDOUT: %Foo.ref.loc11: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.ref.loc11: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc11_7: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc11_10: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %Foo.call.loc11: init () = call %Foo.ref.loc11(%.loc11_7, %.loc11_10)
@@ -12,9 +12,11 @@ fn F(n: i32, a: [i32; n]*);
// CHECK:STDOUT: --- fail_param_in_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %struct.2: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -23,15 +25,23 @@ fn F(n: i32, a: [i32; n]*);
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc10_9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc10_9.1: type = value_of_initializer %int.make_type_32.loc10_9 [template = i32]
// CHECK:STDOUT: %.loc10_9.2: type = converted %int.make_type_32.loc10_9, %.loc10_9.1 [template = i32]
// CHECK:STDOUT: %n.loc10_6.1: i32 = param n
// CHECK:STDOUT: @F.%n: i32 = bind_name n, %n.loc10_6.1
// CHECK:STDOUT: %int.make_type_32.loc10_18: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %n.ref: i32 = name_ref n, @F.%n
// CHECK:STDOUT: %.loc10: type = ptr_type <error> [template = <error>]
// CHECK:STDOUT: %.loc10_25: type = ptr_type <error> [template = <error>]
// CHECK:STDOUT: %a.loc10_14.1: <error> = param a
// CHECK:STDOUT: @F.%a: <error> = bind_name a, %a.loc10_14.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%n: i32, %a: <error>);
// CHECK:STDOUT:
@@ -15,9 +15,11 @@ fn F(n: i32, n: i32);
// CHECK:STDOUT: --- fail_param_redecl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %struct.2: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -26,13 +28,23 @@ fn F(n: i32, n: i32);
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc13_9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32.loc13_9 [template = i32]
// CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32.loc13_9, %.loc13_9.1 [template = i32]
// CHECK:STDOUT: %n.loc13_6.1: i32 = param n
// CHECK:STDOUT: @F.%n.loc13_6: i32 = bind_name n, %n.loc13_6.1
// CHECK:STDOUT: %int.make_type_32.loc13_17: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32.loc13_17 [template = i32]
// CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32.loc13_17, %.loc13_17.1 [template = i32]
// CHECK:STDOUT: %n.loc13_14.1: i32 = param n
// CHECK:STDOUT: @F.%n.loc13_14: i32 = bind_name n, %n.loc13_14.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%n.loc13_6: i32, %n.loc13_14: i32);
// CHECK:STDOUT:
+286 -146
View File
@@ -369,17 +369,19 @@ import library "extern_api";
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.4: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %struct.6: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -393,28 +395,46 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct.1] {}
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32]
// CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_32.loc5_9, %.loc5_9.1 [template = i32]
// CHECK:STDOUT: %b.loc5_6.1: i32 = param b
// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_6.1
// CHECK:STDOUT: %int.make_type_32.loc5_17: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_32.loc5_17 [template = i32]
// 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: %C.decl: C = fn_decl @C [template = constants.%struct.3] {
// CHECK:STDOUT: %.loc6_14.1: (type,) = tuple_literal (i32)
// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.4] {
// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc6_14.1: (type,) = tuple_literal (%int.make_type_32.loc6_10)
// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32]
// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_32.loc6_10, %.loc6_14.2 [template = i32]
// CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %c.loc6_6.1: (i32,) = param c
// CHECK:STDOUT: @C.%c: (i32,) = bind_name c, %c.loc6_6.1
// CHECK:STDOUT: %int.make_type_32.loc6_25: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_32.loc6_25 [template = i32]
// CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_32.loc6_25, %.loc6_25.1 [template = i32]
// CHECK:STDOUT: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: @C.%return: ref {.c: i32} = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.5] {}
// CHECK:STDOUT: %NS: <namespace> = namespace [template] {
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.5] {}
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.6] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C(%c: (i32,)) -> {.c: i32};
@@ -429,17 +449,19 @@ import library "extern_api";
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.4: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %struct.6: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -453,28 +475,46 @@ import library "extern_api";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct.1] {}
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc5_16: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc5_16.1: type = value_of_initializer %int.make_type_32.loc5_16 [template = i32]
// CHECK:STDOUT: %.loc5_16.2: type = converted %int.make_type_32.loc5_16, %.loc5_16.1 [template = i32]
// CHECK:STDOUT: %b.loc5_13.1: i32 = param b
// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_13.1
// CHECK:STDOUT: %int.make_type_32.loc5_24: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc5_24.1: type = value_of_initializer %int.make_type_32.loc5_24 [template = i32]
// 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: %C.decl: C = fn_decl @C [template = constants.%struct.3] {
// CHECK:STDOUT: %.loc6_21.1: (type,) = tuple_literal (i32)
// CHECK:STDOUT: %.loc6_21.2: type = converted %.loc6_21.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.4] {
// CHECK:STDOUT: %int.make_type_32.loc6_17: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc6_21.1: (type,) = tuple_literal (%int.make_type_32.loc6_17)
// CHECK:STDOUT: %.loc6_21.2: type = value_of_initializer %int.make_type_32.loc6_17 [template = i32]
// CHECK:STDOUT: %.loc6_21.3: type = converted %int.make_type_32.loc6_17, %.loc6_21.2 [template = i32]
// CHECK:STDOUT: %.loc6_21.4: type = converted %.loc6_21.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %c.loc6_13.1: (i32,) = param c
// CHECK:STDOUT: @C.%c: (i32,) = bind_name c, %c.loc6_13.1
// CHECK:STDOUT: %int.make_type_32.loc6_32: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc6_32.1: type = value_of_initializer %int.make_type_32.loc6_32 [template = i32]
// CHECK:STDOUT: %.loc6_32.2: type = converted %int.make_type_32.loc6_32, %.loc6_32.1 [template = i32]
// CHECK:STDOUT: %.loc6_35: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: @C.%return: ref {.c: i32} = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.5] {}
// CHECK:STDOUT: %NS: <namespace> = namespace [template] {
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.5] {}
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.6] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @C(%c: (i32,)) -> {.c: i32};
@@ -489,18 +529,20 @@ import library "extern_api";
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %.4: type = tuple_type (i32) [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.2) [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %struct.6: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -518,22 +560,30 @@ import library "extern_api";
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+21, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+43, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+46, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+50, loaded [template = constants.%struct.6]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref () = var a
// CHECK:STDOUT: %a: ref () = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.7: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%struct.2() [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: %.loc8: type = struct_type {.c: i32} [template = constants.%.3]
// CHECK:STDOUT: %import_ref.8: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32]
// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32]
// CHECK:STDOUT: %.loc8_16: type = struct_type {.c: i32} [template = constants.%.3]
// CHECK:STDOUT: %c.var: ref {.c: i32} = var c
// CHECK:STDOUT: %c: ref {.c: i32} = bind_name c, %c.var
// CHECK:STDOUT: %.loc9_9.1: () = tuple_literal ()
@@ -548,6 +598,8 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C(%c: (i32,)) -> {.c: i32};
@@ -561,22 +613,22 @@ import library "extern_api";
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%import_ref.1 [template = constants.%struct.1]
// CHECK:STDOUT: %A.call: init () = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.3]
// CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.4]
// CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc8_25: (i32,) = tuple_literal (%.loc8_23)
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc8_23) [template = constants.%tuple]
// CHECK:STDOUT: %.loc8_21: (i32,) = converted %.loc8_25, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %C.call: init {.c: i32} = call %C.ref(%.loc8_21)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.4]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.5]
// CHECK:STDOUT: %D.call: init () = call %D.ref()
// CHECK:STDOUT: assign file.%d.var, %D.call
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.5]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.6]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -588,17 +640,19 @@ import library "extern_api";
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.4: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %struct.6: E = struct_value () [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.5) [template]
// CHECK:STDOUT: }
@@ -618,38 +672,62 @@ import library "extern_api";
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+21, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+43, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+46, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+50, loaded [template = constants.%struct.6]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct.1] {}
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.7: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.8: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7_16 [template = i32]
// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_32.loc7_16, %.loc7_16.1 [template = i32]
// CHECK:STDOUT: %b.loc7_13.1: i32 = param b
// CHECK:STDOUT: %b.loc7_13.2: i32 = bind_name b, %b.loc7_13.1
// CHECK:STDOUT: %int.make_type_32.loc7_24: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc7_24.1: type = value_of_initializer %int.make_type_32.loc7_24 [template = i32]
// 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: %C.decl: C = fn_decl @C [template = constants.%struct.3] {
// CHECK:STDOUT: %.loc8_21.1: (type,) = tuple_literal (i32)
// CHECK:STDOUT: %.loc8_21.2: type = converted %.loc8_21.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %import_ref.9: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.10: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.4] {
// CHECK:STDOUT: %int.make_type_32.loc8_17: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc8_21.1: (type,) = tuple_literal (%int.make_type_32.loc8_17)
// CHECK:STDOUT: %.loc8_21.2: type = value_of_initializer %int.make_type_32.loc8_17 [template = i32]
// CHECK:STDOUT: %.loc8_21.3: type = converted %int.make_type_32.loc8_17, %.loc8_21.2 [template = i32]
// CHECK:STDOUT: %.loc8_21.4: type = converted %.loc8_21.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %c.loc8_13.1: (i32,) = param c
// CHECK:STDOUT: %c.loc8_13.2: (i32,) = bind_name c, %c.loc8_13.1
// CHECK:STDOUT: %int.make_type_32.loc8_32: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc8_32.1: type = value_of_initializer %int.make_type_32.loc8_32 [template = i32]
// CHECK:STDOUT: %.loc8_32.2: type = converted %int.make_type_32.loc8_32, %.loc8_32.1 [template = i32]
// CHECK:STDOUT: %.loc8_35: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: %return.var.loc8: ref {.c: i32} = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.5] {}
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.5] {}
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.6] {}
// CHECK:STDOUT: %.loc12_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref () = var a
// CHECK:STDOUT: %a: ref () = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.11: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%struct.2() [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: %.loc14: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: %import_ref.12: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%struct.2() [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]
// CHECK:STDOUT: %.loc14_16: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: %c.var: ref {.c: i32} = var c
// CHECK:STDOUT: %c.loc14: ref {.c: i32} = bind_name c, %c.var
// CHECK:STDOUT: %.loc15_9.1: () = tuple_literal ()
@@ -664,6 +742,8 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @C(%c: (i32,)) -> {.c: i32};
@@ -677,22 +757,22 @@ import library "extern_api";
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%A.decl [template = constants.%struct.1]
// CHECK:STDOUT: %A.call: init () = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%B.decl [template = constants.%struct.2]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%B.decl [template = constants.%struct.3]
// CHECK:STDOUT: %.loc13: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc13)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%C.decl [template = constants.%struct.3]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%C.decl [template = constants.%struct.4]
// CHECK:STDOUT: %.loc14_23: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_25: (i32,) = tuple_literal (%.loc14_23)
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc14_23) [template = constants.%tuple]
// CHECK:STDOUT: %.loc14_21: (i32,) = converted %.loc14_25, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %C.call: init {.c: i32} = call %C.ref(%.loc14_21)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%D.decl [template = constants.%struct.4]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%D.decl [template = constants.%struct.5]
// CHECK:STDOUT: %D.call: init () = call %D.ref()
// CHECK:STDOUT: assign file.%d.var, %D.call
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%E.decl [template = constants.%struct.5]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%E.decl [template = constants.%struct.6]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -704,17 +784,19 @@ import library "extern_api";
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.4: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %struct.6: E = struct_value () [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.5) [template]
// CHECK:STDOUT: }
@@ -734,38 +816,62 @@ import library "extern_api";
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+21, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+43, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+46, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+50, loaded [template = constants.%struct.6]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct.1] {}
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.7: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.8: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc7_16.1: type = value_of_initializer %int.make_type_32.loc7_16 [template = i32]
// CHECK:STDOUT: %.loc7_16.2: type = converted %int.make_type_32.loc7_16, %.loc7_16.1 [template = i32]
// CHECK:STDOUT: %b.loc7_13.1: i32 = param b
// CHECK:STDOUT: %b.loc7_13.2: i32 = bind_name b, %b.loc7_13.1
// CHECK:STDOUT: %int.make_type_32.loc7_24: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc7_24.1: type = value_of_initializer %int.make_type_32.loc7_24 [template = i32]
// 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: %C.decl: C = fn_decl @C [template = constants.%struct.3] {
// CHECK:STDOUT: %.loc8_21.1: (type,) = tuple_literal (i32)
// CHECK:STDOUT: %.loc8_21.2: type = converted %.loc8_21.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %import_ref.9: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.10: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.4] {
// CHECK:STDOUT: %int.make_type_32.loc8_17: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc8_21.1: (type,) = tuple_literal (%int.make_type_32.loc8_17)
// CHECK:STDOUT: %.loc8_21.2: type = value_of_initializer %int.make_type_32.loc8_17 [template = i32]
// CHECK:STDOUT: %.loc8_21.3: type = converted %int.make_type_32.loc8_17, %.loc8_21.2 [template = i32]
// CHECK:STDOUT: %.loc8_21.4: type = converted %.loc8_21.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %c.loc8_13.1: (i32,) = param c
// CHECK:STDOUT: %c.loc8_13.2: (i32,) = bind_name c, %c.loc8_13.1
// CHECK:STDOUT: %int.make_type_32.loc8_32: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc8_32.1: type = value_of_initializer %int.make_type_32.loc8_32 [template = i32]
// CHECK:STDOUT: %.loc8_32.2: type = converted %int.make_type_32.loc8_32, %.loc8_32.1 [template = i32]
// CHECK:STDOUT: %.loc8_35: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: %return.var.loc8: ref {.c: i32} = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.5] {}
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.5] {}
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.6] {}
// CHECK:STDOUT: %.loc12_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref () = var a
// CHECK:STDOUT: %a: ref () = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.11: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%struct.2() [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: %.loc14: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: %import_ref.12: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%struct.2() [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]
// CHECK:STDOUT: %.loc14_16: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: %c.var: ref {.c: i32} = var c
// CHECK:STDOUT: %c.loc14: ref {.c: i32} = bind_name c, %c.var
// CHECK:STDOUT: %.loc15_9.1: () = tuple_literal ()
@@ -780,6 +886,8 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @C(%c: (i32,)) -> {.c: i32};
@@ -793,22 +901,22 @@ import library "extern_api";
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%A.decl [template = constants.%struct.1]
// CHECK:STDOUT: %A.call: init () = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%B.decl [template = constants.%struct.2]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%B.decl [template = constants.%struct.3]
// CHECK:STDOUT: %.loc13: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc13)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%C.decl [template = constants.%struct.3]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%C.decl [template = constants.%struct.4]
// CHECK:STDOUT: %.loc14_23: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_25: (i32,) = tuple_literal (%.loc14_23)
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc14_23) [template = constants.%tuple]
// CHECK:STDOUT: %.loc14_21: (i32,) = converted %.loc14_25, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %C.call: init {.c: i32} = call %C.ref(%.loc14_21)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%D.decl [template = constants.%struct.4]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%D.decl [template = constants.%struct.5]
// CHECK:STDOUT: %D.call: init () = call %D.ref()
// CHECK:STDOUT: assign file.%d.var, %D.call
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%E.decl [template = constants.%struct.5]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%E.decl [template = constants.%struct.6]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -820,18 +928,20 @@ import library "extern_api";
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %.4: type = tuple_type (i32) [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.2) [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %struct.6: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -849,27 +959,35 @@ import library "extern_api";
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+21, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+43, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+46, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+50, loaded [template = constants.%struct.6]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+9, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+23, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+26, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+30, 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: %.loc72_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref () = var a
// CHECK:STDOUT: %a: ref () = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.12: Int32 = import_ref ir5, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc73: init type = call constants.%struct.2() [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: %.loc74: type = struct_type {.c: i32} [template = constants.%.3]
// CHECK:STDOUT: %import_ref.13: Int32 = import_ref ir5, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc74: init type = call constants.%struct.2() [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]
// CHECK:STDOUT: %.loc74_16: type = struct_type {.c: i32} [template = constants.%.3]
// CHECK:STDOUT: %c.var: ref {.c: i32} = var c
// CHECK:STDOUT: %c: ref {.c: i32} = bind_name c, %c.var
// CHECK:STDOUT: %.loc75_9.1: () = tuple_literal ()
@@ -884,6 +1002,8 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C(%c: (i32,)) -> {.c: i32};
@@ -897,22 +1017,22 @@ import library "extern_api";
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%import_ref.1 [template = constants.%struct.1]
// CHECK:STDOUT: %A.call: init () = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.3]
// CHECK:STDOUT: %.loc73: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc73)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.4]
// CHECK:STDOUT: %.loc74_23: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc74_25: (i32,) = tuple_literal (%.loc74_23)
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc74_23) [template = constants.%tuple]
// CHECK:STDOUT: %.loc74_21: (i32,) = converted %.loc74_25, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %C.call: init {.c: i32} = call %C.ref(%.loc74_21)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.4]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.5]
// CHECK:STDOUT: %D.call: init () = call %D.ref()
// CHECK:STDOUT: assign file.%d.var, %D.call
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.5]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.6]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -924,18 +1044,20 @@ import library "extern_api";
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %.4: type = tuple_type (i32) [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.2) [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %struct.6: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -953,27 +1075,35 @@ import library "extern_api";
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+21, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+43, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+46, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+49, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+50, loaded [template = constants.%struct.6]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+9, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+23, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+26, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+30, 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: %.loc72_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref () = var a
// CHECK:STDOUT: %a: ref () = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.12: Int32 = import_ref ir5, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc73: init type = call constants.%struct.2() [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: %.loc74: type = struct_type {.c: i32} [template = constants.%.3]
// CHECK:STDOUT: %import_ref.13: Int32 = import_ref ir5, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc74: init type = call constants.%struct.2() [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]
// CHECK:STDOUT: %.loc74_16: type = struct_type {.c: i32} [template = constants.%.3]
// CHECK:STDOUT: %c.var: ref {.c: i32} = var c
// CHECK:STDOUT: %c: ref {.c: i32} = bind_name c, %c.var
// CHECK:STDOUT: %.loc75_9.1: () = tuple_literal ()
@@ -988,6 +1118,8 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @C(%c: (i32,)) -> {.c: i32};
@@ -1001,22 +1133,22 @@ import library "extern_api";
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%import_ref.1 [template = constants.%struct.1]
// CHECK:STDOUT: %A.call: init () = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.3]
// CHECK:STDOUT: %.loc73: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc73)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.4]
// CHECK:STDOUT: %.loc74_23: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc74_25: (i32,) = tuple_literal (%.loc74_23)
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc74_23) [template = constants.%tuple]
// CHECK:STDOUT: %.loc74_21: (i32,) = converted %.loc74_25, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %C.call: init {.c: i32} = call %C.ref(%.loc74_21)
// CHECK:STDOUT: assign file.%c.var, %C.call
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.4]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.5]
// CHECK:STDOUT: %D.call: init () = call %D.ref()
// CHECK:STDOUT: assign file.%d.var, %D.call
// CHECK:STDOUT: %NS.ref: <namespace> = name_ref NS, file.%NS [template = file.%NS]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.5]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.6]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -1041,14 +1173,14 @@ import library "extern_api";
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
@@ -1073,8 +1205,10 @@ import library "extern_api";
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %.2: type = fn_type @.1 [template]
// CHECK:STDOUT: %struct.2: <invalid> = struct_value () [template]
// CHECK:STDOUT: %struct.3: <invalid> = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1088,26 +1222,32 @@ import library "extern_api";
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref () = var a
// CHECK:STDOUT: %a: ref () = bind_name a, %a.var
// CHECK:STDOUT: %.decl: <invalid> = fn_decl @.1 [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.7: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %.decl: <invalid> = fn_decl @.1 [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc18_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc18_11.2: type = converted %int.make_type_32, %.loc18_11.1 [template = i32]
// CHECK:STDOUT: @.1.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @.1() -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
@@ -1137,14 +1277,14 @@ import library "extern_api";
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
@@ -1175,14 +1315,14 @@ import library "extern_api";
// 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+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1198,14 +1338,14 @@ import library "extern_api";
// 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+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+50, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1221,19 +1361,19 @@ import library "extern_api";
// 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+9, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+23, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// 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+9, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+23, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+26, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+30, 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: }
// CHECK:STDOUT:
@@ -11,11 +11,13 @@ fn G(a: i32);
// CHECK:STDOUT: --- param_same_name.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %struct.2: F = struct_value () [template]
// CHECK:STDOUT: %G: type = fn_type @G [template]
// CHECK:STDOUT: %struct.2: G = struct_value () [template]
// CHECK:STDOUT: %struct.3: G = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -25,16 +27,26 @@ fn G(a: i32);
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_9.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32]
// CHECK:STDOUT: %.loc7_9.2: type = converted %int.make_type_32.loc7, %.loc7_9.1 [template = i32]
// CHECK:STDOUT: %a.loc7_6.1: i32 = param a
// CHECK:STDOUT: @F.%a: i32 = bind_name a, %a.loc7_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc9: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc9_9.1: type = value_of_initializer %int.make_type_32.loc9 [template = i32]
// CHECK:STDOUT: %.loc9_9.2: type = converted %int.make_type_32.loc9, %.loc9_9.1 [template = i32]
// CHECK:STDOUT: %a.loc9_6.1: i32 = param a
// CHECK:STDOUT: @G.%a: i32 = bind_name a, %a.loc9_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%a: i32);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G(%a: i32);
+68 -24
View File
@@ -96,16 +96,18 @@ fn D() {}
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.4: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %.5: i32 = int_literal 0 [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -118,20 +120,36 @@ fn D() {}
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct.1] {}
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc5_9.1: type = value_of_initializer %int.make_type_32.loc5_9 [template = i32]
// CHECK:STDOUT: %.loc5_9.2: type = converted %int.make_type_32.loc5_9, %.loc5_9.1 [template = i32]
// CHECK:STDOUT: %b.loc5_6.1: i32 = param b
// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_6.1
// CHECK:STDOUT: %int.make_type_32.loc5_17: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc5_17.1: type = value_of_initializer %int.make_type_32.loc5_17 [template = i32]
// 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: %C.decl: C = fn_decl @C [template = constants.%struct.3] {
// CHECK:STDOUT: %.loc6_14.1: (type,) = tuple_literal (i32)
// CHECK:STDOUT: %.loc6_14.2: type = converted %.loc6_14.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %import_ref.3: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.4] {
// CHECK:STDOUT: %int.make_type_32.loc6_10: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc6_14.1: (type,) = tuple_literal (%int.make_type_32.loc6_10)
// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_32.loc6_10 [template = i32]
// CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_32.loc6_10, %.loc6_14.2 [template = i32]
// CHECK:STDOUT: %.loc6_14.4: type = converted %.loc6_14.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %c.loc6_6.1: (i32,) = param c
// CHECK:STDOUT: @C.%c: (i32,) = bind_name c, %c.loc6_6.1
// CHECK:STDOUT: %int.make_type_32.loc6_25: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc6_25.1: type = value_of_initializer %int.make_type_32.loc6_25 [template = i32]
// CHECK:STDOUT: %.loc6_25.2: type = converted %int.make_type_32.loc6_25, %.loc6_25.1 [template = i32]
// CHECK:STDOUT: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.4]
// CHECK:STDOUT: @C.%return: ref {.c: i32} = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.5] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -139,6 +157,8 @@ fn D() {}
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B(%b: i32) -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %b.ref: i32 = name_ref b, %b
@@ -183,13 +203,15 @@ fn D() {}
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %.4: type = tuple_type (i32) [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %struct.4: C = struct_value () [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.2) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -205,23 +227,33 @@ fn D() {}
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+26, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+38, unloaded
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+22, loaded [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+46, loaded [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+58, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %.loc6_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref () = var a
// CHECK:STDOUT: %a: ref () = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.5: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%struct.2() [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: %.loc8: type = struct_type {.c: i32} [template = constants.%.3]
// CHECK:STDOUT: %import_ref.6: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc8_13.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32]
// CHECK:STDOUT: %.loc8_13.2: type = converted %int.make_type_32.loc8, %.loc8_13.1 [template = i32]
// CHECK:STDOUT: %.loc8_16: type = struct_type {.c: i32} [template = constants.%.3]
// CHECK:STDOUT: %c.var: ref {.c: i32} = var c
// CHECK:STDOUT: %c: ref {.c: i32} = bind_name c, %c.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C(%c: (i32,)) -> {.c: i32};
@@ -231,11 +263,11 @@ fn D() {}
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%import_ref.1 [template = constants.%struct.1]
// CHECK:STDOUT: %A.call: init () = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.3]
// CHECK:STDOUT: %.loc7: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %B.call: init i32 = call %B.ref(%.loc7)
// CHECK:STDOUT: assign file.%b.var, %B.call
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.4]
// CHECK:STDOUT: %.loc8_23: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc8_25: (i32,) = tuple_literal (%.loc8_23)
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc8_23) [template = constants.%tuple]
@@ -251,8 +283,10 @@ fn D() {}
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %struct.2: Int32 = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %struct.3: B = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -264,14 +298,22 @@ fn D() {}
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+38, unloaded
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+22, loaded [template = constants.%struct.3]
// 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: %A.decl: A = fn_decl @A [template = constants.%struct.1] {}
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %import_ref.5: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.6: Int32 = import_ref ir4, inst+3, loaded [template = constants.%struct.2]
// CHECK:STDOUT: %B.decl: B = fn_decl @B [template = constants.%struct.3] {
// CHECK:STDOUT: %int.make_type_32.loc27_9: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc27_9.1: type = value_of_initializer %int.make_type_32.loc27_9 [template = i32]
// CHECK:STDOUT: %.loc27_9.2: type = converted %int.make_type_32.loc27_9, %.loc27_9.1 [template = i32]
// CHECK:STDOUT: %b.loc27_6.1: i32 = param b
// CHECK:STDOUT: %b.loc27_6.2: i32 = bind_name b, %b.loc27_6.1
// CHECK:STDOUT: %int.make_type_32.loc27_17: init type = call constants.%struct.2() [template = i32]
// CHECK:STDOUT: %.loc27_17.1: type = value_of_initializer %int.make_type_32.loc27_17 [template = i32]
// CHECK:STDOUT: %.loc27_17.2: type = converted %int.make_type_32.loc27_17, %.loc27_17.1 [template = i32]
// CHECK:STDOUT: %return.var: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -281,6 +323,8 @@ fn D() {}
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B(%b: i32) -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: --- redecl_then_def.carbon
@@ -324,9 +368,9 @@ fn D() {}
// CHECK:STDOUT: .D = %D.decl.loc13
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+10, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+38, loaded [template = constants.%struct]
// 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 = import_ref ir1, inst+58, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %D.decl.loc6: D = fn_decl @D [template = constants.%struct] {}
// CHECK:STDOUT: %D.decl.loc13: D = fn_decl @D [template = constants.%struct] {}
@@ -25,12 +25,9 @@ fn G(x: ());
fn G() {}
fn H(x: ());
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:6: ERROR: Redeclaration differs at parameter 1.
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: ERROR: Name `Core` not found.
// CHECK:STDERR: fn H(x: bool) {}
// CHECK:STDERR: ^
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:6: Previous declaration's corresponding parameter here.
// CHECK:STDERR: fn H(x: ());
// CHECK:STDERR: ^
// CHECK:STDERR: ^~~~
// CHECK:STDERR:
fn H(x: bool) {}
@@ -125,30 +122,30 @@ fn K() -> {} { return {}; }
// CHECK:STDOUT: %x.loc27_6.1: () = param x
// CHECK:STDOUT: @H.%x: () = bind_name x, %x.loc27_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.decl.loc35: <invalid> = fn_decl @.3 [template = constants.%struct.6] {
// CHECK:STDOUT: %x.loc35_6.1: bool = param x
// CHECK:STDOUT: @.3.%x: bool = bind_name x, %x.loc35_6.1
// CHECK:STDOUT: %.decl.loc32: <invalid> = fn_decl @.3 [template = constants.%struct.6] {
// CHECK:STDOUT: %x.loc32_6.1: <error> = param x
// CHECK:STDOUT: @.3.%x: <error> = bind_name x, %x.loc32_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %I.decl: I = fn_decl @I [template = constants.%struct.7] {}
// CHECK:STDOUT: %.decl.loc45: <invalid> = fn_decl @.4 [template = constants.%struct.8] {
// CHECK:STDOUT: %.loc45_12.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc45_12.2: type = converted %.loc45_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %.decl.loc42: <invalid> = fn_decl @.4 [template = constants.%struct.8] {
// CHECK:STDOUT: %.loc42_12.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc42_12.2: type = converted %.loc42_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: @.4.%return: ref () = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %J.decl: J = fn_decl @J [template = constants.%struct.9] {
// CHECK:STDOUT: %.loc47_12.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc47_12.2: type = converted %.loc47_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %.loc44_12.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc44_12.2: type = converted %.loc44_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: @J.%return: ref () = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.decl.loc55: <invalid> = fn_decl @.5 [template = constants.%struct.10] {}
// CHECK:STDOUT: %.decl.loc52: <invalid> = fn_decl @.5 [template = constants.%struct.10] {}
// CHECK:STDOUT: %K.decl: K = fn_decl @K [template = constants.%struct.11] {
// CHECK:STDOUT: %.loc57_12.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc57_12.2: type = converted %.loc57_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %.loc54_12.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc54_12.2: type = converted %.loc54_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: @K.%return: ref () = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.decl.loc64: <invalid> = fn_decl @.6 [template = constants.%struct.12] {
// CHECK:STDOUT: %.loc64_12.1: {} = struct_literal ()
// CHECK:STDOUT: %.loc64_12.2: type = converted %.loc64_12.1, constants.%.7 [template = constants.%.7]
// CHECK:STDOUT: %.decl.loc61: <invalid> = fn_decl @.6 [template = constants.%struct.12] {
// CHECK:STDOUT: %.loc61_12.1: {} = struct_literal ()
// CHECK:STDOUT: %.loc61_12.2: type = converted %.loc61_12.1, constants.%.7 [template = constants.%.7]
// CHECK:STDOUT: @.6.%return: ref {} = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -169,7 +166,7 @@ fn K() -> {} { return {}; }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @H(%x: ());
// CHECK:STDOUT:
// CHECK:STDOUT: fn @.3(%x: bool) {
// CHECK:STDOUT: fn @.3(%x: <error>) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -178,10 +175,10 @@ fn K() -> {} { return {}; }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @.4() -> () {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc45_24: () = tuple_literal ()
// CHECK:STDOUT: %.loc42_24: () = tuple_literal ()
// CHECK:STDOUT: %tuple: () = tuple_value () [template = constants.%tuple]
// CHECK:STDOUT: %.loc45_25: () = converted %.loc45_24, %tuple [template = constants.%tuple]
// CHECK:STDOUT: return %.loc45_25
// CHECK:STDOUT: %.loc42_25: () = converted %.loc42_24, %tuple [template = constants.%tuple]
// CHECK:STDOUT: return %.loc42_25
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @J() -> ();
@@ -195,9 +192,9 @@ fn K() -> {} { return {}; }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @.6() -> {} {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc64_24: {} = struct_literal ()
// CHECK:STDOUT: %.loc61_24: {} = struct_literal ()
// CHECK:STDOUT: %struct: {} = struct_value () [template = constants.%struct.13]
// CHECK:STDOUT: %.loc64_25: {} = converted %.loc64_24, %struct [template = constants.%struct.13]
// CHECK:STDOUT: return %.loc64_25
// CHECK:STDOUT: %.loc61_25: {} = converted %.loc61_24, %struct [template = constants.%struct.13]
// CHECK:STDOUT: return %.loc61_25
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -9,9 +9,11 @@ fn Foo(a: i32) {}
// CHECK:STDOUT: --- params_one.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -20,12 +22,18 @@ fn Foo(a: i32) {}
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
// CHECK:STDOUT: %import_ref: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -9,9 +9,11 @@ fn Foo(a: i32,) {}
// CHECK:STDOUT: --- params_one_comma.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -20,12 +22,18 @@ fn Foo(a: i32,) {}
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
// CHECK:STDOUT: %import_ref: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -9,9 +9,11 @@ fn Foo(a: i32, b: i32) {}
// CHECK:STDOUT: --- params_two.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -20,14 +22,24 @@ fn Foo(a: i32, b: i32) {}
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc7_16.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -9,9 +9,11 @@ fn Foo(a: i32, b: i32,) {}
// CHECK:STDOUT: --- params_two_comma.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %struct.2: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -20,14 +22,24 @@ fn Foo(a: i32, b: i32,) {}
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc7_11: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_11.1: type = value_of_initializer %int.make_type_32.loc7_11 [template = i32]
// CHECK:STDOUT: %.loc7_11.2: type = converted %int.make_type_32.loc7_11, %.loc7_11.1 [template = i32]
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32]
// CHECK:STDOUT: %.loc7_19.2: type = converted %int.make_type_32.loc7_19, %.loc7_19.1 [template = i32]
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
// CHECK:STDOUT: @Foo.%b: i32 = bind_name b, %b.loc7_16.1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
@@ -12,10 +12,12 @@ fn F(N:! i32, a: [i32; N]*);
// CHECK:STDOUT: --- fail_todo_param_in_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Int32 = struct_value () [template]
// CHECK:STDOUT: %N: i32 = bind_symbolic_name N 0 [symbolic]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: %struct.2: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -24,10 +26,18 @@ fn F(N:! i32, a: [i32; N]*);
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %import_ref.1: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: Int32 = import_ref ir3, inst+3, loaded [template = constants.%struct.1]
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] {
// CHECK:STDOUT: %int.make_type_32.loc10_10: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %.loc10_10.1: type = value_of_initializer %int.make_type_32.loc10_10 [template = i32]
// CHECK:STDOUT: %.loc10_10.2: type = converted %int.make_type_32.loc10_10, %.loc10_10.1 [template = i32]
// CHECK:STDOUT: %N.loc10_6.1: i32 = param N
// CHECK:STDOUT: @F.%N: i32 = bind_symbolic_name N 0, %N.loc10_6.1 [symbolic = constants.%N]
// CHECK:STDOUT: %int.make_type_32.loc10_19: init type = call constants.%struct.1() [template = i32]
// CHECK:STDOUT: %N.ref: i32 = name_ref N, @F.%N [symbolic = constants.%N]
// CHECK:STDOUT: %.loc10_19.1: type = value_of_initializer %int.make_type_32.loc10_19 [template = i32]
// CHECK:STDOUT: %.loc10_19.2: type = converted %int.make_type_32.loc10_19, %.loc10_19.1 [template = i32]
// CHECK:STDOUT: %.loc10_25: type = array_type %N.ref, i32 [template = <error>]
// CHECK:STDOUT: %.loc10_26: type = ptr_type <error> [template = <error>]
// CHECK:STDOUT: %a.loc10_15.1: <error> = param a
@@ -35,5 +45,7 @@ fn F(N:! i32, a: [i32; N]*);
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%N: i32, %a: <error>);
// CHECK:STDOUT: