Promote FunctionType to a standard instruction. (#3931)

This removes the builtin FunctionType, replacing it with a FunctionType
instruction. The constant for a FunctionDecl is now a StructValue with
type of FunctionType.

Note this means a function declaration produces _both_ a type, and a
value of the type. This has some consequences in terms of circularity,
and makes the importing of function declarations a little more complex.

It'll get particularly peculiar for imports because of the behavior of
the reference, but that's a known issue due to other things such as
`alias`. The impact will hopefully be contained to
ResolvePrevInstForMerge (and ImportRefs).

To note a small formatting change in diagnostics:

```
-  // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:3: ERROR: Value of type `<associated <function> in Interface>` is not callable.
+  // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:3: ERROR: Value of type `<associated F in Interface>` is not callable.

-  // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: ERROR: Value of type `<associated <function> in Interface>` is not callable.
+  // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: ERROR: Value of type `<associated F in Interface>` is not callable.
```

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Jon Ross-Perkins
2024-05-03 15:18:04 +00:00
committed by GitHub
co-authored by Richard Smith
parent e6061f6910
commit 76ed3c73cb
405 changed files with 9799 additions and 6579 deletions
+15 -12
View File
@@ -11,32 +11,35 @@ var arr: [i32; Add(1, 2)];
// CHECK:STDOUT: --- call.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template]
// CHECK:STDOUT: %.5: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %Add: type = fn_type @Add [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: 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]
// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template]
// CHECK:STDOUT: %.6: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Add = %Add
// CHECK:STDOUT: .Add = %Add.decl
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Add: <function> = fn_decl @Add [template] {
// CHECK:STDOUT: %Add.decl: Add = fn_decl @Add [template = constants.%struct] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc7_16.1
// CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Add.ref: <function> = name_ref Add, %Add [template = %Add]
// CHECK:STDOUT: %.loc9_20: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc9_23: i32 = int_literal 2 [template = constants.%.2]
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc9_20, %.loc9_23) [template = constants.%.3]
// CHECK:STDOUT: %.loc9_25: type = array_type %int.sadd, i32 [template = constants.%.4]
// CHECK:STDOUT: %Add.ref: Add = name_ref Add, %Add.decl [template = constants.%struct]
// 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_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: }
@@ -29,8 +29,11 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @Add [template]
// CHECK:STDOUT: %Self: Add = bind_symbolic_name Self 0 [symbolic]
// CHECK:STDOUT: %.2: type = assoc_entity_type @Add, <function> [template]
// CHECK:STDOUT: %.3: <associated <function> in Add> = assoc_entity element0, @Add.%Op [template]
// CHECK:STDOUT: %Op: type = fn_type @Op [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Op = struct_value () [template]
// CHECK:STDOUT: %.3: type = assoc_entity_type @Add, Op [template]
// CHECK:STDOUT: %.4: <associated Op in Add> = assoc_entity element0, @Add.%Op.decl [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -42,7 +45,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Add {
// CHECK:STDOUT: %Self: Add = bind_symbolic_name Self 0 [symbolic = constants.%Self]
// CHECK:STDOUT: %Op: <function> = fn_decl @Op [template] {
// CHECK:STDOUT: %Op.decl: Op = fn_decl @Op [template = constants.%struct] {
// CHECK:STDOUT: %Self.ref.loc5_15: Add = name_ref Self, %Self [symbolic = constants.%Self]
// CHECK:STDOUT: %.loc5_15.1: type = facet_type_access %Self.ref.loc5_15 [symbolic = constants.%Self]
// CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref.loc5_15, %.loc5_15.1 [symbolic = constants.%Self]
@@ -58,12 +61,12 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %.loc5_37.2: type = converted %Self.ref.loc5_37, %.loc5_37.1 [symbolic = constants.%Self]
// CHECK:STDOUT: %return.var: ref Self = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc5_41: <associated <function> in Add> = assoc_entity element0, %Op [template = constants.%.3]
// CHECK:STDOUT: %.loc5_41: <associated Op in Add> = assoc_entity element0, %Op.decl [template = constants.%.4]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
// CHECK:STDOUT: .Op = %.loc5_41
// CHECK:STDOUT: witness = (%Op)
// CHECK:STDOUT: witness = (%Op.decl)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Op[@Add.%self.loc5_9.2: Self](@Add.%other.loc5_21.2: Self) -> Self;
@@ -73,21 +76,26 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @Add [template]
// CHECK:STDOUT: %Self: Add = bind_symbolic_name Self 0 [symbolic]
// CHECK:STDOUT: %.2: <witness> = interface_witness (@impl.%Op) [template]
// CHECK:STDOUT: %.3: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.4: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.5: type = assoc_entity_type @Add, <function> [template]
// CHECK:STDOUT: %.6: <associated <function> in Add> = assoc_entity element0, file.%import_ref.6 [template]
// CHECK:STDOUT: %.7: <bound method> = bound_method %.3, @impl.%Op [template]
// CHECK:STDOUT: %.8: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.9: type = array_type %.8, i32 [template]
// CHECK:STDOUT: %.10: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.11: i32 = int_literal 4 [template]
// CHECK:STDOUT: %.12: <bound method> = bound_method %.8, @impl.%Op [template]
// CHECK:STDOUT: %.13: i32 = int_literal 7 [template]
// CHECK:STDOUT: %.14: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.15: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.8, %.11, %.13) [template]
// 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: %.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: %.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: %.14: i32 = int_literal 7 [template]
// CHECK:STDOUT: %.15: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.16: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.9, %.12, %.14) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -97,22 +105,22 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: type = import_ref ir2, inst+1, loc_9 [template = constants.%.1]
// CHECK:STDOUT: %import_ref.2: <associated <function> in Add> = import_ref ir2, inst+21, loc_36 [template = constants.%.6]
// CHECK:STDOUT: %import_ref.2: <associated Op in Add> = import_ref ir2, inst+24, loc_36 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.3 = import_ref ir2, inst+3, unloaded
// CHECK:STDOUT: %import_ref.4: <function> = import_ref ir2, inst+19, loc_10 [template = imports.%Op]
// CHECK:STDOUT: %import_ref.4: Op = import_ref ir2, inst+19, loc_10 [template = constants.%struct.2]
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.1] {}
// CHECK:STDOUT: %Add.ref: type = name_ref Add, %import_ref.1 [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.4]
// 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 ir2, inst+1, loc_36 [template = constants.%.1]
// CHECK:STDOUT: %import_ref.6 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %.1: <function> = interface_witness_access @impl.%.1, element0 [template = @impl.%Op]
// CHECK:STDOUT: %.loc10_18: <bound method> = bound_method %.loc10_16, %.1 [template = constants.%.7]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18(%.loc10_16, %.loc10_20) [template = constants.%.8]
// CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.9]
// CHECK:STDOUT: %.1: Op = interface_witness_access @impl.%.1, element0 [template = constants.%struct.1]
// CHECK:STDOUT: %.loc10_18: <bound method> = bound_method %.loc10_16, %.1 [template = constants.%.8]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18(%.loc10_16, %.loc10_20) [template = constants.%.9]
// 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 ir2, inst+1, loc_47 [template = constants.%.1]
@@ -126,7 +134,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: i32 as Add {
// CHECK:STDOUT: %Op: <function> = fn_decl @Op.1 [template] {
// CHECK:STDOUT: %Op.decl: Op = fn_decl @Op.1 [template = constants.%struct.1] {
// 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
@@ -136,10 +144,10 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %Self.ref.loc7_37: type = name_ref Self, i32 [template = i32]
// CHECK:STDOUT: %return.var: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: <witness> = interface_witness (%Op) [template = constants.%.2]
// CHECK:STDOUT: %.1: <witness> = interface_witness (%Op.decl) [template = constants.%.3]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Op = %Op
// CHECK:STDOUT: .Op = %Op.decl
// CHECK:STDOUT: witness = %.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -149,23 +157,23 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc10_26: i32 = int_literal 3 [template = constants.%.8]
// CHECK:STDOUT: %.loc10_29: i32 = int_literal 4 [template = constants.%.11]
// CHECK:STDOUT: %.loc10_32: i32 = int_literal 3 [template = constants.%.8]
// CHECK:STDOUT: %.loc10_36: i32 = int_literal 4 [template = constants.%.11]
// CHECK:STDOUT: %.1: <function> = interface_witness_access @impl.%.1, element0 [template = @impl.%Op]
// CHECK:STDOUT: %.loc10_34: <bound method> = bound_method %.loc10_32, %.1 [template = constants.%.12]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_34(%.loc10_32, %.loc10_36) [template = constants.%.13]
// CHECK:STDOUT: %.loc10_26: i32 = int_literal 3 [template = constants.%.9]
// 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: %.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)
// CHECK:STDOUT: %.loc10_37.2: i32 = int_literal 0 [template = constants.%.15]
// CHECK:STDOUT: %.loc10_37.2: i32 = int_literal 0 [template = constants.%.16]
// CHECK:STDOUT: %.loc10_37.3: ref i32 = array_index file.%arr.var, %.loc10_37.2
// CHECK:STDOUT: %.loc10_37.4: init i32 = initialize_from %.loc10_26 to %.loc10_37.3 [template = constants.%.8]
// CHECK:STDOUT: %.loc10_37.5: i32 = int_literal 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc10_37.4: init i32 = initialize_from %.loc10_26 to %.loc10_37.3 [template = constants.%.9]
// CHECK:STDOUT: %.loc10_37.5: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc10_37.6: ref i32 = array_index file.%arr.var, %.loc10_37.5
// CHECK:STDOUT: %.loc10_37.7: init i32 = initialize_from %.loc10_29 to %.loc10_37.6 [template = constants.%.11]
// CHECK:STDOUT: %.loc10_37.8: i32 = int_literal 2 [template = constants.%.4]
// CHECK:STDOUT: %.loc10_37.7: init i32 = initialize_from %.loc10_29 to %.loc10_37.6 [template = constants.%.12]
// CHECK:STDOUT: %.loc10_37.8: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc10_37.9: ref i32 = array_index file.%arr.var, %.loc10_37.8
// CHECK:STDOUT: %.loc10_37.10: init i32 = initialize_from %int.sadd to %.loc10_37.9 [template = constants.%.13]
// CHECK:STDOUT: %.loc10_37.10: init i32 = initialize_from %int.sadd to %.loc10_37.9 [template = constants.%.14]
// CHECK:STDOUT: %.loc10_37.11: init [i32; 3] = array_init (%.loc10_37.4, %.loc10_37.7, %.loc10_37.10) to file.%arr.var [template = constants.%array]
// CHECK:STDOUT: %.loc10_38: init [i32; 3] = converted %.loc10_37.1, %.loc10_37.11 [template = constants.%array]
// CHECK:STDOUT: assign file.%arr.var, %.loc10_38
@@ -8,13 +8,19 @@ 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: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Add = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Add = %Add
// CHECK:STDOUT: .Add = %Add.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Add: <function> = fn_decl @Add [template] {
// CHECK:STDOUT: %Add.decl: Add = fn_decl @Add [template = constants.%struct] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
@@ -35,50 +35,60 @@ 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: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: A = struct_value () [template]
// CHECK:STDOUT: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A.loc7
// CHECK:STDOUT: .B = %B.loc17
// CHECK:STDOUT: .C = %C.loc27
// CHECK:STDOUT: .A = %A.decl.loc7
// CHECK:STDOUT: .B = %B.decl.loc17
// CHECK:STDOUT: .C = %C.decl.loc27
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.loc7: <function> = fn_decl @A [template] {
// CHECK:STDOUT: %A.decl.loc7: A = fn_decl @A [template = constants.%struct.1] {
// 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: %m.loc7_14.1: i32 = param m
// CHECK:STDOUT: %m.loc7_14.2: i32 = bind_name m, %m.loc7_14.1
// CHECK:STDOUT: %return.var.loc7: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.loc15: <function> = fn_decl @A [template] {
// CHECK:STDOUT: %A.decl.loc15: A = fn_decl @A [template = constants.%struct.1] {
// CHECK:STDOUT: %n.loc15_6.1: i32 = param n
// CHECK:STDOUT: @A.%n: i32 = bind_name n, %n.loc15_6.1
// CHECK:STDOUT: %m.loc15_14.1: i32 = param m
// CHECK:STDOUT: @A.%m: i32 = bind_name m, %m.loc15_14.1
// CHECK:STDOUT: @A.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %B.loc17: <function> = fn_decl @B [template] {
// CHECK:STDOUT: %B.decl.loc17: B = fn_decl @B [template = constants.%struct.2] {
// 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: %m.loc17_14.1: i32 = param m
// CHECK:STDOUT: %m.loc17_14.2: i32 = bind_name m, %m.loc17_14.1
// CHECK:STDOUT: %return.var.loc17: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %B.loc25: <function> = fn_decl @B [template] {
// CHECK:STDOUT: %B.decl.loc25: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %n.loc25_6.1: i32 = param n
// CHECK:STDOUT: @B.%n: i32 = bind_name n, %n.loc25_6.1
// CHECK:STDOUT: %m.loc25_14.1: i32 = param m
// CHECK:STDOUT: @B.%m: i32 = bind_name m, %m.loc25_14.1
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.loc27: <function> = fn_decl @C [template] {
// CHECK:STDOUT: %C.decl.loc27: C = fn_decl @C [template = constants.%struct.3] {
// 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: %m.loc27_14.1: i32 = param m
// CHECK:STDOUT: %m.loc27_14.2: i32 = bind_name m, %m.loc27_14.1
// CHECK:STDOUT: %return.var.loc27: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.loc34: <function> = fn_decl @C [template] {
// CHECK:STDOUT: %C.decl.loc34: C = fn_decl @C [template = constants.%struct.3] {
// CHECK:STDOUT: %n.loc34_6.1: i32 = param n
// CHECK:STDOUT: @C.%n: i32 = bind_name n, %n.loc34_6.1
// CHECK:STDOUT: %m.loc34_14.1: i32 = param m
@@ -11,13 +11,19 @@ fn UnknownBuiltin() = "unknown.builtin.name";
// CHECK:STDOUT: --- fail_unknown.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %UnknownBuiltin: type = fn_type @UnknownBuiltin [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: UnknownBuiltin = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .UnknownBuiltin = %UnknownBuiltin
// CHECK:STDOUT: .UnknownBuiltin = %UnknownBuiltin.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %UnknownBuiltin: <function> = fn_decl @UnknownBuiltin [template] {}
// CHECK:STDOUT: %UnknownBuiltin.decl: UnknownBuiltin = fn_decl @UnknownBuiltin [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @UnknownBuiltin();
+34 -25
View File
@@ -20,11 +20,17 @@ var arr: [i32; Core.Add(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: --- core.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Add: type = fn_type @Add [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Add = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Add = %Add
// CHECK:STDOUT: .Add = %Add.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Add: <function> = fn_decl @Add [template] {
// CHECK:STDOUT: %Add.decl: Add = fn_decl @Add [template = constants.%struct] {
// CHECK:STDOUT: %a.loc6_8.1: i32 = param a
// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc6_8.1
// CHECK:STDOUT: %b.loc6_16.1: i32 = param b
@@ -38,14 +44,17 @@ var arr: [i32; Core.Add(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: --- use.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template]
// CHECK:STDOUT: %.5: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.6: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.7: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.1, %.2, %.3) [template]
// CHECK:STDOUT: %Add: type = fn_type @Add [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: 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]
// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template]
// CHECK:STDOUT: %.6: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.8: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.2, %.3, %.4) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -55,12 +64,12 @@ var arr: [i32; Core.Add(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, %Core [template = %Core]
// CHECK:STDOUT: %import_ref: <function> = import_ref ir2, inst+6, loc_11 [template = imports.%Add]
// CHECK:STDOUT: %Add.ref: <function> = name_ref Add, %import_ref [template = imports.%Add]
// CHECK:STDOUT: %.loc4_25: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc4_28: i32 = int_literal 2 [template = constants.%.2]
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc4_25, %.loc4_28) [template = constants.%.3]
// CHECK:STDOUT: %.loc4_30: type = array_type %int.sadd, i32 [template = constants.%.4]
// CHECK:STDOUT: %import_ref: Add = import_ref ir2, inst+6, loc_11 [template = constants.%struct]
// CHECK:STDOUT: %Add.ref: Add = name_ref Add, %import_ref [template = constants.%struct]
// CHECK:STDOUT: %.loc4_25: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_28: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc4_25, %.loc4_28) [template = constants.%.4]
// CHECK:STDOUT: %.loc4_30: 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: }
@@ -69,19 +78,19 @@ var arr: [i32; Core.Add(1, 2)] = (1, 2, 3);
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc4_35: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc4_38: i32 = int_literal 2 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_41: i32 = int_literal 3 [template = constants.%.3]
// CHECK:STDOUT: %.loc4_35: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_38: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %.loc4_41: i32 = int_literal 3 [template = constants.%.4]
// CHECK:STDOUT: %.loc4_42.1: (i32, i32, i32) = tuple_literal (%.loc4_35, %.loc4_38, %.loc4_41)
// CHECK:STDOUT: %.loc4_42.2: i32 = int_literal 0 [template = constants.%.7]
// CHECK:STDOUT: %.loc4_42.2: i32 = int_literal 0 [template = constants.%.8]
// CHECK:STDOUT: %.loc4_42.3: ref i32 = array_index file.%arr.var, %.loc4_42.2
// CHECK:STDOUT: %.loc4_42.4: init i32 = initialize_from %.loc4_35 to %.loc4_42.3 [template = constants.%.1]
// CHECK:STDOUT: %.loc4_42.5: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc4_42.4: init i32 = initialize_from %.loc4_35 to %.loc4_42.3 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_42.5: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_42.6: ref i32 = array_index file.%arr.var, %.loc4_42.5
// CHECK:STDOUT: %.loc4_42.7: init i32 = initialize_from %.loc4_38 to %.loc4_42.6 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_42.8: i32 = int_literal 2 [template = constants.%.2]
// CHECK:STDOUT: %.loc4_42.7: init i32 = initialize_from %.loc4_38 to %.loc4_42.6 [template = constants.%.3]
// CHECK:STDOUT: %.loc4_42.8: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %.loc4_42.9: ref i32 = array_index file.%arr.var, %.loc4_42.8
// CHECK:STDOUT: %.loc4_42.10: init i32 = initialize_from %.loc4_41 to %.loc4_42.9 [template = constants.%.3]
// CHECK:STDOUT: %.loc4_42.10: init i32 = initialize_from %.loc4_41 to %.loc4_42.9 [template = constants.%.4]
// CHECK:STDOUT: %.loc4_42.11: init [i32; 3] = array_init (%.loc4_42.4, %.loc4_42.7, %.loc4_42.10) to file.%arr.var [template = constants.%array]
// CHECK:STDOUT: %.loc4_43: init [i32; 3] = converted %.loc4_42.1, %.loc4_42.11 [template = constants.%array]
// CHECK:STDOUT: assign file.%arr.var, %.loc4_43
+27 -22
View File
@@ -19,15 +19,20 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = interface_type @I [template]
// CHECK:STDOUT: %Self: I = bind_symbolic_name Self 0 [symbolic]
// CHECK:STDOUT: %.2: type = assoc_entity_type @I, <function> [template]
// CHECK:STDOUT: %.3: <associated <function> in I> = assoc_entity element0, @I.%F [template]
// CHECK:STDOUT: %.4: <witness> = interface_witness (@impl.%F) [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: <bound method> = bound_method %.5, @impl.%F [template]
// CHECK:STDOUT: %.7: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.8: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.9: type = array_type %.8, i32 [template]
// CHECK:STDOUT: %.10: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %F.1: type = fn_type @F.1 [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// 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: %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: %.6: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.7: <bound method> = bound_method %.6, %struct.2 [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]
// CHECK:STDOUT: %.11: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -41,21 +46,21 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %I.ref.loc11: type = name_ref I, %I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc15_16: i32 = int_literal 1 [template = constants.%.5]
// 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 <function> in I> = name_ref F, @I.%.loc8_40 [template = constants.%.3]
// CHECK:STDOUT: %.1: <function> = interface_witness_access @impl.%.1, element0 [template = @impl.%F]
// CHECK:STDOUT: %.loc15_17: <bound method> = bound_method %.loc15_16, %.1 [template = constants.%.6]
// CHECK:STDOUT: %.loc15_24: i32 = int_literal 2 [template = constants.%.7]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc15_17(%.loc15_16, %.loc15_24) [template = constants.%.8]
// CHECK:STDOUT: %.loc15_26: type = array_type %int.sadd, i32 [template = constants.%.9]
// 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: %.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_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
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @I {
// CHECK:STDOUT: %Self: I = bind_symbolic_name Self 0 [symbolic = constants.%Self]
// CHECK:STDOUT: %F: <function> = fn_decl @F.1 [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F.1 [template = constants.%struct.1] {
// CHECK:STDOUT: %Self.ref.loc8_14: I = name_ref Self, %Self [symbolic = constants.%Self]
// CHECK:STDOUT: %.loc8_14.1: type = facet_type_access %Self.ref.loc8_14 [symbolic = constants.%Self]
// CHECK:STDOUT: %.loc8_14.2: type = converted %Self.ref.loc8_14, %.loc8_14.1 [symbolic = constants.%Self]
@@ -71,26 +76,26 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: %.loc8_36.2: type = converted %Self.ref.loc8_36, %.loc8_36.1 [symbolic = constants.%Self]
// CHECK:STDOUT: %return.var: ref Self = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc8_40: <associated <function> in I> = assoc_entity element0, %F [template = constants.%.3]
// CHECK:STDOUT: %.loc8_40: <associated F in I> = assoc_entity element0, %F.decl [template = constants.%.4]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
// CHECK:STDOUT: .F = %.loc8_40
// CHECK:STDOUT: witness = (%F)
// CHECK:STDOUT: witness = (%F.decl)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: i32 as I {
// CHECK:STDOUT: %F: <function> = fn_decl @F.2 [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F.2 [template = constants.%struct.2] {
// 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: %other.loc12_19.1: i32 = param other
// CHECK:STDOUT: %other.loc12_19.2: i32 = bind_name other, %other.loc12_19.1
// CHECK:STDOUT: %return.var: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.1: <witness> = interface_witness (%F) [template = constants.%.4]
// CHECK:STDOUT: %.1: <witness> = interface_witness (%F.decl) [template = constants.%.5]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: witness = %.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -14,24 +14,27 @@ fn Run() {
// CHECK:STDOUT: --- fail_not_callable.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = ptr_type String [template]
// CHECK:STDOUT: %.2: String = string_literal "hello" [template]
// CHECK:STDOUT: %Run: type = fn_type @Run [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Run = struct_value () [template]
// CHECK:STDOUT: %.2: type = ptr_type String [template]
// CHECK:STDOUT: %.3: String = string_literal "hello" [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Run = %Run
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// 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.%.2]
// CHECK:STDOUT: %.loc11: String = string_literal "hello" [template = constants.%.3]
// CHECK:STDOUT: assign %x.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -63,32 +63,40 @@ fn Main() {
// CHECK:STDOUT: --- fail_param_count.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// 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: %Run1: type = fn_type @Run1 [template]
// CHECK:STDOUT: %struct.2: Run1 = struct_value () [template]
// CHECK:STDOUT: %Run2: type = fn_type @Run2 [template]
// CHECK:STDOUT: %struct.3: Run2 = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.4: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 0 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Run0 = %Run0
// CHECK:STDOUT: .Run1 = %Run1
// CHECK:STDOUT: .Run2 = %Run2
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Run0 = %Run0.decl
// CHECK:STDOUT: .Run1 = %Run1.decl
// CHECK:STDOUT: .Run2 = %Run2.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Run0: <function> = fn_decl @Run0 [template] {}
// CHECK:STDOUT: %Run1: <function> = fn_decl @Run1 [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: %a.loc8_9.1: i32 = param a
// CHECK:STDOUT: @Run1.%a: i32 = bind_name a, %a.loc8_9.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %Run2: <function> = fn_decl @Run2 [template] {
// CHECK:STDOUT: %Run2.decl: Run2 = fn_decl @Run2 [template = constants.%struct.3] {
// CHECK:STDOUT: %a.loc9_9.1: i32 = param a
// CHECK:STDOUT: @Run2.%a: i32 = bind_name a, %a.loc9_9.1
// 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: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.4] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run0() {
@@ -108,22 +116,22 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Run0.ref.loc19: <function> = name_ref Run0, file.%Run0 [template = file.%Run0]
// CHECK:STDOUT: %.loc19: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %Run0.ref.loc19: Run0 = name_ref Run0, file.%Run0.decl [template = constants.%struct.1]
// CHECK:STDOUT: %.loc19: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Run0.call.loc19: init () = call %Run0.ref.loc19(<invalid>) [template = <error>]
// CHECK:STDOUT: %Run0.ref.loc27: <function> = name_ref Run0, file.%Run0 [template = file.%Run0]
// CHECK:STDOUT: %Run0.ref.loc27: Run0 = name_ref Run0, file.%Run0.decl [template = constants.%struct.1]
// CHECK:STDOUT: %.loc27_8: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc27_11: i32 = int_literal 1 [template = constants.%.1]
// 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: <function> = name_ref Run1, file.%Run1 [template = file.%Run1]
// CHECK:STDOUT: %Run1.ref.loc36: Run1 = name_ref Run1, file.%Run1.decl [template = constants.%struct.2]
// CHECK:STDOUT: %Run1.call.loc36: init () = call %Run1.ref.loc36(<invalid>) [template = <error>]
// CHECK:STDOUT: %Run1.ref.loc44: <function> = name_ref Run1, file.%Run1 [template = file.%Run1]
// CHECK:STDOUT: %Run1.ref.loc44: Run1 = name_ref Run1, file.%Run1.decl [template = constants.%struct.2]
// CHECK:STDOUT: %.loc44_8: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc44_11: i32 = int_literal 1 [template = constants.%.1]
// 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: <function> = name_ref Run2, file.%Run2 [template = file.%Run2]
// CHECK:STDOUT: %Run2.ref.loc53: Run2 = name_ref Run2, file.%Run2.decl [template = constants.%struct.3]
// CHECK:STDOUT: %Run2.call.loc53: init () = call %Run2.ref.loc53(<invalid>) [template = <error>]
// CHECK:STDOUT: %Run2.ref.loc60: <function> = name_ref Run2, file.%Run2 [template = file.%Run2]
// CHECK:STDOUT: %Run2.ref.loc60: Run2 = name_ref Run2, file.%Run2.decl [template = constants.%struct.3]
// 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,22 +19,26 @@ fn F() {
// CHECK:STDOUT: --- fail_param_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: f64 = float_literal 1 [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %G: type = fn_type @G [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: G = struct_value () [template]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %struct.2: F = struct_value () [template]
// CHECK:STDOUT: %.2: f64 = float_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .G = %G
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %G: <function> = fn_decl @G [template] {
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.1] {
// 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: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G(%a: i32) {
@@ -44,8 +48,8 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %G.ref: <function> = name_ref G, file.%G [template = file.%G]
// CHECK:STDOUT: %.loc16: f64 = float_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %G.ref: G = name_ref G, file.%G.decl [template = constants.%struct.1]
// CHECK:STDOUT: %.loc16: f64 = float_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %G.call: init () = call %G.ref(<invalid>) [template = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -16,25 +16,30 @@ fn Run() {
// CHECK:STDOUT: --- fail_return_type_mismatch.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: f64 = float_literal 1 [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: %Run: type = fn_type @Run [template]
// CHECK:STDOUT: %struct.2: Run = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Run = %Run
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: @Foo.%return: ref f64 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Run: <function> = fn_decl @Run [template] {}
// CHECK:STDOUT: %Run.decl: Run = fn_decl @Run [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo() -> f64 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc7: f64 = float_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc7: f64 = float_literal 1 [template = constants.%.2]
// CHECK:STDOUT: return %.loc7
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -42,7 +47,7 @@ fn Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %x.var: ref i32 = var x
// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var
// CHECK:STDOUT: %Foo.ref: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.call: init f64 = call %Foo.ref()
// CHECK:STDOUT: assign %x.var, <error>
// CHECK:STDOUT: return
+12 -7
View File
@@ -15,22 +15,27 @@ fn Main() {
// CHECK:STDOUT: --- i32.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %Echo: type = fn_type @Echo [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: Echo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Echo = %Echo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Echo = %Echo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Echo: <function> = fn_decl @Echo [template] {
// CHECK:STDOUT: %Echo.decl: Echo = fn_decl @Echo [template = constants.%struct.1] {
// CHECK:STDOUT: %a.loc7_9.1: i32 = param a
// CHECK:STDOUT: @Echo.%a: i32 = bind_name a, %a.loc7_9.1
// CHECK:STDOUT: @Echo.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Echo(%a: i32) -> i32 {
@@ -43,8 +48,8 @@ fn Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %b.var: ref i32 = var b
// CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
// CHECK:STDOUT: %Echo.ref: <function> = name_ref Echo, file.%Echo [template = file.%Echo]
// CHECK:STDOUT: %.loc12: i32 = int_literal 1 [template = constants.%.1]
// 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: assign %b.var, %Echo.call
// CHECK:STDOUT: return
+20 -16
View File
@@ -15,29 +15,33 @@ fn Main() {
// CHECK:STDOUT: --- more_param_ir.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type (type) [template]
// CHECK:STDOUT: %.2: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.3: i32 = int_literal 1 [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.3) [template]
// CHECK:STDOUT: %.4: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 6 [template]
// CHECK:STDOUT: %.6: type = tuple_type () [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: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: 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]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.4) [template]
// CHECK:STDOUT: %.5: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 6 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// 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: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
@@ -48,19 +52,19 @@ fn Main() {
// 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.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc10_15.2: 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.%.3]
// CHECK:STDOUT: %.loc10_20: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc10_22.1: (i32,) = tuple_literal (%.loc10_20)
// 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: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %x.ref: ref (i32,) = name_ref x, %x
// CHECK:STDOUT: %.loc12_9: i32 = int_literal 0 [template = constants.%.4]
// CHECK:STDOUT: %.loc12_9: i32 = int_literal 0 [template = constants.%.5]
// CHECK:STDOUT: %.loc12_10.1: ref i32 = tuple_index %x.ref, %.loc12_9
// CHECK:STDOUT: %.loc12_13: i32 = int_literal 6 [template = constants.%.5]
// CHECK:STDOUT: %.loc12_13: i32 = int_literal 6 [template = constants.%.6]
// CHECK:STDOUT: %.loc12_10.2: i32 = bind_value %.loc12_10.1
// CHECK:STDOUT: %Foo.call: init () = call %Foo.ref(%.loc12_10.2, %.loc12_13)
// CHECK:STDOUT: return
@@ -16,23 +16,27 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %tuple: () = tuple_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct.1] {
// CHECK:STDOUT: %.loc7_12.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc7_12.2: type = converted %.loc7_12.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: @A.%return: ref () = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.ref: <function> = name_ref A, %A [template = %A]
// CHECK:STDOUT: %B: <function> = bind_alias B, %A [template = %A]
// CHECK:STDOUT: %Main: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %A.ref: A = name_ref A, %A.decl [template = constants.%struct.1]
// CHECK:STDOUT: %B: A = bind_alias B, %A.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() -> () {
@@ -49,7 +53,7 @@ fn Main() {
// CHECK:STDOUT: %.loc12_11.2: type = converted %.loc12_11.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %b.var: ref () = var b
// CHECK:STDOUT: %b: ref () = bind_name b, %b.var
// CHECK:STDOUT: %B.ref: <function> = name_ref B, file.%B [template = file.%A]
// CHECK:STDOUT: %B.ref: A = name_ref B, file.%B [template = constants.%struct.1]
// CHECK:STDOUT: %A.call: init () = call %B.ref()
// CHECK:STDOUT: assign %b.var, %A.call
// CHECK:STDOUT: return
@@ -16,16 +16,20 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = struct_type {} [template]
// CHECK:STDOUT: %Echo: type = fn_type @Echo [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %struct: {} = struct_value () [template]
// CHECK:STDOUT: %struct.1: Echo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %struct.3: {} = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Echo = %Echo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Echo = %Echo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Echo: <function> = fn_decl @Echo [template] {
// CHECK:STDOUT: %Echo.decl: Echo = fn_decl @Echo [template = constants.%struct.1] {
// CHECK:STDOUT: %.loc7_13.1: {} = struct_literal ()
// CHECK:STDOUT: %.loc7_13.2: type = converted %.loc7_13.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.loc7_9.1: {} = param a
@@ -34,7 +38,7 @@ fn Main() {
// CHECK:STDOUT: %.loc7_20.2: type = converted %.loc7_20.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: @Echo.%return: ref {} = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Echo(%a: {}) -> {} {
@@ -45,10 +49,10 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Echo.ref: <function> = name_ref Echo, file.%Echo [template = file.%Echo]
// CHECK:STDOUT: %Echo.ref: Echo = name_ref Echo, file.%Echo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %.loc12_9: {} = struct_literal ()
// CHECK:STDOUT: %struct: {} = struct_value () [template = constants.%struct]
// CHECK:STDOUT: %.loc12_7: {} = converted %.loc12_9, %struct [template = constants.%struct]
// CHECK:STDOUT: %struct: {} = struct_value () [template = constants.%struct.3]
// CHECK:STDOUT: %.loc12_7: {} = converted %.loc12_9, %struct [template = constants.%struct.3]
// CHECK:STDOUT: %Echo.call: init {} = call %Echo.ref(%.loc12_7)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -16,15 +16,19 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Echo: type = fn_type @Echo [template]
// CHECK:STDOUT: %struct.1: Echo = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %tuple: () = tuple_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Echo = %Echo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Echo = %Echo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Echo: <function> = fn_decl @Echo [template] {
// CHECK:STDOUT: %Echo.decl: Echo = fn_decl @Echo [template = constants.%struct.1] {
// CHECK:STDOUT: %.loc7_13.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc7_13.2: type = converted %.loc7_13.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %a.loc7_9.1: () = param a
@@ -33,7 +37,7 @@ fn Main() {
// CHECK:STDOUT: %.loc7_20.2: type = converted %.loc7_20.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: @Echo.%return: ref () = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Main: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Echo(%a: ()) -> () {
@@ -44,7 +48,7 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Echo.ref: <function> = name_ref Echo, file.%Echo [template = file.%Echo]
// CHECK:STDOUT: %Echo.ref: Echo = name_ref Echo, file.%Echo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %.loc12_9: () = tuple_literal ()
// CHECK:STDOUT: %tuple: () = tuple_value () [template = constants.%tuple]
// CHECK:STDOUT: %.loc12_7: () = converted %.loc12_9, %tuple [template = constants.%tuple]
@@ -13,16 +13,20 @@ fn Main() {
// CHECK:STDOUT: --- params_zero.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {}
// CHECK:STDOUT: %Main: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo() {
@@ -32,7 +36,7 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %Foo.call: init () = call %Foo.ref()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -14,16 +14,20 @@ fn Main() {
// CHECK:STDOUT: --- return_implicit.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %MakeImplicitEmptyTuple: type = fn_type @MakeImplicitEmptyTuple [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: MakeImplicitEmptyTuple = struct_value () [template]
// CHECK:STDOUT: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .MakeImplicitEmptyTuple = %MakeImplicitEmptyTuple
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .MakeImplicitEmptyTuple = %MakeImplicitEmptyTuple.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %MakeImplicitEmptyTuple: <function> = fn_decl @MakeImplicitEmptyTuple [template] {}
// CHECK:STDOUT: %Main: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %MakeImplicitEmptyTuple.decl: MakeImplicitEmptyTuple = fn_decl @MakeImplicitEmptyTuple [template = constants.%struct.1] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MakeImplicitEmptyTuple() {
@@ -37,7 +41,7 @@ fn Main() {
// CHECK:STDOUT: %.loc11_11.2: type = converted %.loc11_11.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %b.var: ref () = var b
// CHECK:STDOUT: %b: ref () = bind_name b, %b.var
// CHECK:STDOUT: %MakeImplicitEmptyTuple.ref: <function> = name_ref MakeImplicitEmptyTuple, file.%MakeImplicitEmptyTuple [template = file.%MakeImplicitEmptyTuple]
// CHECK:STDOUT: %MakeImplicitEmptyTuple.ref: MakeImplicitEmptyTuple = name_ref MakeImplicitEmptyTuple, file.%MakeImplicitEmptyTuple.decl [template = constants.%struct.1]
// CHECK:STDOUT: %MakeImplicitEmptyTuple.call: init () = call %MakeImplicitEmptyTuple.ref()
// CHECK:STDOUT: assign %b.var, %MakeImplicitEmptyTuple.call
// CHECK:STDOUT: return
+12 -8
View File
@@ -13,22 +13,26 @@ fn Main() {
// CHECK:STDOUT: --- params_one.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: type = tuple_type () [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: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// 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: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32) {
@@ -38,8 +42,8 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Foo.call: init () = call %Foo.ref(%.loc10)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -14,22 +14,26 @@ fn Main() {
// CHECK:STDOUT: --- params_one_comma.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: type = tuple_type () [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: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// 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: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32) {
@@ -39,11 +43,11 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref.loc10: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %.loc10: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %Foo.ref.loc10: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// 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: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %.loc11: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %Foo.ref.loc11: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// CHECK:STDOUT: %.loc11: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %Foo.call.loc11: init () = call %Foo.ref.loc11(%.loc11)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+14 -10
View File
@@ -13,25 +13,29 @@ fn Main() {
// CHECK:STDOUT: --- params_two.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.3: type = tuple_type () [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: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// 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: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
@@ -41,9 +45,9 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc10_10: i32 = int_literal 2 [template = constants.%.2]
// CHECK:STDOUT: %Foo.ref: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// 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)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -14,25 +14,29 @@ fn Main() {
// CHECK:STDOUT: --- params_two_comma.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.3: type = tuple_type () [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: %Main: type = fn_type @Main [template]
// CHECK:STDOUT: %struct.2: Main = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Main = %Main
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Main = %Main.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// 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: <function> = fn_decl @Main [template] {}
// CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%a: i32, %b: i32) {
@@ -42,13 +46,13 @@ fn Main() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref.loc10: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %.loc10_7: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc10_10: i32 = int_literal 2 [template = constants.%.2]
// CHECK:STDOUT: %Foo.ref.loc10: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// 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: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
// CHECK:STDOUT: %.loc11_7: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc11_10: i32 = int_literal 2 [template = constants.%.2]
// CHECK:STDOUT: %Foo.ref.loc11: Foo = name_ref Foo, file.%Foo.decl [template = constants.%struct.1]
// 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)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -11,13 +11,19 @@ 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: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %n.loc10_6.1: i32 = param n
// CHECK:STDOUT: @F.%n: i32 = bind_name n, %n.loc10_6.1
// CHECK:STDOUT: %n.ref: i32 = name_ref n, @F.%n
@@ -14,13 +14,19 @@ 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: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// 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: %n.loc13_14.1: i32 = param n
+258 -178
View File
@@ -387,40 +387,51 @@ import library "extern_api";
// CHECK:STDOUT: --- api.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type (type) [template]
// CHECK:STDOUT: %.2: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .B = %B
// CHECK:STDOUT: .C = %C
// CHECK:STDOUT: .D = %D
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %B: <function> = fn_decl @B [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: %b.loc5_6.1: i32 = param b
// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_6.1
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C: <function> = fn_decl @C [template] {
// 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.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc6_14.2: 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: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.3]
// 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: <function> = fn_decl @D [template] {}
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
// CHECK:STDOUT: %NS: <namespace> = namespace [template] {
// CHECK:STDOUT: .E = %E
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %E: <function> = fn_decl @E [template] {}
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.5] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
@@ -436,40 +447,51 @@ import library "extern_api";
// CHECK:STDOUT: --- extern_api.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type (type) [template]
// CHECK:STDOUT: %.2: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .B = %B
// CHECK:STDOUT: .C = %C
// CHECK:STDOUT: .D = %D
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %B: <function> = fn_decl @B [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: %b.loc5_13.1: i32 = param b
// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_13.1
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C: <function> = fn_decl @C [template] {
// 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.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc6_21.2: 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: %.loc6_35: type = struct_type {.c: i32} [template = constants.%.3]
// 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: <function> = fn_decl @D [template] {}
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
// CHECK:STDOUT: %NS: <namespace> = namespace [template] {
// CHECK:STDOUT: .E = %E
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %E: <function> = fn_decl @E [template] {}
// CHECK:STDOUT: %E.decl: E = fn_decl @E [template = constants.%struct.5] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
@@ -486,10 +508,20 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %tuple: (i32,) = tuple_value (%.2) [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -506,15 +538,15 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loc_15 [template = imports.%A]
// CHECK:STDOUT: %import_ref.2: <function> = import_ref ir1, inst+6, loc_24 [template = imports.%B]
// CHECK:STDOUT: %import_ref.3: <function> = import_ref ir1, inst+18, loc_39 [template = imports.%C]
// CHECK:STDOUT: %import_ref.4: <function> = import_ref ir1, inst+19, loc_53 [template = imports.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_24 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_39 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_53 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: <function> = import_ref ir1, inst+21, loc_65 [template = imports.%E]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_65 [template = constants.%struct.5]
// 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]
@@ -547,25 +579,25 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%import_ref.1 [template = imports.%A]
// 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: <function> = name_ref B, file.%import_ref.2 [template = imports.%B]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
// 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: <function> = name_ref C, file.%import_ref.3 [template = imports.%C]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
// 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: <function> = name_ref D, file.%import_ref.4 [template = imports.%D]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.4]
// 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: <function> = name_ref E, file.%import_ref.6 [template = imports.%E]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.5]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -574,10 +606,20 @@ import library "extern_api";
// CHECK:STDOUT: --- redecl_api.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type (type) [template]
// CHECK:STDOUT: %.2: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %.4: type = tuple_type () [template]
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.5) [template]
// CHECK:STDOUT: }
@@ -586,57 +628,57 @@ import library "extern_api";
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .B = %B
// CHECK:STDOUT: .C = %C
// CHECK:STDOUT: .D = %D
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .b = %b.loc13
// CHECK:STDOUT: .c = %c.loc14
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loaded [template = imports.%A]
// CHECK:STDOUT: %import_ref.2: <function> = import_ref ir1, inst+6, loaded [template = imports.%B]
// CHECK:STDOUT: %import_ref.3: <function> = import_ref ir1, inst+18, loaded [template = imports.%C]
// CHECK:STDOUT: %import_ref.4: <function> = import_ref ir1, inst+19, loaded [template = imports.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %E
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: <function> = import_ref ir1, inst+21, loaded [template = imports.%E]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %B: <function> = fn_decl @B [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: %b.loc7_13.1: i32 = param b
// CHECK:STDOUT: %b.loc7_13.2: i32 = bind_name b, %b.loc7_13.1
// CHECK:STDOUT: %return.var.loc7: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C: <function> = fn_decl @C [template] {
// 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.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc8_21.2: 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: %.loc8_35: type = struct_type {.c: i32} [template = constants.%.3]
// 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: <function> = fn_decl @D [template] {}
// CHECK:STDOUT: %E: <function> = fn_decl @E [template] {}
// 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: %.loc12_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.4 [template = constants.%.4]
// 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: %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.%.3]
// CHECK:STDOUT: %.loc14: 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 ()
// CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%.4 [template = constants.%.4]
// CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %d.var: ref () = var d
// CHECK:STDOUT: %d: ref () = bind_name d, %d.var
// CHECK:STDOUT: %.loc16_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc16_9.2: type = converted %.loc16_9.1, constants.%.4 [template = constants.%.4]
// CHECK:STDOUT: %.loc16_9.2: type = converted %.loc16_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %e.var: ref () = var e
// CHECK:STDOUT: %e: ref () = bind_name e, %e.var
// CHECK:STDOUT: }
@@ -653,25 +695,25 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%A [template = file.%A]
// 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: <function> = name_ref B, file.%B [template = file.%B]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%B.decl [template = constants.%struct.2]
// 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: <function> = name_ref C, file.%C [template = file.%C]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%C.decl [template = constants.%struct.3]
// 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: <function> = name_ref D, file.%D [template = file.%D]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%D.decl [template = constants.%struct.4]
// 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: <function> = name_ref E, file.%E [template = file.%E]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%E.decl [template = constants.%struct.5]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -680,10 +722,20 @@ import library "extern_api";
// CHECK:STDOUT: --- redecl_extern_api.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type (type) [template]
// CHECK:STDOUT: %.2: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %.4: type = tuple_type () [template]
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.5) [template]
// CHECK:STDOUT: }
@@ -692,57 +744,57 @@ import library "extern_api";
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .B = %B
// CHECK:STDOUT: .C = %C
// CHECK:STDOUT: .D = %D
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .b = %b.loc13
// CHECK:STDOUT: .c = %c.loc14
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loaded [template = imports.%A]
// CHECK:STDOUT: %import_ref.2: <function> = import_ref ir1, inst+6, loaded [template = imports.%B]
// CHECK:STDOUT: %import_ref.3: <function> = import_ref ir1, inst+18, loaded [template = imports.%C]
// CHECK:STDOUT: %import_ref.4: <function> = import_ref ir1, inst+19, loaded [template = imports.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %E
// CHECK:STDOUT: .E = %E.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: <function> = import_ref ir1, inst+21, loaded [template = imports.%E]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loaded [template = constants.%struct.5]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %B: <function> = fn_decl @B [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: %b.loc7_13.1: i32 = param b
// CHECK:STDOUT: %b.loc7_13.2: i32 = bind_name b, %b.loc7_13.1
// CHECK:STDOUT: %return.var.loc7: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C: <function> = fn_decl @C [template] {
// 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.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc8_21.2: 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: %.loc8_35: type = struct_type {.c: i32} [template = constants.%.3]
// 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: <function> = fn_decl @D [template] {}
// CHECK:STDOUT: %E: <function> = fn_decl @E [template] {}
// 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: %.loc12_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc12_9.2: type = converted %.loc12_9.1, constants.%.4 [template = constants.%.4]
// 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: %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.%.3]
// CHECK:STDOUT: %.loc14: 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 ()
// CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%.4 [template = constants.%.4]
// CHECK:STDOUT: %.loc15_9.2: type = converted %.loc15_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %d.var: ref () = var d
// CHECK:STDOUT: %d: ref () = bind_name d, %d.var
// CHECK:STDOUT: %.loc16_9.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc16_9.2: type = converted %.loc16_9.1, constants.%.4 [template = constants.%.4]
// CHECK:STDOUT: %.loc16_9.2: type = converted %.loc16_9.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %e.var: ref () = var e
// CHECK:STDOUT: %e: ref () = bind_name e, %e.var
// CHECK:STDOUT: }
@@ -759,25 +811,25 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%A [template = file.%A]
// 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: <function> = name_ref B, file.%B [template = file.%B]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%B.decl [template = constants.%struct.2]
// 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: <function> = name_ref C, file.%C [template = file.%C]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%C.decl [template = constants.%struct.3]
// 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: <function> = name_ref D, file.%D [template = file.%D]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%D.decl [template = constants.%struct.4]
// 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: <function> = name_ref E, file.%E [template = file.%E]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%E.decl [template = constants.%struct.5]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -787,10 +839,20 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %tuple: (i32,) = tuple_value (%.2) [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -807,20 +869,20 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loc_19 [template = imports.%A]
// CHECK:STDOUT: %import_ref.2: <function> = import_ref ir1, inst+6, loc_28 [template = imports.%B]
// CHECK:STDOUT: %import_ref.3: <function> = import_ref ir1, inst+18, loc_43 [template = imports.%C]
// CHECK:STDOUT: %import_ref.4: <function> = import_ref ir1, inst+19, loc_57 [template = imports.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_19 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_28 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_43 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_57 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: <function> = import_ref ir1, inst+21, loc_69 [template = imports.%E]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_69 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+6, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+18, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+21, 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: %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]
@@ -853,25 +915,25 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%import_ref.1 [template = imports.%A]
// 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: <function> = name_ref B, file.%import_ref.2 [template = imports.%B]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
// 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: <function> = name_ref C, file.%import_ref.3 [template = imports.%C]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
// 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: <function> = name_ref D, file.%import_ref.4 [template = imports.%D]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.4]
// 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: <function> = name_ref E, file.%import_ref.6 [template = imports.%E]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.5]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -881,10 +943,20 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %tuple: (i32,) = tuple_value (%.2) [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.5: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -901,20 +973,20 @@ import library "extern_api";
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: .e = %e
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loc_19 [template = imports.%A]
// CHECK:STDOUT: %import_ref.2: <function> = import_ref ir1, inst+6, loc_28 [template = imports.%B]
// CHECK:STDOUT: %import_ref.3: <function> = import_ref ir1, inst+18, loc_43 [template = imports.%C]
// CHECK:STDOUT: %import_ref.4: <function> = import_ref ir1, inst+19, loc_57 [template = imports.%D]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_19 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+9, loc_28 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+23, loc_43 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4: D = import_ref ir1, inst+26, loc_57 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+29, loaded
// CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6: <function> = import_ref ir1, inst+21, loc_69 [template = imports.%E]
// CHECK:STDOUT: %import_ref.6: E = import_ref ir1, inst+30, loc_69 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+6, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+18, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+21, 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: %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]
@@ -947,25 +1019,25 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%import_ref.1 [template = imports.%A]
// 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: <function> = name_ref B, file.%import_ref.2 [template = imports.%B]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
// 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: <function> = name_ref C, file.%import_ref.3 [template = imports.%C]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
// 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: <function> = name_ref D, file.%import_ref.4 [template = imports.%D]
// CHECK:STDOUT: %D.ref: D = name_ref D, file.%import_ref.4 [template = constants.%struct.4]
// 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: <function> = name_ref E, file.%import_ref.6 [template = imports.%E]
// CHECK:STDOUT: %E.ref: E = name_ref E, file.%import_ref.6 [template = constants.%struct.5]
// CHECK:STDOUT: %E.call: init () = call %E.ref()
// CHECK:STDOUT: assign file.%e.var, %E.call
// CHECK:STDOUT: return
@@ -975,6 +1047,8 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -985,30 +1059,30 @@ import library "extern_api";
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loc_15 [template = imports.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+18, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+19, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, 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: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%import_ref.1 [template = imports.%A]
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%import_ref.1 [template = constants.%struct]
// CHECK:STDOUT: %A.call: init () = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: return
@@ -1018,6 +1092,10 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %.2: type = fn_type @.1 [template]
// CHECK:STDOUT: %struct.2: <invalid> = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1030,21 +1108,21 @@ import library "extern_api";
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loc_15 [template = imports.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+18, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+19, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, 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: %.loc25: <function> = fn_decl @.1 [template] {
// CHECK:STDOUT: %.decl: <invalid> = fn_decl @.1 [template = constants.%struct.2] {
// CHECK:STDOUT: @.1.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -1055,7 +1133,7 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%import_ref.1 [template = imports.%A]
// 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: return
@@ -1065,6 +1143,8 @@ import library "extern_api";
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -1075,30 +1155,30 @@ import library "extern_api";
// CHECK:STDOUT: .NS = %NS
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loc_15 [template = imports.%A]
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+6, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+18, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+19, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, 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: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%import_ref.1 [template = imports.%A]
// CHECK:STDOUT: %A.ref: A = name_ref A, file.%import_ref.1 [template = constants.%struct]
// CHECK:STDOUT: %A.call: init () = call %A.ref()
// CHECK:STDOUT: assign file.%a.var, %A.call
// CHECK:STDOUT: return
@@ -1116,14 +1196,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+6, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+18, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+19, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1139,14 +1219,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+6, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+18, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+19, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -1162,19 +1242,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+6, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+18, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+19, unloaded
// CHECK:STDOUT: %import_ref.5: <namespace> = import_ref ir1, inst+20, loaded
// 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: %NS: <namespace> = namespace %import_ref.5, [template] {
// CHECK:STDOUT: .E = %import_ref.6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+30, unloaded
// CHECK:STDOUT: %import_ref.7 = import_ref ir2, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8 = import_ref ir2, inst+6, unloaded
// CHECK:STDOUT: %import_ref.9 = import_ref ir2, inst+18, unloaded
// CHECK:STDOUT: %import_ref.10 = import_ref ir2, inst+19, unloaded
// CHECK:STDOUT: %import_ref.11 = import_ref ir2, inst+21, 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: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -54,35 +54,53 @@ class C {
// CHECK:STDOUT: --- basic.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @F();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_redecl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F.loc4
// CHECK:STDOUT: .F = %F.decl.loc4
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.loc4: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.loc12: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl.loc4: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: %F.decl.loc12: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @F();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_redecl_extern.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F.loc12
// CHECK:STDOUT: .F = %F.decl.loc12
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.loc4: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.loc12: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl.loc4: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: %F.decl.loc12: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F();
@@ -91,7 +109,12 @@ class C {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %.1: type = struct_type {} [template]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %G: type = fn_type @G [template]
// CHECK:STDOUT: %struct.2: G = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -102,8 +125,8 @@ class C {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %G: <function> = fn_decl @G [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {}
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.2] {
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C]
// CHECK:STDOUT: %self.loc11_15.1: C = param self
// CHECK:STDOUT: %self.loc11_15.2: C = bind_name self, %self.loc11_15.1
@@ -111,8 +134,8 @@ class C {
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%C
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .G = %G
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F();
@@ -76,38 +76,49 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %D: type = class_type @D [template]
// CHECK:STDOUT: %.1: type = struct_type {} [template]
// CHECK:STDOUT: %ReturnCUnused: type = fn_type @ReturnCUnused [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: ReturnCUnused = struct_value () [template]
// CHECK:STDOUT: %ReturnCUsed: type = fn_type @ReturnCUsed [template]
// CHECK:STDOUT: %struct.2: ReturnCUsed = struct_value () [template]
// CHECK:STDOUT: %ReturnDUnused: type = fn_type @ReturnDUnused [template]
// CHECK:STDOUT: %struct.3: ReturnDUnused = struct_value () [template]
// CHECK:STDOUT: %ReturnDUsed: type = fn_type @ReturnDUsed [template]
// CHECK:STDOUT: %struct.4: ReturnDUsed = struct_value () [template]
// CHECK:STDOUT: %Call: type = fn_type @Call [template]
// CHECK:STDOUT: %struct.5: Call = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .D = %D.decl.loc5
// CHECK:STDOUT: .ReturnCUnused = %ReturnCUnused
// CHECK:STDOUT: .ReturnCUsed = %ReturnCUsed
// CHECK:STDOUT: .ReturnDUnused = %ReturnDUnused
// CHECK:STDOUT: .ReturnDUsed = %ReturnDUsed
// CHECK:STDOUT: .Call = %Call
// CHECK:STDOUT: .ReturnCUnused = %ReturnCUnused.decl
// CHECK:STDOUT: .ReturnCUsed = %ReturnCUsed.decl
// CHECK:STDOUT: .ReturnDUnused = %ReturnDUnused.decl
// CHECK:STDOUT: .ReturnDUsed = %ReturnDUsed.decl
// CHECK:STDOUT: .Call = %Call.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %D.decl.loc5: type = class_decl @D [template = constants.%D] {}
// CHECK:STDOUT: %ReturnCUnused: <function> = fn_decl @ReturnCUnused [template] {
// CHECK:STDOUT: %ReturnCUnused.decl: ReturnCUnused = fn_decl @ReturnCUnused [template = constants.%struct.1] {
// CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @ReturnCUnused.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ReturnCUsed: <function> = fn_decl @ReturnCUsed [template] {
// CHECK:STDOUT: %ReturnCUsed.decl: ReturnCUsed = fn_decl @ReturnCUsed [template = constants.%struct.2] {
// CHECK:STDOUT: %C.ref.loc8: type = name_ref C, %C.decl [template = constants.%C]
// CHECK:STDOUT: @ReturnCUsed.%return: ref C = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ReturnDUnused: <function> = fn_decl @ReturnDUnused [template] {
// CHECK:STDOUT: %ReturnDUnused.decl: ReturnDUnused = fn_decl @ReturnDUnused [template = constants.%struct.3] {
// CHECK:STDOUT: %D.ref.loc9: type = name_ref D, %D.decl.loc5 [template = constants.%D]
// CHECK:STDOUT: @ReturnDUnused.%return: ref D = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ReturnDUsed: <function> = fn_decl @ReturnDUsed [template] {
// CHECK:STDOUT: %ReturnDUsed.decl: ReturnDUsed = fn_decl @ReturnDUsed [template = constants.%struct.4] {
// CHECK:STDOUT: %D.ref.loc10: type = name_ref D, %D.decl.loc5 [template = constants.%D]
// CHECK:STDOUT: @ReturnDUsed.%return: ref D = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Call: <function> = fn_decl @Call [template] {}
// CHECK:STDOUT: %Call.decl: Call = fn_decl @Call [template = constants.%struct.5] {}
// CHECK:STDOUT: %D.decl.loc37: type = class_decl @D [template = constants.%D] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -128,9 +139,9 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Call() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %ReturnCUsed.ref: <function> = name_ref ReturnCUsed, file.%ReturnCUsed [template = file.%ReturnCUsed]
// CHECK:STDOUT: %ReturnCUsed.ref: ReturnCUsed = name_ref ReturnCUsed, file.%ReturnCUsed.decl [template = constants.%struct.2]
// CHECK:STDOUT: %ReturnCUsed.call: init <error> = call %ReturnCUsed.ref()
// CHECK:STDOUT: %ReturnDUsed.ref: <function> = name_ref ReturnDUsed, file.%ReturnDUsed [template = file.%ReturnDUsed]
// CHECK:STDOUT: %ReturnDUsed.ref: ReturnDUsed = name_ref ReturnDUsed, file.%ReturnDUsed.decl [template = constants.%struct.4]
// CHECK:STDOUT: %ReturnDUsed.call: init <error> = call %ReturnDUsed.ref()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -138,11 +149,21 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: --- fail_use_imported.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %CallFAndGIncomplete: type = fn_type @CallFAndGIncomplete [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: CallFAndGIncomplete = struct_value () [template]
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %ReturnCUnused: type = fn_type @ReturnCUnused [template]
// CHECK:STDOUT: %struct.2: ReturnCUnused = struct_value () [template]
// CHECK:STDOUT: %ReturnCUsed: type = fn_type @ReturnCUsed [template]
// CHECK:STDOUT: %struct.3: ReturnCUsed = struct_value () [template]
// CHECK:STDOUT: %D: type = class_type @D [template]
// CHECK:STDOUT: %.1: type = struct_type {} [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: %ReturnDUnused: type = fn_type @ReturnDUnused [template]
// CHECK:STDOUT: %struct.4: ReturnDUnused = struct_value () [template]
// CHECK:STDOUT: %.3: type = ptr_type {} [template]
// CHECK:STDOUT: %ReturnDUsed: type = fn_type @ReturnDUsed [template]
// CHECK:STDOUT: %struct.5: ReturnDUsed = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -154,16 +175,16 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: .ReturnDUnused = %import_ref.5
// CHECK:STDOUT: .ReturnDUsed = %import_ref.6
// CHECK:STDOUT: .Call = %import_ref.7
// CHECK:STDOUT: .CallFAndGIncomplete = %CallFAndGIncomplete
// CHECK:STDOUT: .CallFAndGIncomplete = %CallFAndGIncomplete.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded
// CHECK:STDOUT: %import_ref.3: <function> = import_ref ir1, inst+7, loc_14 [template = imports.%ReturnCUnused]
// CHECK:STDOUT: %import_ref.4: <function> = import_ref ir1, inst+10, loc_18 [template = imports.%ReturnCUsed]
// CHECK:STDOUT: %import_ref.5: <function> = import_ref ir1, inst+13, loc_22 [template = imports.%ReturnDUnused]
// CHECK:STDOUT: %import_ref.6: <function> = import_ref ir1, inst+16, loc_26 [template = imports.%ReturnDUsed]
// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+17, unloaded
// CHECK:STDOUT: %CallFAndGIncomplete: <function> = fn_decl @CallFAndGIncomplete [template] {}
// CHECK:STDOUT: %import_ref.3: ReturnCUnused = import_ref ir1, inst+7, loc_14 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.4: ReturnCUsed = import_ref ir1, inst+13, loc_18 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.5: ReturnDUnused = import_ref ir1, inst+18, loc_22 [template = constants.%struct.4]
// CHECK:STDOUT: %import_ref.6: ReturnDUsed = import_ref ir1, inst+23, loc_26 [template = constants.%struct.5]
// CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+26, unloaded
// CHECK:STDOUT: %CallFAndGIncomplete.decl: CallFAndGIncomplete = fn_decl @CallFAndGIncomplete [template = constants.%struct.1] {}
// CHECK:STDOUT: %import_ref.8 = import_ref ir1, inst+4, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -177,16 +198,16 @@ fn CallFAndGIncomplete() {
// CHECK:STDOUT: fn @CallFAndGIncomplete() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
// CHECK:STDOUT: %ReturnCUnused.ref: <function> = name_ref ReturnCUnused, file.%import_ref.3 [template = imports.%ReturnCUnused]
// CHECK:STDOUT: %ReturnCUnused.ref: ReturnCUnused = name_ref ReturnCUnused, file.%import_ref.3 [template = constants.%struct.2]
// CHECK:STDOUT: %ReturnCUnused.call: init <error> = call %ReturnCUnused.ref()
// CHECK:STDOUT: %ReturnCUsed.ref: <function> = name_ref ReturnCUsed, file.%import_ref.4 [template = imports.%ReturnCUsed]
// CHECK:STDOUT: %ReturnCUsed.ref: ReturnCUsed = name_ref ReturnCUsed, file.%import_ref.4 [template = constants.%struct.3]
// CHECK:STDOUT: %ReturnCUsed.call: init <error> = call %ReturnCUsed.ref()
// CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {}
// CHECK:STDOUT: %ReturnDUnused.ref: <function> = name_ref ReturnDUnused, file.%import_ref.5 [template = imports.%ReturnDUnused]
// CHECK:STDOUT: %ReturnDUnused.ref: ReturnDUnused = name_ref ReturnDUnused, file.%import_ref.5 [template = constants.%struct.4]
// CHECK:STDOUT: %.loc24_16.1: ref D = temporary_storage
// CHECK:STDOUT: %ReturnDUnused.call: init D = call %ReturnDUnused.ref() to %.loc24_16.1
// CHECK:STDOUT: %.loc24_16.2: ref D = temporary %.loc24_16.1, %ReturnDUnused.call
// CHECK:STDOUT: %ReturnDUsed.ref: <function> = name_ref ReturnDUsed, file.%import_ref.6 [template = imports.%ReturnDUsed]
// CHECK:STDOUT: %ReturnDUsed.ref: ReturnDUsed = name_ref ReturnDUsed, file.%import_ref.6 [template = constants.%struct.5]
// CHECK:STDOUT: %ReturnDUsed.call: init <error> = call %ReturnDUsed.ref()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -96,23 +96,41 @@ extern private fn ExternOrderAndConflict() {}
// CHECK:STDOUT: --- fail_modifiers.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %WrongOrder: type = fn_type @WrongOrder [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: WrongOrder = struct_value () [template]
// CHECK:STDOUT: %DuplicateVirtual: type = fn_type @DuplicateVirtual [template]
// CHECK:STDOUT: %struct.2: DuplicateVirtual = struct_value () [template]
// CHECK:STDOUT: %TwoAccess: type = fn_type @TwoAccess [template]
// CHECK:STDOUT: %struct.3: TwoAccess = struct_value () [template]
// CHECK:STDOUT: %ModifiersConflict: type = fn_type @ModifiersConflict [template]
// CHECK:STDOUT: %struct.4: ModifiersConflict = struct_value () [template]
// CHECK:STDOUT: %InvalidModifier: type = fn_type @InvalidModifier [template]
// CHECK:STDOUT: %struct.5: InvalidModifier = struct_value () [template]
// CHECK:STDOUT: %ModifiersConflict2: type = fn_type @ModifiersConflict2 [template]
// CHECK:STDOUT: %struct.6: ModifiersConflict2 = struct_value () [template]
// CHECK:STDOUT: %ExternOrderAndConflict: type = fn_type @ExternOrderAndConflict [template]
// CHECK:STDOUT: %struct.7: ExternOrderAndConflict = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .WrongOrder = %WrongOrder
// CHECK:STDOUT: .DuplicateVirtual = %DuplicateVirtual
// CHECK:STDOUT: .TwoAccess = %TwoAccess
// CHECK:STDOUT: .ModifiersConflict = %ModifiersConflict
// CHECK:STDOUT: .InvalidModifier = %InvalidModifier
// CHECK:STDOUT: .ModifiersConflict2 = %ModifiersConflict2
// CHECK:STDOUT: .ExternOrderAndConflict = %ExternOrderAndConflict
// CHECK:STDOUT: .WrongOrder = %WrongOrder.decl
// CHECK:STDOUT: .DuplicateVirtual = %DuplicateVirtual.decl
// CHECK:STDOUT: .TwoAccess = %TwoAccess.decl
// CHECK:STDOUT: .ModifiersConflict = %ModifiersConflict.decl
// CHECK:STDOUT: .InvalidModifier = %InvalidModifier.decl
// CHECK:STDOUT: .ModifiersConflict2 = %ModifiersConflict2.decl
// CHECK:STDOUT: .ExternOrderAndConflict = %ExternOrderAndConflict.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %WrongOrder: <function> = fn_decl @WrongOrder [template] {}
// CHECK:STDOUT: %DuplicateVirtual: <function> = fn_decl @DuplicateVirtual [template] {}
// CHECK:STDOUT: %TwoAccess: <function> = fn_decl @TwoAccess [template] {}
// CHECK:STDOUT: %ModifiersConflict: <function> = fn_decl @ModifiersConflict [template] {}
// CHECK:STDOUT: %InvalidModifier: <function> = fn_decl @InvalidModifier [template] {}
// CHECK:STDOUT: %ModifiersConflict2: <function> = fn_decl @ModifiersConflict2 [template] {}
// CHECK:STDOUT: %ExternOrderAndConflict: <function> = fn_decl @ExternOrderAndConflict [template] {}
// CHECK:STDOUT: %WrongOrder.decl: WrongOrder = fn_decl @WrongOrder [template = constants.%struct.1] {}
// CHECK:STDOUT: %DuplicateVirtual.decl: DuplicateVirtual = fn_decl @DuplicateVirtual [template = constants.%struct.2] {}
// CHECK:STDOUT: %TwoAccess.decl: TwoAccess = fn_decl @TwoAccess [template = constants.%struct.3] {}
// CHECK:STDOUT: %ModifiersConflict.decl: ModifiersConflict = fn_decl @ModifiersConflict [template = constants.%struct.4] {}
// CHECK:STDOUT: %InvalidModifier.decl: InvalidModifier = fn_decl @InvalidModifier [template = constants.%struct.5] {}
// CHECK:STDOUT: %ModifiersConflict2.decl: ModifiersConflict2 = fn_decl @ModifiersConflict2 [template = constants.%struct.6] {}
// CHECK:STDOUT: %ExternOrderAndConflict.decl: ExternOrderAndConflict = fn_decl @ExternOrderAndConflict [template = constants.%struct.7] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @WrongOrder();
@@ -56,42 +56,54 @@ fn E() {}
// CHECK:STDOUT: --- fail_redecl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: %C: type = fn_type @C [template]
// CHECK:STDOUT: %struct.3: C = struct_value () [template]
// CHECK:STDOUT: %.2: type = fn_type @.1 [template]
// CHECK:STDOUT: %struct.4: <invalid> = struct_value () [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.5: D = struct_value () [template]
// CHECK:STDOUT: %E: type = fn_type @E [template]
// CHECK:STDOUT: %struct.6: E = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A.loc7
// CHECK:STDOUT: .B = %B.loc17
// CHECK:STDOUT: .C = %C
// CHECK:STDOUT: .D = %D.loc37
// CHECK:STDOUT: .E = %E.loc47
// CHECK:STDOUT: .A = %A.decl.loc7
// CHECK:STDOUT: .B = %B.decl.loc17
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .D = %D.decl.loc37
// CHECK:STDOUT: .E = %E.decl.loc47
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.loc7: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.loc15: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %B.loc17: <function> = fn_decl @B [template] {
// CHECK:STDOUT: %A.decl.loc7: A = fn_decl @A [template = constants.%struct.1] {}
// CHECK:STDOUT: %A.decl.loc15: A = fn_decl @A [template = constants.%struct.1] {}
// CHECK:STDOUT: %B.decl.loc17: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %.loc17_10.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc17_10.2: type = converted %.loc17_10.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %x.loc17_6.1: () = param x
// CHECK:STDOUT: @B.%x: () = bind_name x, %x.loc17_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %B.loc25: <function> = fn_decl @B [template] {
// CHECK:STDOUT: %B.decl.loc25: B = fn_decl @B [template = constants.%struct.2] {
// CHECK:STDOUT: %.loc25_10.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc25_10.2: type = converted %.loc25_10.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %x.loc25_6.1: () = param x
// CHECK:STDOUT: %x.loc25_6.2: () = bind_name x, %x.loc25_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %C: <function> = fn_decl @C [template] {}
// CHECK:STDOUT: %.loc35_12: <function> = fn_decl @.1 [template] {
// CHECK:STDOUT: %C.decl: C = fn_decl @C [template = constants.%struct.3] {}
// CHECK:STDOUT: %.decl: <invalid> = fn_decl @.1 [template = constants.%struct.4] {
// CHECK:STDOUT: %.loc35_10.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc35_10.2: type = converted %.loc35_10.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %x.loc35_6.1: () = param x
// CHECK:STDOUT: @.1.%x: () = bind_name x, %x.loc35_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %D.loc37: <function> = fn_decl @D [template] {}
// CHECK:STDOUT: %D.loc45: <function> = fn_decl @D [template] {}
// CHECK:STDOUT: %E.loc47: <function> = fn_decl @E [template] {}
// CHECK:STDOUT: %E.loc54: <function> = fn_decl @E [template] {}
// CHECK:STDOUT: %D.decl.loc37: D = fn_decl @D [template = constants.%struct.5] {}
// CHECK:STDOUT: %D.decl.loc45: D = fn_decl @D [template = constants.%struct.5] {}
// CHECK:STDOUT: %E.decl.loc47: E = fn_decl @E [template = constants.%struct.6] {}
// CHECK:STDOUT: %E.decl.loc54: E = fn_decl @E [template = constants.%struct.6] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
@@ -11,11 +11,17 @@ private fn F();
// CHECK:STDOUT: --- fail_todo_modifiers.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F();
@@ -61,69 +61,105 @@ extern fn A();
// CHECK:STDOUT: --- basic.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- basic.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+1, loaded [template = constants.%struct]
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- extern_api.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_extern_api.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+1, loaded [template = constants.%struct]
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- extern_impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_extern_impl.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+1, loaded [template = constants.%struct]
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
@@ -11,23 +11,27 @@ fn G() { F(); }
// CHECK:STDOUT: --- simple.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %G: type = fn_type @G [template]
// CHECK:STDOUT: %struct.2: G = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .G = %G
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %G: <function> = fn_decl @G [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {}
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.2] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: <function> = name_ref F, file.%F [template = file.%F]
// CHECK:STDOUT: %F.ref: F = name_ref F, file.%F.decl [template = constants.%struct.1]
// CHECK:STDOUT: %F.call: init () = call %F.ref()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -10,18 +10,26 @@ 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: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %G: type = fn_type @G [template]
// CHECK:STDOUT: %struct.2: G = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .G = %G
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {
// 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: <function> = fn_decl @G [template] {
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.2] {
// CHECK:STDOUT: %a.loc9_6.1: i32 = param a
// CHECK:STDOUT: @G.%a: i32 = bind_name a, %a.loc9_6.1
// CHECK:STDOUT: }
+83 -42
View File
@@ -93,36 +93,45 @@ fn D() {}
// CHECK:STDOUT: --- fns.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.1: type = tuple_type (type) [template]
// CHECK:STDOUT: %.2: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.3: type = struct_type {.c: i32} [template]
// CHECK:STDOUT: %.4: i32 = int_literal 0 [template]
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %.5: i32 = int_literal 0 [template]
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %struct.4: D = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .B = %B
// CHECK:STDOUT: .C = %C
// CHECK:STDOUT: .D = %D
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .D = %D.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %B: <function> = fn_decl @B [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: %b.loc5_6.1: i32 = param b
// CHECK:STDOUT: @B.%b: i32 = bind_name b, %b.loc5_6.1
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C: <function> = fn_decl @C [template] {
// 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.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc6_14.2: 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: %.loc6_28: type = struct_type {.c: i32} [template = constants.%.3]
// 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: <function> = fn_decl @D [template] {}
// CHECK:STDOUT: %D.decl: D = fn_decl @D [template = constants.%struct.4] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -139,7 +148,7 @@ fn D() {}
// CHECK:STDOUT: fn @C(%c: (i32,)) -> {.c: i32} {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %c.ref: (i32,) = name_ref c, %c
// CHECK:STDOUT: %.loc6_47: i32 = int_literal 0 [template = constants.%.4]
// CHECK:STDOUT: %.loc6_47: i32 = int_literal 0 [template = constants.%.5]
// CHECK:STDOUT: %.loc6_48: i32 = tuple_index %c.ref, %.loc6_47
// CHECK:STDOUT: %.loc6_49: {.c: i32} = struct_literal (%.loc6_48)
// CHECK:STDOUT: %struct: {.c: i32} = struct_value (%.loc6_48)
@@ -151,13 +160,19 @@ fn D() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- extern.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
@@ -166,9 +181,15 @@ fn D() {}
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: 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: %tuple: (i32,) = tuple_value (%.2) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -183,10 +204,10 @@ fn D() {}
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loc_15 [template = imports.%A]
// CHECK:STDOUT: %import_ref.2: <function> = import_ref ir1, inst+7, loc_24 [template = imports.%B]
// CHECK:STDOUT: %import_ref.3: <function> = import_ref ir1, inst+21, loc_39 [template = imports.%C]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+31, unloaded
// CHECK:STDOUT: %import_ref.1: A = import_ref ir1, inst+2, loc_15 [template = constants.%struct.1]
// CHECK:STDOUT: %import_ref.2: B = import_ref ir1, inst+10, loc_24 [template = constants.%struct.2]
// CHECK:STDOUT: %import_ref.3: C = import_ref ir1, inst+26, loc_39 [template = constants.%struct.3]
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+38, 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]
@@ -207,14 +228,14 @@ fn D() {}
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: <function> = name_ref A, file.%import_ref.1 [template = imports.%A]
// 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: <function> = name_ref B, file.%import_ref.2 [template = imports.%B]
// CHECK:STDOUT: %B.ref: B = name_ref B, file.%import_ref.2 [template = constants.%struct.2]
// 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: <function> = name_ref C, file.%import_ref.3 [template = imports.%C]
// CHECK:STDOUT: %C.ref: C = name_ref C, file.%import_ref.3 [template = constants.%struct.3]
// 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]
@@ -226,21 +247,29 @@ fn D() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_def_ownership.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %B: type = fn_type @B [template]
// CHECK:STDOUT: %struct.2: B = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .D = %import_ref.4
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .B = %B
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: .B = %B.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: <function> = import_ref ir1, inst+2, loaded [template = imports.%A]
// CHECK:STDOUT: %import_ref.2: <function> = import_ref ir1, inst+7, loaded [template = imports.%B]
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+31, unloaded
// 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: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %B: <function> = fn_decl @B [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: %b.loc27_6.1: i32 = param b
// CHECK:STDOUT: %b.loc27_6.2: i32 = bind_name b, %b.loc27_6.1
// CHECK:STDOUT: %return.var: ref i32 = var <return slot>
@@ -256,15 +285,21 @@ fn D() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- redecl_then_def.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .A = %A.loc6
// CHECK:STDOUT: .A = %A.decl.loc6
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir1, inst+2, loaded [template = imports.%A]
// CHECK:STDOUT: %import_ref: A = import_ref ir1, inst+2, loaded [template = constants.%struct]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %A.loc6: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.loc7: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl.loc6: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: %A.decl.loc7: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -274,21 +309,27 @@ fn D() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_mix_extern_decl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %D: type = fn_type @D [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: D = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %import_ref.1
// CHECK:STDOUT: .B = %import_ref.2
// CHECK:STDOUT: .C = %import_ref.3
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .D = %D.loc13
// 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+7, unloaded
// CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+21, unloaded
// CHECK:STDOUT: %import_ref.4: <function> = import_ref ir1, inst+31, loaded [template = imports.%D]
// 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: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %D.loc6: <function> = fn_decl @D [template] {}
// CHECK:STDOUT: %D.loc13: <function> = fn_decl @D [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] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @D() {
@@ -58,11 +58,17 @@ extern fn F();
// CHECK:STDOUT: --- fail_extern_def.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -72,12 +78,18 @@ extern fn F();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_def_for_extern_decl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F.loc12
// CHECK:STDOUT: .F = %F.decl.loc12
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.loc4: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.loc12: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl.loc4: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: %F.decl.loc12: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -87,13 +99,19 @@ extern fn F();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_extern_diag_suppressed.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F.loc12
// CHECK:STDOUT: .F = %F.decl.loc12
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.loc4: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.loc12: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.loc13: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl.loc4: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: %F.decl.loc12: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: %F.decl.loc13: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -103,12 +121,18 @@ extern fn F();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_extern_decl_after_def.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F.loc4
// CHECK:STDOUT: .F = %F.decl.loc4
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.loc4: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.loc11: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl.loc4: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: %F.decl.loc11: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -66,65 +66,89 @@ fn K() -> {} { return {}; }
// CHECK:STDOUT: --- fail_decl_param_mismatch.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %.2: type = fn_type @.1 [template]
// CHECK:STDOUT: %struct.2: <invalid> = struct_value () [template]
// CHECK:STDOUT: %G: type = fn_type @G [template]
// CHECK:STDOUT: %struct.3: G = struct_value () [template]
// CHECK:STDOUT: %.3: type = fn_type @.2 [template]
// CHECK:STDOUT: %struct.4: <invalid> = struct_value () [template]
// CHECK:STDOUT: %H: type = fn_type @H [template]
// CHECK:STDOUT: %struct.5: H = struct_value () [template]
// CHECK:STDOUT: %.4: type = fn_type @.3 [template]
// CHECK:STDOUT: %struct.6: <invalid> = struct_value () [template]
// CHECK:STDOUT: %I: type = fn_type @I [template]
// CHECK:STDOUT: %struct.7: I = struct_value () [template]
// CHECK:STDOUT: %.5: type = fn_type @.4 [template]
// CHECK:STDOUT: %struct.8: <invalid> = struct_value () [template]
// CHECK:STDOUT: %tuple: () = tuple_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: %struct: {} = struct_value () [template]
// CHECK:STDOUT: %J: type = fn_type @J [template]
// CHECK:STDOUT: %struct.9: J = struct_value () [template]
// CHECK:STDOUT: %.6: type = fn_type @.5 [template]
// CHECK:STDOUT: %struct.10: <invalid> = struct_value () [template]
// CHECK:STDOUT: %K: type = fn_type @K [template]
// CHECK:STDOUT: %struct.11: K = struct_value () [template]
// CHECK:STDOUT: %.7: type = struct_type {} [template]
// CHECK:STDOUT: %.8: type = fn_type @.6 [template]
// CHECK:STDOUT: %struct.12: <invalid> = struct_value () [template]
// CHECK:STDOUT: %struct.13: {} = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .G = %G
// CHECK:STDOUT: .H = %H
// CHECK:STDOUT: .I = %I
// CHECK:STDOUT: .J = %J
// CHECK:STDOUT: .K = %K
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: .H = %H.decl
// CHECK:STDOUT: .I = %I.decl
// CHECK:STDOUT: .J = %J.decl
// CHECK:STDOUT: .K = %K.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %.loc15_13: <function> = fn_decl @.1 [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {}
// CHECK:STDOUT: %.decl.loc15: <invalid> = fn_decl @.1 [template = constants.%struct.2] {
// CHECK:STDOUT: %.loc15_10.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc15_10.2: type = converted %.loc15_10.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %x.loc15_6.1: () = param x
// CHECK:STDOUT: @.1.%x: () = bind_name x, %x.loc15_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %G: <function> = fn_decl @G [template] {
// CHECK:STDOUT: %G.decl: G = fn_decl @G [template = constants.%struct.3] {
// CHECK:STDOUT: %.loc17_10.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc17_10.2: type = converted %.loc17_10.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %x.loc17_6.1: () = param x
// CHECK:STDOUT: @G.%x: () = bind_name x, %x.loc17_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc25: <function> = fn_decl @.2 [template] {}
// CHECK:STDOUT: %H: <function> = fn_decl @H [template] {
// CHECK:STDOUT: %.decl.loc25: <invalid> = fn_decl @.2 [template = constants.%struct.4] {}
// CHECK:STDOUT: %H.decl: H = fn_decl @H [template = constants.%struct.5] {
// CHECK:STDOUT: %.loc27_10.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc27_10.2: type = converted %.loc27_10.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %x.loc27_6.1: () = param x
// CHECK:STDOUT: @H.%x: () = bind_name x, %x.loc27_6.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc35: <function> = fn_decl @.3 [template] {
// 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: }
// CHECK:STDOUT: %I: <function> = fn_decl @I [template] {}
// CHECK:STDOUT: %.loc45_14: <function> = fn_decl @.4 [template] {
// 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: @.4.%return: ref () = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %J: <function> = fn_decl @J [template] {
// 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: @J.%return: ref () = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc55: <function> = fn_decl @.5 [template] {}
// CHECK:STDOUT: %K: <function> = fn_decl @K [template] {
// CHECK:STDOUT: %.decl.loc55: <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: @K.%return: ref () = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc64_14: <function> = fn_decl @.6 [template] {
// 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.%.2 [template = constants.%.2]
// CHECK:STDOUT: %.loc64_12.2: type = converted %.loc64_12.1, constants.%.7 [template = constants.%.7]
// CHECK:STDOUT: @.6.%return: ref {} = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -172,8 +196,8 @@ fn K() -> {} { return {}; }
// CHECK:STDOUT: fn @.6() -> {} {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc64_24: {} = struct_literal ()
// CHECK:STDOUT: %struct: {} = struct_value () [template = constants.%struct]
// CHECK:STDOUT: %.loc64_25: {} = converted %.loc64_24, %struct [template = constants.%struct]
// 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: }
// CHECK:STDOUT:
@@ -15,12 +15,18 @@ fn F() {}
// CHECK:STDOUT: --- fail_redef.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F.loc7
// CHECK:STDOUT: .F = %F.decl.loc7
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.loc7: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.loc14: <function> = fn_decl @F [template] {}
// CHECK:STDOUT: %F.decl.loc7: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: %F.decl.loc14: F = fn_decl @F [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -10,12 +10,18 @@ fn Foo() {}
// CHECK:STDOUT: --- forward_decl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Foo = %Foo.loc7
// CHECK:STDOUT: .Foo = %Foo.decl.loc7
// CHECK:STDOUT: }
// CHECK:STDOUT: %Foo.loc7: <function> = fn_decl @Foo [template] {}
// CHECK:STDOUT: %Foo.loc9: <function> = fn_decl @Foo [template] {}
// CHECK:STDOUT: %Foo.decl.loc7: Foo = fn_decl @Foo [template = constants.%struct] {}
// CHECK:STDOUT: %Foo.decl.loc9: Foo = fn_decl @Foo [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo() {
@@ -99,23 +99,35 @@ fn A() {}
// CHECK:STDOUT: --- basic.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- basic.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+1, loaded [template = constants.%struct]
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -125,23 +137,35 @@ fn A() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- extern_api.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: extern fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_extern_api.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+1, loaded [template = constants.%struct]
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -151,23 +175,35 @@ fn A() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- extern_impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_extern_impl.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+1, loaded [template = constants.%struct]
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -177,11 +213,17 @@ fn A() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- redecl_after_def.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -191,23 +233,35 @@ fn A() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_redecl_after_def.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+1, loaded [template = constants.%struct]
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A();
// CHECK:STDOUT:
// CHECK:STDOUT: --- redef_after_def.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -217,12 +271,18 @@ fn A() {}
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_redef_after_def.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: A = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir0, inst+1, loaded [template = imports.%A]
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: %import_ref: A = import_ref ir0, inst+1, loaded [template = constants.%struct]
// CHECK:STDOUT: %A.decl: A = fn_decl @A [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
@@ -10,15 +10,25 @@ fn Baz() {}
// CHECK:STDOUT: --- order.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: %Bar: type = fn_type @Bar [template]
// CHECK:STDOUT: %struct.2: Bar = struct_value () [template]
// CHECK:STDOUT: %Baz: type = fn_type @Baz [template]
// CHECK:STDOUT: %struct.3: Baz = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Bar = %Bar
// CHECK:STDOUT: .Baz = %Baz
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .Baz = %Baz.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {}
// CHECK:STDOUT: %Bar: <function> = fn_decl @Bar [template] {}
// CHECK:STDOUT: %Baz: <function> = fn_decl @Baz [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct.1] {}
// CHECK:STDOUT: %Bar.decl: Bar = fn_decl @Bar [template = constants.%struct.2] {}
// CHECK:STDOUT: %Baz.decl: Baz = fn_decl @Baz [template = constants.%struct.3] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo() {
@@ -8,11 +8,17 @@ fn Foo() {}
// CHECK:STDOUT: --- params_zero.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {}
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo() {
@@ -8,13 +8,19 @@ fn Foo(a: i32) {}
// CHECK:STDOUT: --- params_one.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Foo: type = fn_type @Foo [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: }
@@ -8,13 +8,19 @@ 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: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: }
@@ -8,13 +8,19 @@ 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: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
@@ -8,13 +8,19 @@ 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: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %struct: Foo = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .Foo = %Foo
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo [template] {
// CHECK:STDOUT: %Foo.decl: Foo = fn_decl @Foo [template = constants.%struct] {
// CHECK:STDOUT: %a.loc7_8.1: i32 = param a
// CHECK:STDOUT: @Foo.%a: i32 = bind_name a, %a.loc7_8.1
// CHECK:STDOUT: %b.loc7_16.1: i32 = param b
@@ -13,15 +13,18 @@ fn F(N:! i32, a: [i32; N]*);
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// 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: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// 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: %N.ref: i32 = name_ref N, @F.%N [symbolic = constants.%N]
@@ -17,14 +17,17 @@ fn F(T:! type, U:! type) {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
// CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic]
// CHECK:STDOUT: %.1: type = ptr_type T [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: %.2: type = ptr_type T [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %T.loc7_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc7_6.1 [symbolic = constants.%T]
// CHECK:STDOUT: %U.loc7_16.1: type = param U
@@ -35,7 +38,7 @@ fn F(T:! type, U:! type) {
// CHECK:STDOUT: fn @F(%T: type, %U: type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc8: type = ptr_type T [symbolic = constants.%.1]
// CHECK:STDOUT: %.loc8: type = ptr_type T [symbolic = constants.%.2]
// CHECK:STDOUT: %p.var: ref T* = var p
// CHECK:STDOUT: %p: ref T* = bind_name p, %p.var
// CHECK:STDOUT: %U.ref: type = name_ref U, %U [symbolic = constants.%U]
@@ -13,14 +13,17 @@ fn F(T:! type) {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
// CHECK:STDOUT: %.1: type = ptr_type T [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: %.2: type = ptr_type T [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %T.loc7_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc7_6.1 [symbolic = constants.%T]
// CHECK:STDOUT: }
@@ -29,7 +32,7 @@ fn F(T:! type) {
// CHECK:STDOUT: fn @F(%T: type) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %T.ref.loc8: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %.loc8: type = ptr_type T [symbolic = constants.%.1]
// CHECK:STDOUT: %.loc8: type = ptr_type T [symbolic = constants.%.2]
// CHECK:STDOUT: %p.var: ref T* = var p
// CHECK:STDOUT: %p: ref T* = bind_name p, %p.var
// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T [symbolic = constants.%T]
@@ -13,13 +13,16 @@ fn F(T:! type, n: T) -> T {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %T: type = bind_symbolic_name T 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: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %T.loc7_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc7_6.1 [symbolic = constants.%T]
// CHECK:STDOUT: %T.ref.loc7_19: type = name_ref T, @F.%T [symbolic = constants.%T]
+40 -22
View File
@@ -102,22 +102,25 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
// CHECK:STDOUT: %.1: type = ptr_type T [symbolic]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %struct: F = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F.loc4
// CHECK:STDOUT: .F = %F.decl.loc4
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F.loc4: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl.loc4: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %T.loc4_6.1: type = param T
// CHECK:STDOUT: %T.loc4_6.2: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = constants.%T]
// CHECK:STDOUT: %T.ref.loc4: type = name_ref T, %T.loc4_6.2 [symbolic = constants.%T]
// CHECK:STDOUT: %.loc4: type = ptr_type T [symbolic = constants.%.1]
// CHECK:STDOUT: %return.var.loc4: ref T* = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.loc6: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl.loc6: F = fn_decl @F [template = constants.%struct] {
// CHECK:STDOUT: %T.loc6_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc6_6.1 [symbolic = constants.%T]
// CHECK:STDOUT: %T.ref.loc6: type = name_ref T, @F.%T [symbolic = constants.%T]
@@ -128,7 +131,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%T: type) -> T* {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: <function> = name_ref F, file.%F.loc4 [template = file.%F.loc4]
// CHECK:STDOUT: %F.ref: F = name_ref F, file.%F.decl.loc4 [template = constants.%struct]
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %F.call: init T* = call %F.ref(%T.ref)
// CHECK:STDOUT: %.loc7_14.1: T* = value_of_initializer %F.call
@@ -142,16 +145,21 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
// CHECK:STDOUT: %U: type = bind_symbolic_name U 1 [symbolic]
// CHECK:STDOUT: %.1: type = ptr_type T [symbolic]
// CHECK:STDOUT: %.2: type = ptr_type U [symbolic]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %.3: type = ptr_type U [symbolic]
// CHECK:STDOUT: %.4: type = fn_type @.1 [template]
// CHECK:STDOUT: %struct.2: <invalid> = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {
// CHECK:STDOUT: %T.loc4_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = constants.%T]
// CHECK:STDOUT: %U.loc4_16.1: type = param U
@@ -160,13 +168,13 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %.loc4: type = ptr_type T [symbolic = constants.%.1]
// CHECK:STDOUT: @F.%return: ref T* = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc13_32: <function> = fn_decl @.1 [template] {
// CHECK:STDOUT: %.decl: <invalid> = fn_decl @.1 [template = constants.%struct.2] {
// CHECK:STDOUT: %T.loc13_6.1: type = param T
// CHECK:STDOUT: @.1.%T: type = bind_symbolic_name T 0, %T.loc13_6.1 [symbolic = constants.%T]
// CHECK:STDOUT: %U.loc13_16.1: type = param U
// CHECK:STDOUT: @.1.%U: type = bind_symbolic_name U 1, %U.loc13_16.1 [symbolic = constants.%U]
// CHECK:STDOUT: %U.ref: type = name_ref U, @.1.%U [symbolic = constants.%U]
// CHECK:STDOUT: %.loc13_30: type = ptr_type U [symbolic = constants.%.2]
// CHECK:STDOUT: %.loc13: type = ptr_type U [symbolic = constants.%.3]
// CHECK:STDOUT: @.1.%return: ref U* = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -175,7 +183,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @.1(%T: type, %U: type) -> U* {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: <function> = name_ref F, file.%F [template = file.%F]
// CHECK:STDOUT: %F.ref: F = name_ref F, file.%F.decl [template = constants.%struct.1]
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T]
// CHECK:STDOUT: %F.call: init T* = call %F.ref(<invalid>) [template = <error>]
// CHECK:STDOUT: return <error>
@@ -187,18 +195,23 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic]
// CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic]
// CHECK:STDOUT: %.1: type = ptr_type T [symbolic]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %U.2: type = bind_symbolic_name U 0 [symbolic]
// CHECK:STDOUT: %T.2: type = bind_symbolic_name T 1 [symbolic]
// CHECK:STDOUT: %.2: type = ptr_type T [symbolic]
// CHECK:STDOUT: %.3: type = ptr_type T [symbolic]
// CHECK:STDOUT: %.4: type = fn_type @.1 [template]
// CHECK:STDOUT: %struct.2: <invalid> = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {
// CHECK:STDOUT: %T.loc4_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = constants.%T.1]
// CHECK:STDOUT: %U.loc4_16.1: type = param U
@@ -207,13 +220,13 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %.loc4: type = ptr_type T [symbolic = constants.%.1]
// CHECK:STDOUT: @F.%return: ref T* = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc13_32: <function> = fn_decl @.1 [template] {
// CHECK:STDOUT: %.decl: <invalid> = fn_decl @.1 [template = constants.%struct.2] {
// CHECK:STDOUT: %U.loc13_6.1: type = param U
// CHECK:STDOUT: @.1.%U: type = bind_symbolic_name U 0, %U.loc13_6.1 [symbolic = constants.%U.2]
// CHECK:STDOUT: %T.loc13_16.1: type = param T
// CHECK:STDOUT: @.1.%T: type = bind_symbolic_name T 1, %T.loc13_16.1 [symbolic = constants.%T.2]
// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, @.1.%T [symbolic = constants.%T.2]
// CHECK:STDOUT: %.loc13_30: type = ptr_type T [symbolic = constants.%.2]
// CHECK:STDOUT: %.loc13: type = ptr_type T [symbolic = constants.%.3]
// CHECK:STDOUT: @.1.%return: ref T* = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -222,7 +235,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @.1(%U: type, %T: type) -> T* {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: <function> = name_ref F, file.%F [template = file.%F]
// CHECK:STDOUT: %F.ref: F = name_ref F, file.%F.decl [template = constants.%struct.1]
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T.2]
// CHECK:STDOUT: %F.call: init T* = call %F.ref(<invalid>) [template = <error>]
// CHECK:STDOUT: return <error>
@@ -234,18 +247,23 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic]
// CHECK:STDOUT: %U.1: type = bind_symbolic_name U 1 [symbolic]
// CHECK:STDOUT: %.1: type = ptr_type T [symbolic]
// CHECK:STDOUT: %F: type = fn_type @F [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %struct.1: F = struct_value () [template]
// CHECK:STDOUT: %U.2: type = bind_symbolic_name U 0 [symbolic]
// CHECK:STDOUT: %T.2: type = bind_symbolic_name T 1 [symbolic]
// CHECK:STDOUT: %.2: type = ptr_type U [symbolic]
// CHECK:STDOUT: %.3: type = ptr_type U [symbolic]
// CHECK:STDOUT: %.4: type = fn_type @.1 [template]
// CHECK:STDOUT: %struct.2: <invalid> = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .Core = %Core
// CHECK:STDOUT: .F = %F
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F: <function> = fn_decl @F [template] {
// CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct.1] {
// CHECK:STDOUT: %T.loc4_6.1: type = param T
// CHECK:STDOUT: @F.%T: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = constants.%T.1]
// CHECK:STDOUT: %U.loc4_16.1: type = param U
@@ -254,13 +272,13 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT: %.loc4: type = ptr_type T [symbolic = constants.%.1]
// CHECK:STDOUT: @F.%return: ref T* = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc13_32: <function> = fn_decl @.1 [template] {
// CHECK:STDOUT: %.decl: <invalid> = fn_decl @.1 [template = constants.%struct.2] {
// CHECK:STDOUT: %U.loc13_6.1: type = param U
// CHECK:STDOUT: @.1.%U: type = bind_symbolic_name U 0, %U.loc13_6.1 [symbolic = constants.%U.2]
// CHECK:STDOUT: %T.loc13_16.1: type = param T
// CHECK:STDOUT: @.1.%T: type = bind_symbolic_name T 1, %T.loc13_16.1 [symbolic = constants.%T.2]
// CHECK:STDOUT: %U.ref: type = name_ref U, @.1.%U [symbolic = constants.%U.2]
// CHECK:STDOUT: %.loc13_30: type = ptr_type U [symbolic = constants.%.2]
// CHECK:STDOUT: %.loc13: type = ptr_type U [symbolic = constants.%.3]
// CHECK:STDOUT: @.1.%return: ref U* = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
@@ -269,7 +287,7 @@ fn F(U:! type, T:! type) -> U* {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @.1(%U: type, %T: type) -> U* {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: <function> = name_ref F, file.%F [template = file.%F]
// CHECK:STDOUT: %F.ref: F = name_ref F, file.%F.decl [template = constants.%struct.1]
// CHECK:STDOUT: %T.ref: type = name_ref T, %T [symbolic = constants.%T.2]
// CHECK:STDOUT: %F.call: init T* = call %F.ref(<invalid>) [template = <error>]
// CHECK:STDOUT: return <error>