Initial support for binding patterns in SemIR (#4221)

Introduces the `BindingPattern` and `SymbolicBindingPattern` insts, and
a separate stack of pattern blocks that they are emitted into. The
intent is to generate the corresponding pattern-matching insts (like
`BindName`) from them in a separate pass, but that is deferred to future
PRs.

See
[here](https://docs.google.com/document/d/1U_vQH17V893J9aF1LJXUnFYBNSs2MjKl4bJPaWCB2zo/edit?usp=sharing&resourcekey=0-w0xGYZ0An31Kpz-wvzSXwQ)
for the design this is based on, but note that during review we have
chosen to deviate from that design by putting the patterns in separate
blocks, and omitting the "forward references" from a `BindingPattern` to
its corresponding `BindName`. This in turn necessitates having separate
inst kinds for symbolic and non-symbolic binding patterns.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Geoff Romer
2024-09-25 19:12:58 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent 87678cc374
commit dc32aa2690
531 changed files with 10270 additions and 8119 deletions
+11 -8
View File
@@ -50,28 +50,31 @@ var arr: [i32; Add(1, 2)];
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] {
// CHECK:STDOUT: %a.patt: i32 = binding_pattern a
// CHECK:STDOUT: %b.patt: i32 = binding_pattern b
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32]
// CHECK:STDOUT: %a.loc11_8.1: i32 = param a, runtime_param0
// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc11_8.1
// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0
// CHECK:STDOUT: %a: i32 = bind_name a, %a.param
// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32]
// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32]
// CHECK:STDOUT: %b.loc11_16.1: i32 = param b, runtime_param1
// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc11_16.1
// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1
// CHECK:STDOUT: %b: i32 = bind_name b, %b.param
// CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32]
// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32]
// CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
// CHECK:STDOUT: %return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add]
// CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_23: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc13_20, %.loc13_23) [template = constants.%.4]
// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32.loc13, %.loc13_11.1 [template = i32]
// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32]
// CHECK:STDOUT: %.loc13_25: type = array_type %int.sadd, i32 [template = constants.%.5]
// CHECK:STDOUT: %arr.var: ref %.5 = var arr
// CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var
@@ -42,20 +42,23 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] {
// CHECK:STDOUT: %a.patt: i32 = binding_pattern a
// CHECK:STDOUT: %b.patt: i32 = binding_pattern b
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32]
// CHECK:STDOUT: %a.loc11_8.1: i32 = param a, runtime_param0
// CHECK:STDOUT: @Add.%a: i32 = bind_name a, %a.loc11_8.1
// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0
// CHECK:STDOUT: %a: i32 = bind_name a, %a.param
// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32]
// CHECK:STDOUT: %.loc11_19.2: type = converted %int.make_type_32.loc11_19, %.loc11_19.1 [template = i32]
// CHECK:STDOUT: %b.loc11_16.1: i32 = param b, runtime_param1
// CHECK:STDOUT: @Add.%b: i32 = bind_name b, %b.loc11_16.1
// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1
// CHECK:STDOUT: %b: i32 = bind_name b, %b.param
// CHECK:STDOUT: %int.make_type_32.loc11_27: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_27.1: type = value_of_initializer %int.make_type_32.loc11_27 [template = i32]
// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32]
// CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
// CHECK:STDOUT: %return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -75,116 +75,134 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %A.decl.loc11: %A.type = fn_decl @A [template = constants.%A] {
// CHECK:STDOUT: %n.patt: i32 = binding_pattern n
// CHECK:STDOUT: %m.patt: i32 = binding_pattern m
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32]
// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11_9, %.loc11_9.1 [template = i32]
// CHECK:STDOUT: %n.loc11_6.1: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc11_6.2: i32 = bind_name n, %n.loc11_6.1
// CHECK:STDOUT: %n.param.loc11: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc11: i32 = bind_name n, %n.param.loc11
// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32]
// CHECK:STDOUT: %.loc11_17.2: type = converted %int.make_type_32.loc11_17, %.loc11_17.1 [template = i32]
// CHECK:STDOUT: %m.loc11_14.1: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc11_14.2: i32 = bind_name m, %m.loc11_14.1
// CHECK:STDOUT: %m.param.loc11: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc11: i32 = bind_name m, %m.param.loc11
// CHECK:STDOUT: %int.make_type_32.loc11_25: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11_25 [template = i32]
// CHECK:STDOUT: %.loc11_25.2: type = converted %int.make_type_32.loc11_25, %.loc11_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc11: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.decl.loc19: %A.type = fn_decl @A [template = constants.%A] {
// CHECK:STDOUT: %n.patt: i32 = binding_pattern n
// CHECK:STDOUT: %m.patt: i32 = binding_pattern m
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc19_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc19_9.1: type = value_of_initializer %int.make_type_32.loc19_9 [template = i32]
// CHECK:STDOUT: %.loc19_9.2: type = converted %int.make_type_32.loc19_9, %.loc19_9.1 [template = i32]
// CHECK:STDOUT: %n.loc19_6.1: i32 = param n, runtime_param0
// CHECK:STDOUT: @A.%n: i32 = bind_name n, %n.loc19_6.1
// CHECK:STDOUT: %n.param.loc19: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc19: i32 = bind_name n, %n.param.loc19
// CHECK:STDOUT: %int.make_type_32.loc19_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc19_17.1: type = value_of_initializer %int.make_type_32.loc19_17 [template = i32]
// CHECK:STDOUT: %.loc19_17.2: type = converted %int.make_type_32.loc19_17, %.loc19_17.1 [template = i32]
// CHECK:STDOUT: %m.loc19_14.1: i32 = param m, runtime_param1
// CHECK:STDOUT: @A.%m: i32 = bind_name m, %m.loc19_14.1
// CHECK:STDOUT: %m.param.loc19: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc19: i32 = bind_name m, %m.param.loc19
// CHECK:STDOUT: %int.make_type_32.loc19_25: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc19_25.1: type = value_of_initializer %int.make_type_32.loc19_25 [template = i32]
// CHECK:STDOUT: %.loc19_25.2: type = converted %int.make_type_32.loc19_25, %.loc19_25.1 [template = i32]
// CHECK:STDOUT: @A.%return: ref i32 = var <return slot>
// CHECK:STDOUT: %return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %B.decl.loc21: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %n.patt: i32 = binding_pattern n
// CHECK:STDOUT: %m.patt: i32 = binding_pattern m
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc21_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc21_9.1: type = value_of_initializer %int.make_type_32.loc21_9 [template = i32]
// CHECK:STDOUT: %.loc21_9.2: type = converted %int.make_type_32.loc21_9, %.loc21_9.1 [template = i32]
// CHECK:STDOUT: %n.loc21_6.1: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc21_6.2: i32 = bind_name n, %n.loc21_6.1
// CHECK:STDOUT: %n.param.loc21: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc21: i32 = bind_name n, %n.param.loc21
// CHECK:STDOUT: %int.make_type_32.loc21_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %int.make_type_32.loc21_17 [template = i32]
// CHECK:STDOUT: %.loc21_17.2: type = converted %int.make_type_32.loc21_17, %.loc21_17.1 [template = i32]
// CHECK:STDOUT: %m.loc21_14.1: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc21_14.2: i32 = bind_name m, %m.loc21_14.1
// CHECK:STDOUT: %m.param.loc21: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc21: i32 = bind_name m, %m.param.loc21
// CHECK:STDOUT: %int.make_type_32.loc21_25: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc21_25.1: type = value_of_initializer %int.make_type_32.loc21_25 [template = i32]
// CHECK:STDOUT: %.loc21_25.2: type = converted %int.make_type_32.loc21_25, %.loc21_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc21: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %B.decl.loc29: %B.type = fn_decl @B [template = constants.%B] {
// CHECK:STDOUT: %n.patt: i32 = binding_pattern n
// CHECK:STDOUT: %m.patt: i32 = binding_pattern m
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc29_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc29_9.1: type = value_of_initializer %int.make_type_32.loc29_9 [template = i32]
// CHECK:STDOUT: %.loc29_9.2: type = converted %int.make_type_32.loc29_9, %.loc29_9.1 [template = i32]
// CHECK:STDOUT: %n.loc29_6.1: i32 = param n, runtime_param0
// CHECK:STDOUT: @B.%n: i32 = bind_name n, %n.loc29_6.1
// CHECK:STDOUT: %n.param.loc29: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc29: i32 = bind_name n, %n.param.loc29
// CHECK:STDOUT: %int.make_type_32.loc29_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc29_17.1: type = value_of_initializer %int.make_type_32.loc29_17 [template = i32]
// CHECK:STDOUT: %.loc29_17.2: type = converted %int.make_type_32.loc29_17, %.loc29_17.1 [template = i32]
// CHECK:STDOUT: %m.loc29_14.1: i32 = param m, runtime_param1
// CHECK:STDOUT: @B.%m: i32 = bind_name m, %m.loc29_14.1
// CHECK:STDOUT: %m.param.loc29: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc29: i32 = bind_name m, %m.param.loc29
// CHECK:STDOUT: %int.make_type_32.loc29_25: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc29_25.1: type = value_of_initializer %int.make_type_32.loc29_25 [template = i32]
// CHECK:STDOUT: %.loc29_25.2: type = converted %int.make_type_32.loc29_25, %.loc29_25.1 [template = i32]
// CHECK:STDOUT: @B.%return: ref i32 = var <return slot>
// CHECK:STDOUT: %return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl.loc31: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %n.patt: i32 = binding_pattern n
// CHECK:STDOUT: %m.patt: i32 = binding_pattern m
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc31_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc31_9.1: type = value_of_initializer %int.make_type_32.loc31_9 [template = i32]
// CHECK:STDOUT: %.loc31_9.2: type = converted %int.make_type_32.loc31_9, %.loc31_9.1 [template = i32]
// CHECK:STDOUT: %n.loc31_6.1: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc31_6.2: i32 = bind_name n, %n.loc31_6.1
// CHECK:STDOUT: %n.param.loc31: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc31: i32 = bind_name n, %n.param.loc31
// CHECK:STDOUT: %int.make_type_32.loc31_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc31_17.1: type = value_of_initializer %int.make_type_32.loc31_17 [template = i32]
// CHECK:STDOUT: %.loc31_17.2: type = converted %int.make_type_32.loc31_17, %.loc31_17.1 [template = i32]
// CHECK:STDOUT: %m.loc31_14.1: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc31_14.2: i32 = bind_name m, %m.loc31_14.1
// CHECK:STDOUT: %m.param.loc31: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc31: i32 = bind_name m, %m.param.loc31
// CHECK:STDOUT: %int.make_type_32.loc31_25: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc31_25.1: type = value_of_initializer %int.make_type_32.loc31_25 [template = i32]
// CHECK:STDOUT: %.loc31_25.2: type = converted %int.make_type_32.loc31_25, %.loc31_25.1 [template = i32]
// CHECK:STDOUT: %return.var.loc31: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.decl.loc38: %C.type = fn_decl @C [template = constants.%C] {
// CHECK:STDOUT: %n.patt: i32 = binding_pattern n
// CHECK:STDOUT: %m.patt: i32 = binding_pattern m
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc38_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc38_9.1: type = value_of_initializer %int.make_type_32.loc38_9 [template = i32]
// CHECK:STDOUT: %.loc38_9.2: type = converted %int.make_type_32.loc38_9, %.loc38_9.1 [template = i32]
// CHECK:STDOUT: %n.loc38_6.1: i32 = param n, runtime_param0
// CHECK:STDOUT: @C.%n: i32 = bind_name n, %n.loc38_6.1
// CHECK:STDOUT: %n.param.loc38: i32 = param n, runtime_param0
// CHECK:STDOUT: %n.loc38: i32 = bind_name n, %n.param.loc38
// CHECK:STDOUT: %int.make_type_32.loc38_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc38_17.1: type = value_of_initializer %int.make_type_32.loc38_17 [template = i32]
// CHECK:STDOUT: %.loc38_17.2: type = converted %int.make_type_32.loc38_17, %.loc38_17.1 [template = i32]
// CHECK:STDOUT: %m.loc38_14.1: i32 = param m, runtime_param1
// CHECK:STDOUT: @C.%m: i32 = bind_name m, %m.loc38_14.1
// CHECK:STDOUT: %m.param.loc38: i32 = param m, runtime_param1
// CHECK:STDOUT: %m.loc38: i32 = bind_name m, %m.param.loc38
// CHECK:STDOUT: %int.make_type_32.loc38_25: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc38_25.1: type = value_of_initializer %int.make_type_32.loc38_25 [template = i32]
// CHECK:STDOUT: %.loc38_25.2: type = converted %int.make_type_32.loc38_25, %.loc38_25.1 [template = i32]
// CHECK:STDOUT: @C.%return: ref i32 = var <return slot>
// CHECK:STDOUT: %return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A(%n: i32, %m: i32) -> i32 = "int.sadd" {
// CHECK:STDOUT: fn @A(%n.loc19: i32, %m.loc19: i32) -> i32 = "int.sadd" {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n
// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc19
// CHECK:STDOUT: return %n.ref
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B(%n: i32, %m: i32) -> i32 = "int.sadd" {
// CHECK:STDOUT: fn @B(%n.loc29: i32, %m.loc29: i32) -> i32 = "int.sadd" {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %n.ref: i32 = name_ref n, file.%n.loc21_6.2
// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc21
// CHECK:STDOUT: return %n.ref
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @C(%n: i32, %m: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: fn @C(%n.loc38: i32, %m.loc38: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
@@ -40,7 +40,7 @@ fn UnknownBuiltin() = "unknown.builtin.name";
// CHECK:STDOUT: .UnknownBuiltin = %UnknownBuiltin.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %UnknownBuiltin.decl: %UnknownBuiltin.type = fn_decl @UnknownBuiltin [template = constants.%UnknownBuiltin] {}
// CHECK:STDOUT: %UnknownBuiltin.decl: %UnknownBuiltin.type = fn_decl @UnknownBuiltin [template = constants.%UnknownBuiltin] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @UnknownBuiltin();
+43 -37
View File
@@ -63,23 +63,23 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32.loc15, %.loc15_6.1 [template = i32]
// CHECK:STDOUT: %I.ref.loc15: type = name_ref I, %I.decl [template = constants.%.1]
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} {}
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc19_16: i32 = int_literal 1 [template = constants.%.6]
// CHECK:STDOUT: %I.ref.loc19: type = name_ref I, %I.decl [template = constants.%.1]
// CHECK:STDOUT: %F.ref: %.3 = name_ref F, @I.%.loc12_40 [template = constants.%.4]
// CHECK:STDOUT: %.loc19_17.1: %F.type.1 = interface_witness_access @impl.%.loc15, element0 [template = constants.%F.2]
// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1]
// CHECK:STDOUT: %F.ref: %.3 = name_ref F, @I.%.loc12 [template = constants.%.4]
// CHECK:STDOUT: %.loc19_17.1: %F.type.1 = interface_witness_access @impl.%.loc15_15, element0 [template = constants.%F.2]
// CHECK:STDOUT: %.loc19_17.2: <bound method> = bound_method %.loc19_16, %.loc19_17.1 [template = constants.%.7]
// CHECK:STDOUT: %.loc19_24: i32 = int_literal 2 [template = constants.%.8]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc19_17.2(%.loc19_16, %.loc19_24) [template = constants.%.9]
// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32]
// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32.loc19, %.loc19_11.1 [template = i32]
// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32, %.loc19_11.1 [template = i32]
// CHECK:STDOUT: %.loc19_26: type = array_type %int.sadd, i32 [template = constants.%.10]
// CHECK:STDOUT: %arr.var: ref %.10 = var arr
// CHECK:STDOUT: %arr: ref %.10 = bind_name arr, %arr.var
@@ -88,62 +88,68 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: interface @I {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self]
// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {
// CHECK:STDOUT: %Self.ref.loc12_14: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %self.loc12_8.1: @F.1.%Self (%Self) = param self, runtime_param0
// CHECK:STDOUT: %self.loc12_8.2: @F.1.%Self (%Self) = bind_name self, %self.loc12_8.1
// CHECK:STDOUT: %Self.ref.loc12_27: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_27.1: type = facet_type_access %Self.ref.loc12_27 [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_27.2: type = converted %Self.ref.loc12_27, %.loc12_27.1 [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %other.loc12_20.1: @F.1.%Self (%Self) = param other, runtime_param1
// CHECK:STDOUT: %other.loc12_20.2: @F.1.%Self (%Self) = bind_name other, %other.loc12_20.1
// CHECK:STDOUT: %Self.ref.loc12_36: %.1 = name_ref Self, %Self [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_36.1: type = facet_type_access %Self.ref.loc12_36 [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_36.2: type = converted %Self.ref.loc12_36, %.loc12_36.1 [symbolic = @F.1.%Self (constants.%Self)]
// CHECK:STDOUT: %return.var: ref @F.1.%Self (%Self) = var <return slot>
// CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self
// CHECK:STDOUT: %other.patt: @F.1.%Self (%Self) = binding_pattern other
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Self.ref.loc12_14: %.1 = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %self.param: @F.1.%Self (%Self) = param self, runtime_param0
// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %self.param
// CHECK:STDOUT: %Self.ref.loc12_27: %.1 = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_27.1: type = facet_type_access %Self.ref.loc12_27 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_27.2: type = converted %Self.ref.loc12_27, %.loc12_27.1 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %other.param: @F.1.%Self (%Self) = param other, runtime_param1
// CHECK:STDOUT: %other: @F.1.%Self (%Self) = bind_name other, %other.param
// CHECK:STDOUT: %Self.ref.loc12_36: %.1 = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_36.1: type = facet_type_access %Self.ref.loc12_36 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc12_36.2: type = converted %Self.ref.loc12_36, %.loc12_36.1 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %return: ref @F.1.%Self (%Self) = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc12_40: %.3 = assoc_entity element0, %F.decl [template = constants.%.4]
// CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
// CHECK:STDOUT: .F = %.loc12_40
// CHECK:STDOUT: .F = %.loc12
// CHECK:STDOUT: witness = (%F.decl)
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: i32 as %.1 {
// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {
// CHECK:STDOUT: %self.patt: i32 = binding_pattern self
// CHECK:STDOUT: %other.patt: i32 = binding_pattern other
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc16_14: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc16_14.1: type = value_of_initializer %int.make_type_32.loc16_14 [template = i32]
// CHECK:STDOUT: %.loc16_14.2: type = converted %int.make_type_32.loc16_14, %.loc16_14.1 [template = i32]
// CHECK:STDOUT: %self.loc16_8.1: i32 = param self, runtime_param0
// CHECK:STDOUT: %self.loc16_8.2: i32 = bind_name self, %self.loc16_8.1
// CHECK:STDOUT: %self.param: i32 = param self, runtime_param0
// CHECK:STDOUT: %self: i32 = bind_name self, %self.param
// CHECK:STDOUT: %int.make_type_32.loc16_26: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc16_26.1: type = value_of_initializer %int.make_type_32.loc16_26 [template = i32]
// CHECK:STDOUT: %.loc16_26.2: type = converted %int.make_type_32.loc16_26, %.loc16_26.1 [template = i32]
// CHECK:STDOUT: %other.loc16_19.1: i32 = param other, runtime_param1
// CHECK:STDOUT: %other.loc16_19.2: i32 = bind_name other, %other.loc16_19.1
// CHECK:STDOUT: %other.param: i32 = param other, runtime_param1
// CHECK:STDOUT: %other: i32 = bind_name other, %other.param
// CHECK:STDOUT: %int.make_type_32.loc16_34: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc16_34.1: type = value_of_initializer %int.make_type_32.loc16_34 [template = i32]
// CHECK:STDOUT: %.loc16_34.2: type = converted %int.make_type_32.loc16_34, %.loc16_34.1 [template = i32]
// CHECK:STDOUT: %return.var: ref i32 = var <return slot>
// CHECK:STDOUT: %return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc15: <witness> = interface_witness (%F.decl) [template = constants.%.5]
// CHECK:STDOUT: %.loc15_15: <witness> = interface_witness (%F.decl) [template = constants.%.5]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: witness = %.loc15
// CHECK:STDOUT: witness = %.loc15_15
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F.1(@I.%Self: %.1) {
// CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[@I.%self.loc12_8.2: @F.1.%Self (%Self)](@I.%other.loc12_20.2: @F.1.%Self (%Self)) -> @F.1.%Self (%Self);
// CHECK:STDOUT: fn[%self: @F.1.%Self (%Self)](%other: @F.1.%Self (%Self)) -> @F.1.%Self (%Self);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F.2[@impl.%self.loc16_8.2: i32](@impl.%other.loc16_19.2: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: fn @F.2[%self: i32](%other: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F.1(constants.%Self) {
// CHECK:STDOUT: %Self => constants.%Self
@@ -49,35 +49,38 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: .Int32 = %Int32.decl
// CHECK:STDOUT: .Add = %Add.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {
// CHECK:STDOUT: @Int32.%return: ref type = var <return slot>
// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {} {
// CHECK:STDOUT: %return: ref type = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.2] {}
// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%.2] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Add {
// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = constants.%Self]
// CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [template = constants.%Op] {
// CHECK:STDOUT: %Self.ref.loc7_15: %.2 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_15.1: type = facet_type_access %Self.ref.loc7_15 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_15.2: type = converted %Self.ref.loc7_15, %.loc7_15.1 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %self.loc7_9.1: @Op.%Self (%Self) = param self, runtime_param0
// CHECK:STDOUT: %self.loc7_9.2: @Op.%Self (%Self) = bind_name self, %self.loc7_9.1
// CHECK:STDOUT: %Self.ref.loc7_28: %.2 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_28.1: type = facet_type_access %Self.ref.loc7_28 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_28.2: type = converted %Self.ref.loc7_28, %.loc7_28.1 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %other.loc7_21.1: @Op.%Self (%Self) = param other, runtime_param1
// CHECK:STDOUT: %other.loc7_21.2: @Op.%Self (%Self) = bind_name other, %other.loc7_21.1
// CHECK:STDOUT: %Self.ref.loc7_37: %.2 = name_ref Self, %Self [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_37.1: type = facet_type_access %Self.ref.loc7_37 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_37.2: type = converted %Self.ref.loc7_37, %.loc7_37.1 [symbolic = @Op.%Self (constants.%Self)]
// CHECK:STDOUT: %return.var: ref @Op.%Self (%Self) = var <return slot>
// CHECK:STDOUT: %self.patt: @Op.%Self (%Self) = binding_pattern self
// CHECK:STDOUT: %other.patt: @Op.%Self (%Self) = binding_pattern other
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Self.ref.loc7_15: %.2 = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_15.1: type = facet_type_access %Self.ref.loc7_15 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_15.2: type = converted %Self.ref.loc7_15, %.loc7_15.1 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %self.param: @Op.%Self (%Self) = param self, runtime_param0
// CHECK:STDOUT: %self: @Op.%Self (%Self) = bind_name self, %self.param
// CHECK:STDOUT: %Self.ref.loc7_28: %.2 = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_28.1: type = facet_type_access %Self.ref.loc7_28 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_28.2: type = converted %Self.ref.loc7_28, %.loc7_28.1 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %other.param: @Op.%Self (%Self) = param other, runtime_param1
// CHECK:STDOUT: %other: @Op.%Self (%Self) = bind_name other, %other.param
// CHECK:STDOUT: %Self.ref.loc7_37: %.2 = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_37.1: type = facet_type_access %Self.ref.loc7_37 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %.loc7_37.2: type = converted %Self.ref.loc7_37, %.loc7_37.1 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT: %return: ref @Op.%Self (%Self) = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc7_41: %.3 = assoc_entity element0, %Op.decl [template = constants.%.4]
// CHECK:STDOUT: %.loc7: %.3 = assoc_entity element0, %Op.decl [template = constants.%.4]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = %Self
// CHECK:STDOUT: .Op = %.loc7_41
// CHECK:STDOUT: .Op = %.loc7
// CHECK:STDOUT: witness = (%Op.decl)
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -86,7 +89,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: generic fn @Op(@Add.%Self: %.2) {
// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[@Add.%self.loc7_9.2: @Op.%Self (%Self)](@Add.%other.loc7_21.2: @Op.%Self (%Self)) -> @Op.%Self (%Self);
// CHECK:STDOUT: fn[%self: @Op.%Self (%Self)](%other: @Op.%Self (%Self)) -> @Op.%Self (%Self);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Op(constants.%Self) {
@@ -131,9 +134,9 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//default, inst+2, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: type = import_ref Core//default, inst+6, loaded [template = constants.%.2]
// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+8, unloaded
// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//default, inst+29, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+24, loaded [template = constants.%Op.2]
// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+24, unloaded
// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//default, inst+31, loaded [template = constants.%.7]
// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+26, loaded [template = constants.%Op.2]
// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+26, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -142,22 +145,22 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: .arr = %arr
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: impl_decl @impl {
// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32]
// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32.loc6, %.loc6_6.1 [template = i32]
// CHECK:STDOUT: impl_decl @impl {} {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32, %.loc6_6.1 [template = i32]
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.2 [template = constants.%.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc10_20: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.4 [template = constants.%.7]
// CHECK:STDOUT: %.loc10_18.1: %Op.type.2 = interface_witness_access @impl.%.loc6, element0 [template = constants.%Op.1]
// CHECK:STDOUT: %.loc10_18.1: %Op.type.2 = interface_witness_access @impl.%.loc6_22, element0 [template = constants.%Op.1]
// CHECK:STDOUT: %.loc10_18.2: <bound method> = bound_method %.loc10_16, %.loc10_18.1 [template = constants.%.8]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18.2(%.loc10_16, %.loc10_20) [template = constants.%.9]
// CHECK:STDOUT: %.loc10_11.1: type = value_of_initializer %int.make_type_32.loc10 [template = i32]
// CHECK:STDOUT: %.loc10_11.2: type = converted %int.make_type_32.loc10, %.loc10_11.1 [template = i32]
// CHECK:STDOUT: %.loc10_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc10_11.2: type = converted %int.make_type_32, %.loc10_11.1 [template = i32]
// CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.10]
// CHECK:STDOUT: %arr.var: ref %.10 = var arr
// CHECK:STDOUT: %arr: ref %.10 = bind_name arr, %arr.var
@@ -172,25 +175,28 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT:
// CHECK:STDOUT: impl @impl: i32 as %.2 {
// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] {
// CHECK:STDOUT: %self.patt: i32 = binding_pattern self
// CHECK:STDOUT: %other.patt: i32 = binding_pattern other
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, i32 [template = i32]
// CHECK:STDOUT: %self.loc7_9.1: i32 = param self, runtime_param0
// CHECK:STDOUT: %self.loc7_9.2: i32 = bind_name self, %self.loc7_9.1
// CHECK:STDOUT: %self.param: i32 = param self, runtime_param0
// CHECK:STDOUT: %self: i32 = bind_name self, %self.param
// CHECK:STDOUT: %Self.ref.loc7_28: type = name_ref Self, i32 [template = i32]
// CHECK:STDOUT: %other.loc7_21.1: i32 = param other, runtime_param1
// CHECK:STDOUT: %other.loc7_21.2: i32 = bind_name other, %other.loc7_21.1
// CHECK:STDOUT: %other.param: i32 = param other, runtime_param1
// CHECK:STDOUT: %other: i32 = bind_name other, %other.param
// CHECK:STDOUT: %Self.ref.loc7_37: type = name_ref Self, i32 [template = i32]
// CHECK:STDOUT: %return.var: ref i32 = var <return slot>
// CHECK:STDOUT: %return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc6: <witness> = interface_witness (%Op.decl) [template = constants.%.3]
// CHECK:STDOUT: %.loc6_22: <witness> = interface_witness (%Op.decl) [template = constants.%.3]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Op = %Op.decl
// CHECK:STDOUT: witness = %.loc6
// CHECK:STDOUT: witness = %.loc6_22
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Op.1[@impl.%self.loc7_9.2: i32](@impl.%other.loc7_21.2: i32) -> i32 = "int.sadd";
// CHECK:STDOUT: fn @Op.1[%self: i32](%other: i32) -> i32 = "int.sadd";
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %.2) {
// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
@@ -205,7 +211,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %.loc10_32: i32 = int_literal 3 [template = constants.%.9]
// CHECK:STDOUT: %.loc10_36: i32 = int_literal 4 [template = constants.%.12]
// CHECK:STDOUT: %Op.ref: %.6 = name_ref Op, imports.%import_ref.4 [template = constants.%.7]
// CHECK:STDOUT: %.loc10_34.1: %Op.type.2 = interface_witness_access @impl.%.loc6, element0 [template = constants.%Op.1]
// CHECK:STDOUT: %.loc10_34.1: %Op.type.2 = interface_witness_access @impl.%.loc6_22, element0 [template = constants.%Op.1]
// CHECK:STDOUT: %.loc10_34.2: <bound method> = bound_method %.loc10_32, %.loc10_34.1 [template = constants.%.13]
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_34.2(%.loc10_32, %.loc10_36) [template = constants.%.14]
// CHECK:STDOUT: %.loc10_37.1: %.15 = tuple_literal (%.loc10_26, %.loc10_29, %int.sadd)
@@ -36,24 +36,27 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: .Int32 = %Int32.decl
// CHECK:STDOUT: .TestAdd = %TestAdd.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {
// CHECK:STDOUT: @Int32.%return: ref type = var <return slot>
// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {} {
// CHECK:STDOUT: %return: ref type = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %TestAdd.decl: %TestAdd.type = fn_decl @TestAdd [template = constants.%TestAdd] {
// CHECK:STDOUT: %a.patt: i32 = binding_pattern a
// CHECK:STDOUT: %b.patt: i32 = binding_pattern b
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc5_15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_32.loc5_15 [template = i32]
// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_32.loc5_15, %.loc5_15.1 [template = i32]
// CHECK:STDOUT: %a.loc5_12.1: i32 = param a, runtime_param0
// CHECK:STDOUT: @TestAdd.%a: i32 = bind_name a, %a.loc5_12.1
// CHECK:STDOUT: %a.param: i32 = param a, runtime_param0
// CHECK:STDOUT: %a: i32 = bind_name a, %a.param
// CHECK:STDOUT: %int.make_type_32.loc5_23: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %int.make_type_32.loc5_23 [template = i32]
// CHECK:STDOUT: %.loc5_23.2: type = converted %int.make_type_32.loc5_23, %.loc5_23.1 [template = i32]
// CHECK:STDOUT: %b.loc5_20.1: i32 = param b, runtime_param1
// CHECK:STDOUT: @TestAdd.%b: i32 = bind_name b, %b.loc5_20.1
// CHECK:STDOUT: %b.param: i32 = param b, runtime_param1
// CHECK:STDOUT: %b: i32 = bind_name b, %b.param
// CHECK:STDOUT: %int.make_type_32.loc5_31: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc5_31.1: type = value_of_initializer %int.make_type_32.loc5_31 [template = i32]
// CHECK:STDOUT: %.loc5_31.2: type = converted %int.make_type_32.loc5_31, %.loc5_31.1 [template = i32]
// CHECK:STDOUT: @TestAdd.%return: ref i32 = var <return slot>
// CHECK:STDOUT: %return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -86,7 +89,7 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
// CHECK:STDOUT: import Core//core
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//core, inst+2, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+20, loaded [template = constants.%TestAdd]
// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+22, loaded [template = constants.%TestAdd]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {