Name empty tuples distinctly in SemIR. (#4503)

Building on #4502, give empty tuple values a distinct name, and also
explicitly name tuple types (previously values but not types were
named).
This commit is contained in:
Jon Ross-Perkins
2024-11-08 17:14:52 +00:00
committed by GitHub
parent bbeb66b5fe
commit 10e256a241
585 changed files with 14742 additions and 14732 deletions
+6 -6
View File
@@ -17,12 +17,12 @@ fn F() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: type = ptr_type i32 [template]
// CHECK:STDOUT: %.1: i32 = int_value 0 [template]
// CHECK:STDOUT: %.2: type = ptr_type i32 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -61,12 +61,12 @@ fn F() -> i32 {
// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32]
// CHECK:STDOUT: %n.var: ref i32 = var n
// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var
// CHECK:STDOUT: %.loc12_16: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc12_16: i32 = int_value 0 [template = constants.%.1]
// CHECK:STDOUT: assign %n.var, %.loc12_16
// CHECK:STDOUT: %n.ref: ref i32 = name_ref n, %n
// CHECK:STDOUT: %.loc13_13: %.3 = addr_of %n.ref
// CHECK:STDOUT: %.loc13_13: %.2 = addr_of %n.ref
// CHECK:STDOUT: %.loc13_12: ref i32 = deref %.loc13_13
// CHECK:STDOUT: %.loc13_11: %.3 = addr_of %.loc13_12
// CHECK:STDOUT: %.loc13_11: %.2 = addr_of %.loc13_12
// CHECK:STDOUT: %.loc13_10.1: ref i32 = deref %.loc13_11
// CHECK:STDOUT: %.loc13_10.2: i32 = bind_value %.loc13_10.1
// CHECK:STDOUT: return %.loc13_10.2
+61 -61
View File
@@ -24,21 +24,21 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template]
// CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
// CHECK:STDOUT: %.5: i32 = int_value 2 [template]
// CHECK:STDOUT: %struct: %.2 = struct_value (%.4, %.5) [template]
// CHECK:STDOUT: %.6: type = ptr_type i32 [template]
// CHECK:STDOUT: %.7: type = tuple_type (type, type) [template]
// CHECK:STDOUT: %.8: type = tuple_type (i32, i32) [template]
// CHECK:STDOUT: %.9: type = ptr_type %.8 [template]
// CHECK:STDOUT: %tuple: %.8 = tuple_value (%.4, %.5) [template]
// CHECK:STDOUT: %.10: i32 = int_value 0 [template]
// CHECK:STDOUT: %.1: type = struct_type {.a: i32, .b: i32} [template]
// CHECK:STDOUT: %.2: type = ptr_type %.1 [template]
// CHECK:STDOUT: %.3: i32 = int_value 1 [template]
// CHECK:STDOUT: %.4: i32 = int_value 2 [template]
// CHECK:STDOUT: %struct: %.1 = struct_value (%.3, %.4) [template]
// CHECK:STDOUT: %.5: type = ptr_type i32 [template]
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (type, type) [template]
// CHECK:STDOUT: %tuple.type.2: type = tuple_type (i32, i32) [template]
// CHECK:STDOUT: %.6: type = ptr_type %tuple.type.2 [template]
// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.3, %.4) [template]
// CHECK:STDOUT: %.7: i32 = int_value 0 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -67,18 +67,18 @@ fn F() {
// CHECK:STDOUT: %int.make_type_32.loc12_24: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc12_24.1: type = value_of_initializer %int.make_type_32.loc12_24 [template = i32]
// CHECK:STDOUT: %.loc12_24.2: type = converted %int.make_type_32.loc12_24, %.loc12_24.1 [template = i32]
// CHECK:STDOUT: %.loc12_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.2]
// CHECK:STDOUT: %s.var: ref %.2 = var s
// CHECK:STDOUT: %s: ref %.2 = bind_name s, %s.var
// CHECK:STDOUT: %.loc12_37: i32 = int_value 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc12_45: i32 = int_value 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc12_46.1: %.2 = struct_literal (%.loc12_37, %.loc12_45)
// CHECK:STDOUT: %.loc12_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.1]
// CHECK:STDOUT: %s.var: ref %.1 = var s
// CHECK:STDOUT: %s: ref %.1 = bind_name s, %s.var
// CHECK:STDOUT: %.loc12_37: i32 = int_value 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc12_45: i32 = int_value 2 [template = constants.%.4]
// CHECK:STDOUT: %.loc12_46.1: %.1 = struct_literal (%.loc12_37, %.loc12_45)
// CHECK:STDOUT: %.loc12_46.2: ref i32 = struct_access %s.var, element0
// CHECK:STDOUT: %.loc12_46.3: init i32 = initialize_from %.loc12_37 to %.loc12_46.2 [template = constants.%.4]
// CHECK:STDOUT: %.loc12_46.3: init i32 = initialize_from %.loc12_37 to %.loc12_46.2 [template = constants.%.3]
// CHECK:STDOUT: %.loc12_46.4: ref i32 = struct_access %s.var, element1
// CHECK:STDOUT: %.loc12_46.5: init i32 = initialize_from %.loc12_45 to %.loc12_46.4 [template = constants.%.5]
// CHECK:STDOUT: %.loc12_46.6: init %.2 = struct_init (%.loc12_46.3, %.loc12_46.5) to %s.var [template = constants.%struct]
// CHECK:STDOUT: %.loc12_47: init %.2 = converted %.loc12_46.1, %.loc12_46.6 [template = constants.%struct]
// CHECK:STDOUT: %.loc12_46.5: init i32 = initialize_from %.loc12_45 to %.loc12_46.4 [template = constants.%.4]
// CHECK:STDOUT: %.loc12_46.6: init %.1 = struct_init (%.loc12_46.3, %.loc12_46.5) to %s.var [template = constants.%struct]
// CHECK:STDOUT: %.loc12_47: init %.1 = converted %.loc12_46.1, %.loc12_46.6 [template = constants.%struct]
// CHECK:STDOUT: assign %s.var, %.loc12_47
// CHECK:STDOUT: %int.make_type_32.loc14_15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_15.1: type = value_of_initializer %int.make_type_32.loc14_15 [template = i32]
@@ -86,74 +86,74 @@ fn F() {
// CHECK:STDOUT: %int.make_type_32.loc14_24: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_24.1: type = value_of_initializer %int.make_type_32.loc14_24 [template = i32]
// CHECK:STDOUT: %.loc14_24.2: type = converted %int.make_type_32.loc14_24, %.loc14_24.1 [template = i32]
// CHECK:STDOUT: %.loc14_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.2]
// CHECK:STDOUT: %.loc14_28: type = ptr_type %.2 [template = constants.%.3]
// CHECK:STDOUT: %p.var: ref %.3 = var p
// CHECK:STDOUT: %p: ref %.3 = bind_name p, %p.var
// CHECK:STDOUT: %s.ref.loc14: ref %.2 = name_ref s, %s
// CHECK:STDOUT: %.loc14_32: %.3 = addr_of %s.ref.loc14
// CHECK:STDOUT: %.loc14_27: type = struct_type {.a: i32, .b: i32} [template = constants.%.1]
// CHECK:STDOUT: %.loc14_28: type = ptr_type %.1 [template = constants.%.2]
// CHECK:STDOUT: %p.var: ref %.2 = var p
// CHECK:STDOUT: %p: ref %.2 = bind_name p, %p.var
// CHECK:STDOUT: %s.ref.loc14: ref %.1 = name_ref s, %s
// CHECK:STDOUT: %.loc14_32: %.2 = addr_of %s.ref.loc14
// CHECK:STDOUT: assign %p.var, %.loc14_32
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
// CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32.loc15, %.loc15_13.1 [template = i32]
// CHECK:STDOUT: %.loc15_13.3: type = ptr_type i32 [template = constants.%.6]
// CHECK:STDOUT: %q.var: ref %.6 = var q
// CHECK:STDOUT: %q: ref %.6 = bind_name q, %q.var
// CHECK:STDOUT: %s.ref.loc15: ref %.2 = name_ref s, %s
// CHECK:STDOUT: %.loc15_13.3: type = ptr_type i32 [template = constants.%.5]
// CHECK:STDOUT: %q.var: ref %.5 = var q
// CHECK:STDOUT: %q: ref %.5 = bind_name q, %q.var
// CHECK:STDOUT: %s.ref.loc15: ref %.1 = name_ref s, %s
// CHECK:STDOUT: %.loc15_19: ref i32 = struct_access %s.ref.loc15, element0
// CHECK:STDOUT: %.loc15_17: %.6 = addr_of %.loc15_19
// CHECK:STDOUT: %.loc15_17: %.5 = addr_of %.loc15_19
// CHECK:STDOUT: assign %q.var, %.loc15_17
// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc16_13.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32]
// CHECK:STDOUT: %.loc16_13.2: type = converted %int.make_type_32.loc16, %.loc16_13.1 [template = i32]
// CHECK:STDOUT: %.loc16_13.3: type = ptr_type i32 [template = constants.%.6]
// CHECK:STDOUT: %r.var: ref %.6 = var r
// CHECK:STDOUT: %r: ref %.6 = bind_name r, %r.var
// CHECK:STDOUT: %s.ref.loc16: ref %.2 = name_ref s, %s
// CHECK:STDOUT: %.loc16_13.3: type = ptr_type i32 [template = constants.%.5]
// CHECK:STDOUT: %r.var: ref %.5 = var r
// CHECK:STDOUT: %r: ref %.5 = bind_name r, %r.var
// CHECK:STDOUT: %s.ref.loc16: ref %.1 = name_ref s, %s
// CHECK:STDOUT: %.loc16_19: ref i32 = struct_access %s.ref.loc16, element1
// CHECK:STDOUT: %.loc16_17: %.6 = addr_of %.loc16_19
// CHECK:STDOUT: %.loc16_17: %.5 = addr_of %.loc16_19
// CHECK:STDOUT: assign %r.var, %.loc16_17
// CHECK:STDOUT: %int.make_type_32.loc18_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc18_16: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc18_19.1: %.7 = tuple_literal (%int.make_type_32.loc18_11, %int.make_type_32.loc18_16)
// CHECK:STDOUT: %.loc18_19.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc18_11, %int.make_type_32.loc18_16)
// CHECK:STDOUT: %.loc18_19.2: type = value_of_initializer %int.make_type_32.loc18_11 [template = i32]
// CHECK:STDOUT: %.loc18_19.3: type = converted %int.make_type_32.loc18_11, %.loc18_19.2 [template = i32]
// CHECK:STDOUT: %.loc18_19.4: type = value_of_initializer %int.make_type_32.loc18_16 [template = i32]
// CHECK:STDOUT: %.loc18_19.5: type = converted %int.make_type_32.loc18_16, %.loc18_19.4 [template = i32]
// CHECK:STDOUT: %.loc18_19.6: type = converted %.loc18_19.1, constants.%.8 [template = constants.%.8]
// CHECK:STDOUT: %t.var: ref %.8 = var t
// CHECK:STDOUT: %t: ref %.8 = bind_name t, %t.var
// CHECK:STDOUT: %.loc18_24: i32 = int_value 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc18_27: i32 = int_value 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc18_28.1: %.8 = tuple_literal (%.loc18_24, %.loc18_27)
// CHECK:STDOUT: %.loc18_19.6: type = converted %.loc18_19.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
// CHECK:STDOUT: %t.var: ref %tuple.type.2 = var t
// CHECK:STDOUT: %t: ref %tuple.type.2 = bind_name t, %t.var
// CHECK:STDOUT: %.loc18_24: i32 = int_value 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc18_27: i32 = int_value 2 [template = constants.%.4]
// CHECK:STDOUT: %.loc18_28.1: %tuple.type.2 = tuple_literal (%.loc18_24, %.loc18_27)
// CHECK:STDOUT: %.loc18_28.2: ref i32 = tuple_access %t.var, element0
// CHECK:STDOUT: %.loc18_28.3: init i32 = initialize_from %.loc18_24 to %.loc18_28.2 [template = constants.%.4]
// CHECK:STDOUT: %.loc18_28.3: init i32 = initialize_from %.loc18_24 to %.loc18_28.2 [template = constants.%.3]
// CHECK:STDOUT: %.loc18_28.4: ref i32 = tuple_access %t.var, element1
// CHECK:STDOUT: %.loc18_28.5: init i32 = initialize_from %.loc18_27 to %.loc18_28.4 [template = constants.%.5]
// CHECK:STDOUT: %.loc18_28.6: init %.8 = tuple_init (%.loc18_28.3, %.loc18_28.5) to %t.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc18_29: init %.8 = converted %.loc18_28.1, %.loc18_28.6 [template = constants.%tuple]
// CHECK:STDOUT: %.loc18_28.5: init i32 = initialize_from %.loc18_27 to %.loc18_28.4 [template = constants.%.4]
// CHECK:STDOUT: %.loc18_28.6: init %tuple.type.2 = tuple_init (%.loc18_28.3, %.loc18_28.5) to %t.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc18_29: init %tuple.type.2 = converted %.loc18_28.1, %.loc18_28.6 [template = constants.%tuple]
// CHECK:STDOUT: assign %t.var, %.loc18_29
// CHECK:STDOUT: %int.make_type_32.loc19: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc19_14.1: type = value_of_initializer %int.make_type_32.loc19 [template = i32]
// CHECK:STDOUT: %.loc19_14.2: type = converted %int.make_type_32.loc19, %.loc19_14.1 [template = i32]
// CHECK:STDOUT: %.loc19_14.3: type = ptr_type i32 [template = constants.%.6]
// CHECK:STDOUT: %t0.var: ref %.6 = var t0
// CHECK:STDOUT: %t0: ref %.6 = bind_name t0, %t0.var
// CHECK:STDOUT: %t.ref.loc19: ref %.8 = name_ref t, %t
// CHECK:STDOUT: %.loc19_21: i32 = int_value 0 [template = constants.%.10]
// CHECK:STDOUT: %.loc19_14.3: type = ptr_type i32 [template = constants.%.5]
// CHECK:STDOUT: %t0.var: ref %.5 = var t0
// CHECK:STDOUT: %t0: ref %.5 = bind_name t0, %t0.var
// CHECK:STDOUT: %t.ref.loc19: ref %tuple.type.2 = name_ref t, %t
// CHECK:STDOUT: %.loc19_21: i32 = int_value 0 [template = constants.%.7]
// CHECK:STDOUT: %.loc19_20: ref i32 = tuple_access %t.ref.loc19, element0
// CHECK:STDOUT: %.loc19_18: %.6 = addr_of %.loc19_20
// CHECK:STDOUT: %.loc19_18: %.5 = addr_of %.loc19_20
// CHECK:STDOUT: assign %t0.var, %.loc19_18
// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc20_14.1: type = value_of_initializer %int.make_type_32.loc20 [template = i32]
// CHECK:STDOUT: %.loc20_14.2: type = converted %int.make_type_32.loc20, %.loc20_14.1 [template = i32]
// CHECK:STDOUT: %.loc20_14.3: type = ptr_type i32 [template = constants.%.6]
// CHECK:STDOUT: %t1.var: ref %.6 = var t1
// CHECK:STDOUT: %t1: ref %.6 = bind_name t1, %t1.var
// CHECK:STDOUT: %t.ref.loc20: ref %.8 = name_ref t, %t
// CHECK:STDOUT: %.loc20_21: i32 = int_value 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc20_14.3: type = ptr_type i32 [template = constants.%.5]
// CHECK:STDOUT: %t1.var: ref %.5 = var t1
// CHECK:STDOUT: %t1: ref %.5 = bind_name t1, %t1.var
// CHECK:STDOUT: %t.ref.loc20: ref %tuple.type.2 = name_ref t, %t
// CHECK:STDOUT: %.loc20_21: i32 = int_value 1 [template = constants.%.3]
// CHECK:STDOUT: %.loc20_20: ref i32 = tuple_access %t.ref.loc20, element1
// CHECK:STDOUT: %.loc20_18: %.6 = addr_of %.loc20_20
// CHECK:STDOUT: %.loc20_18: %.5 = addr_of %.loc20_20
// CHECK:STDOUT: assign %t1.var, %.loc20_18
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+31 -31
View File
@@ -28,15 +28,15 @@ fn Foo(ptr: C*) {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %Member.type: type = fn_type @Member [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Member: %Member.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = ptr_type %C [template]
// CHECK:STDOUT: %.3: type = unbound_element_type %C, %.2 [template]
// CHECK:STDOUT: %.4: type = struct_type {.field: %.2} [template]
// CHECK:STDOUT: %.5: <witness> = complete_type_witness %.4 [template]
// CHECK:STDOUT: %.1: type = ptr_type %C [template]
// CHECK:STDOUT: %.2: type = unbound_element_type %C, %.1 [template]
// CHECK:STDOUT: %.3: type = struct_type {.field: %.1} [template]
// CHECK:STDOUT: %.4: <witness> = complete_type_witness %.3 [template]
// CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template]
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
// CHECK:STDOUT: %.6: type = ptr_type %.4 [template]
// CHECK:STDOUT: %.5: type = ptr_type %.3 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -55,13 +55,13 @@ fn Foo(ptr: C*) {
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %ptr.patt: %.2 = binding_pattern ptr
// CHECK:STDOUT: %ptr.param_patt: %.2 = value_param_pattern %ptr.patt, runtime_param0
// CHECK:STDOUT: %ptr.patt: %.1 = binding_pattern ptr
// CHECK:STDOUT: %ptr.param_patt: %.1 = value_param_pattern %ptr.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %.loc16: type = ptr_type %C [template = constants.%.2]
// CHECK:STDOUT: %ptr.param: %.2 = value_param runtime_param0
// CHECK:STDOUT: %ptr: %.2 = bind_name ptr, %ptr.param
// CHECK:STDOUT: %.loc16: type = ptr_type %C [template = constants.%.1]
// CHECK:STDOUT: %ptr.param: %.1 = value_param runtime_param0
// CHECK:STDOUT: %ptr: %.1 = bind_name ptr, %ptr.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -75,9 +75,9 @@ fn Foo(ptr: C*) {
// CHECK:STDOUT: %self: %C = bind_name self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %.loc13_15: type = ptr_type %C [template = constants.%.2]
// CHECK:STDOUT: %.loc13_12: %.3 = field_decl field, element0 [template]
// CHECK:STDOUT: %.loc14: <witness> = complete_type_witness %.4 [template = constants.%.5]
// CHECK:STDOUT: %.loc13_15: type = ptr_type %C [template = constants.%.1]
// CHECK:STDOUT: %.loc13_12: %.2 = field_decl field, element0 [template]
// CHECK:STDOUT: %.loc14: <witness> = complete_type_witness %.3 [template = constants.%.4]
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%C
@@ -87,36 +87,36 @@ fn Foo(ptr: C*) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Member[%self.param_patt: %C]();
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Foo(%ptr.param_patt: %.2) {
// CHECK:STDOUT: fn @Foo(%ptr.param_patt: %.1) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %ptr.ref.loc17: %.2 = name_ref ptr, %ptr
// CHECK:STDOUT: %ptr.ref.loc17: %.1 = name_ref ptr, %ptr
// CHECK:STDOUT: %.loc17_4.1: ref %C = deref %ptr.ref.loc17
// CHECK:STDOUT: %Member.ref.loc17: %Member.type = name_ref Member, @C.%Member.decl [template = constants.%Member]
// CHECK:STDOUT: %.loc17_9: <bound method> = bound_method %.loc17_4.1, %Member.ref.loc17
// CHECK:STDOUT: %.loc17_4.2: %C = bind_value %.loc17_4.1
// CHECK:STDOUT: %Member.call.loc17: init %.1 = call %.loc17_9(%.loc17_4.2)
// CHECK:STDOUT: %ptr.ref.loc18: %.2 = name_ref ptr, %ptr
// CHECK:STDOUT: %Member.call.loc17: init %empty_tuple.type = call %.loc17_9(%.loc17_4.2)
// CHECK:STDOUT: %ptr.ref.loc18: %.1 = name_ref ptr, %ptr
// CHECK:STDOUT: %.loc18_6.1: ref %C = deref %ptr.ref.loc18
// CHECK:STDOUT: %Member.ref.loc18: %Member.type = name_ref Member, @C.%Member.decl [template = constants.%Member]
// CHECK:STDOUT: %.loc18_6.2: <bound method> = bound_method %.loc18_6.1, %Member.ref.loc18
// CHECK:STDOUT: %.loc18_6.3: %C = bind_value %.loc18_6.1
// CHECK:STDOUT: %Member.call.loc18: init %.1 = call %.loc18_6.2(%.loc18_6.3)
// CHECK:STDOUT: %ptr.ref.loc20: %.2 = name_ref ptr, %ptr
// CHECK:STDOUT: %Member.call.loc18: init %empty_tuple.type = call %.loc18_6.2(%.loc18_6.3)
// CHECK:STDOUT: %ptr.ref.loc20: %.1 = name_ref ptr, %ptr
// CHECK:STDOUT: %.loc20_4: ref %C = deref %ptr.ref.loc20
// CHECK:STDOUT: %field.ref.loc20: %.3 = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %.loc20_9: ref %.2 = class_element_access %.loc20_4, element0
// CHECK:STDOUT: %ptr.ref.loc21: %.2 = name_ref ptr, %ptr
// CHECK:STDOUT: %field.ref.loc20: %.2 = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %.loc20_9: ref %.1 = class_element_access %.loc20_4, element0
// CHECK:STDOUT: %ptr.ref.loc21: %.1 = name_ref ptr, %ptr
// CHECK:STDOUT: %.loc21_6.1: ref %C = deref %ptr.ref.loc21
// CHECK:STDOUT: %field.ref.loc21: %.3 = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %.loc21_6.2: ref %.2 = class_element_access %.loc21_6.1, element0
// CHECK:STDOUT: %ptr.ref.loc23: %.2 = name_ref ptr, %ptr
// CHECK:STDOUT: %field.ref.loc21: %.2 = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %.loc21_6.2: ref %.1 = class_element_access %.loc21_6.1, element0
// CHECK:STDOUT: %ptr.ref.loc23: %.1 = name_ref ptr, %ptr
// CHECK:STDOUT: %.loc23_6.1: ref %C = deref %ptr.ref.loc23
// CHECK:STDOUT: %field.ref.loc23_6: %.3 = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %.loc23_6.2: ref %.2 = class_element_access %.loc23_6.1, element0
// CHECK:STDOUT: %.loc23_6.3: %.2 = bind_value %.loc23_6.2
// CHECK:STDOUT: %field.ref.loc23_6: %.2 = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %.loc23_6.2: ref %.1 = class_element_access %.loc23_6.1, element0
// CHECK:STDOUT: %.loc23_6.3: %.1 = bind_value %.loc23_6.2
// CHECK:STDOUT: %.loc23_13.1: ref %C = deref %.loc23_6.3
// CHECK:STDOUT: %field.ref.loc23_13: %.3 = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %.loc23_13.2: ref %.2 = class_element_access %.loc23_13.1, element0
// CHECK:STDOUT: %field.ref.loc23_13: %.2 = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %.loc23_13.2: ref %.1 = class_element_access %.loc23_13.1, element0
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
+10 -10
View File
@@ -19,12 +19,12 @@ fn F() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: type = ptr_type i32 [template]
// CHECK:STDOUT: %.1: i32 = int_value 0 [template]
// CHECK:STDOUT: %.2: type = ptr_type i32 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -63,19 +63,19 @@ fn F() -> i32 {
// CHECK:STDOUT: %.loc12_10.2: type = converted %int.make_type_32.loc12, %.loc12_10.1 [template = i32]
// CHECK:STDOUT: %n.var: ref i32 = var n
// CHECK:STDOUT: %n: ref i32 = bind_name n, %n.var
// CHECK:STDOUT: %.loc12_16: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc12_16: i32 = int_value 0 [template = constants.%.1]
// CHECK:STDOUT: assign %n.var, %.loc12_16
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_13.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
// CHECK:STDOUT: %.loc13_13.2: type = converted %int.make_type_32.loc13, %.loc13_13.1 [template = i32]
// CHECK:STDOUT: %.loc13_13.3: type = ptr_type i32 [template = constants.%.3]
// CHECK:STDOUT: %p.var: ref %.3 = var p
// CHECK:STDOUT: %p: ref %.3 = bind_name p, %p.var
// CHECK:STDOUT: %.loc13_13.3: type = ptr_type i32 [template = constants.%.2]
// CHECK:STDOUT: %p.var: ref %.2 = var p
// CHECK:STDOUT: %p: ref %.2 = bind_name p, %p.var
// CHECK:STDOUT: %n.ref: ref i32 = name_ref n, %n
// CHECK:STDOUT: %.loc13_17: %.3 = addr_of %n.ref
// CHECK:STDOUT: %.loc13_17: %.2 = addr_of %n.ref
// CHECK:STDOUT: assign %p.var, %.loc13_17
// CHECK:STDOUT: %p.ref: ref %.3 = name_ref p, %p
// CHECK:STDOUT: %.loc15_11: %.3 = bind_value %p.ref
// CHECK:STDOUT: %p.ref: ref %.2 = name_ref p, %p
// CHECK:STDOUT: %.loc15_11: %.2 = bind_value %p.ref
// CHECK:STDOUT: %.loc15_10.1: ref i32 = deref %.loc15_11
// CHECK:STDOUT: %.loc15_10.2: i32 = bind_value %.loc15_10.1
// CHECK:STDOUT: return %.loc15_10.2
@@ -28,7 +28,7 @@ fn Test() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Test.type: type = fn_type @Test [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Test: %Test.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+71 -71
View File
@@ -103,42 +103,42 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: %.1: type = struct_type {.a: i32} [template]
// CHECK:STDOUT: %H.type: type = fn_type @H [template]
// CHECK:STDOUT: %H: %H.type = struct_value () [template]
// CHECK:STDOUT: %AddressOfLiteral.type: type = fn_type @AddressOfLiteral [template]
// CHECK:STDOUT: %AddressOfLiteral: %AddressOfLiteral.type = struct_value () [template]
// CHECK:STDOUT: %.3: i32 = int_value 0 [template]
// CHECK:STDOUT: %.4: type = ptr_type i32 [template]
// CHECK:STDOUT: %.5: bool = bool_literal true [template]
// CHECK:STDOUT: %.6: type = ptr_type bool [template]
// CHECK:STDOUT: %.7: f64 = float_literal 1 [template]
// CHECK:STDOUT: %.8: type = ptr_type f64 [template]
// CHECK:STDOUT: %.9: type = ptr_type String [template]
// CHECK:STDOUT: %.10: String = string_literal "Hello" [template]
// CHECK:STDOUT: %.11: i32 = int_value 1 [template]
// CHECK:STDOUT: %.12: i32 = int_value 2 [template]
// CHECK:STDOUT: %.13: type = tuple_type (i32, i32) [template]
// CHECK:STDOUT: %.14: type = ptr_type %.13 [template]
// CHECK:STDOUT: %.15: i32 = int_value 5 [template]
// CHECK:STDOUT: %.16: type = ptr_type %.2 [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: type = ptr_type i32 [template]
// CHECK:STDOUT: %.4: bool = bool_literal true [template]
// CHECK:STDOUT: %.5: type = ptr_type bool [template]
// CHECK:STDOUT: %.6: f64 = float_literal 1 [template]
// CHECK:STDOUT: %.7: type = ptr_type f64 [template]
// CHECK:STDOUT: %.8: type = ptr_type String [template]
// CHECK:STDOUT: %.9: String = string_literal "Hello" [template]
// CHECK:STDOUT: %.10: i32 = int_value 1 [template]
// CHECK:STDOUT: %.11: i32 = int_value 2 [template]
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32) [template]
// CHECK:STDOUT: %.12: type = ptr_type %tuple.type [template]
// CHECK:STDOUT: %.13: i32 = int_value 5 [template]
// CHECK:STDOUT: %.14: type = ptr_type %.1 [template]
// CHECK:STDOUT: %AddressOfOperator.type: type = fn_type @AddressOfOperator [template]
// CHECK:STDOUT: %AddressOfOperator: %AddressOfOperator.type = struct_value () [template]
// CHECK:STDOUT: %.17: bool = bool_literal false [template]
// CHECK:STDOUT: %.15: bool = bool_literal false [template]
// CHECK:STDOUT: %AddressOfCall.type: type = fn_type @AddressOfCall [template]
// CHECK:STDOUT: %AddressOfCall: %AddressOfCall.type = struct_value () [template]
// CHECK:STDOUT: %AddressOfType.type: type = fn_type @AddressOfType [template]
// CHECK:STDOUT: %AddressOfType: %AddressOfType.type = struct_value () [template]
// CHECK:STDOUT: %.18: type = ptr_type type [template]
// CHECK:STDOUT: %.19: type = const_type i32 [template]
// CHECK:STDOUT: %.20: type = ptr_type %.19 [template]
// CHECK:STDOUT: %.16: type = ptr_type type [template]
// CHECK:STDOUT: %.17: type = const_type i32 [template]
// CHECK:STDOUT: %.18: type = ptr_type %.17 [template]
// CHECK:STDOUT: %AddressOfTupleElementValue.type: type = fn_type @AddressOfTupleElementValue [template]
// CHECK:STDOUT: %AddressOfTupleElementValue: %AddressOfTupleElementValue.type = struct_value () [template]
// CHECK:STDOUT: %tuple: %.13 = tuple_value (%.11, %.12) [template]
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%.10, %.11) [template]
// CHECK:STDOUT: %AddressOfParam.type: type = fn_type @AddressOfParam [template]
// CHECK:STDOUT: %AddressOfParam: %AddressOfParam.type = struct_value () [template]
// CHECK:STDOUT: }
@@ -176,15 +176,15 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {
// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc13_16.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc13_16.2: type = converted %int.make_type_32, %.loc13_16.1 [template = i32]
// CHECK:STDOUT: %.loc13_19: type = struct_type {.a: i32} [template = constants.%.2]
// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param0
// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param
// CHECK:STDOUT: %.loc13_19: type = struct_type {.a: i32} [template = constants.%.1]
// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param0
// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %AddressOfLiteral.decl: %AddressOfLiteral.type = fn_decl @AddressOfLiteral [template = constants.%AddressOfLiteral] {} {}
// CHECK:STDOUT: %AddressOfOperator.decl: %AddressOfOperator.type = fn_decl @AddressOfOperator [template = constants.%AddressOfOperator] {} {}
@@ -207,50 +207,50 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() -> i32;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @H() -> %.2;
// CHECK:STDOUT: fn @H() -> %.1;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfLiteral() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc20_4: i32 = int_value 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc20_3: %.4 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc25_4: bool = bool_literal true [template = constants.%.5]
// CHECK:STDOUT: %.loc25_3: %.6 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc30_4: f64 = float_literal 1 [template = constants.%.7]
// CHECK:STDOUT: %.loc30_3: %.8 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc35_4: String = string_literal "Hello" [template = constants.%.10]
// CHECK:STDOUT: %.loc35_3: %.9 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc40_5: i32 = int_value 1 [template = constants.%.11]
// CHECK:STDOUT: %.loc40_8: i32 = int_value 2 [template = constants.%.12]
// CHECK:STDOUT: %.loc40_9: %.13 = tuple_literal (%.loc40_5, %.loc40_8)
// CHECK:STDOUT: %.loc40_3: %.14 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc45_10: i32 = int_value 5 [template = constants.%.15]
// CHECK:STDOUT: %.loc45_11: %.2 = struct_literal (%.loc45_10)
// CHECK:STDOUT: %.loc45_3: %.16 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc20_4: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc20_3: %.3 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc25_4: bool = bool_literal true [template = constants.%.4]
// CHECK:STDOUT: %.loc25_3: %.5 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc30_4: f64 = float_literal 1 [template = constants.%.6]
// CHECK:STDOUT: %.loc30_3: %.7 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc35_4: String = string_literal "Hello" [template = constants.%.9]
// CHECK:STDOUT: %.loc35_3: %.8 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc40_5: i32 = int_value 1 [template = constants.%.10]
// CHECK:STDOUT: %.loc40_8: i32 = int_value 2 [template = constants.%.11]
// CHECK:STDOUT: %.loc40_9: %tuple.type = tuple_literal (%.loc40_5, %.loc40_8)
// CHECK:STDOUT: %.loc40_3: %.12 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc45_10: i32 = int_value 5 [template = constants.%.13]
// CHECK:STDOUT: %.loc45_11: %.1 = struct_literal (%.loc45_10)
// CHECK:STDOUT: %.loc45_3: %.14 = addr_of <error> [template = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfOperator() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc53_5: bool = bool_literal true [template = constants.%.5]
// CHECK:STDOUT: %.loc53_10.1: bool = bool_literal false [template = constants.%.17]
// CHECK:STDOUT: %.loc53_5: bool = bool_literal true [template = constants.%.4]
// CHECK:STDOUT: %.loc53_10.1: bool = bool_literal false [template = constants.%.15]
// CHECK:STDOUT: if %.loc53_5 br !and.rhs else br !and.result(%.loc53_10.1)
// CHECK:STDOUT:
// CHECK:STDOUT: !and.rhs:
// CHECK:STDOUT: %.loc53_14: bool = bool_literal false [template = constants.%.17]
// CHECK:STDOUT: %.loc53_14: bool = bool_literal false [template = constants.%.15]
// CHECK:STDOUT: br !and.result(%.loc53_14)
// CHECK:STDOUT:
// CHECK:STDOUT: !and.result:
// CHECK:STDOUT: %.loc53_10.2: bool = block_arg !and.result [template = constants.%.17]
// CHECK:STDOUT: %.loc53_3: %.6 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc53_10.2: bool = block_arg !and.result [template = constants.%.15]
// CHECK:STDOUT: %.loc53_3: %.5 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [template = constants.%H]
// CHECK:STDOUT: %H.call: init %.2 = call %H.ref()
// CHECK:STDOUT: %.loc58_5.1: ref %.2 = temporary_storage
// CHECK:STDOUT: %.loc58_5.2: ref %.2 = temporary %.loc58_5.1, %H.call
// CHECK:STDOUT: %H.call: init %.1 = call %H.ref()
// CHECK:STDOUT: %.loc58_5.1: ref %.1 = temporary_storage
// CHECK:STDOUT: %.loc58_5.2: ref %.1 = temporary %.loc58_5.1, %H.call
// CHECK:STDOUT: %.loc58_7: ref i32 = struct_access %.loc58_5.2, element0
// CHECK:STDOUT: %.loc58_3: %.4 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc63_9: bool = bool_literal true [template = constants.%.5]
// CHECK:STDOUT: %.loc63_5: bool = not %.loc63_9 [template = constants.%.17]
// CHECK:STDOUT: %.loc63_3: %.6 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc58_3: %.3 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc63_9: bool = bool_literal true [template = constants.%.4]
// CHECK:STDOUT: %.loc63_5: bool = not %.loc63_9 [template = constants.%.15]
// CHECK:STDOUT: %.loc63_3: %.5 = addr_of <error> [template = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -258,33 +258,33 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G]
// CHECK:STDOUT: %G.call: init i32 = call %G.ref()
// CHECK:STDOUT: %.loc71: %.4 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc71: %.3 = addr_of <error> [template = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfType() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int.make_type_32.loc79: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc79: %.18 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc79: %.16 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %int.make_type_32.loc84: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc84_5.1: type = value_of_initializer %int.make_type_32.loc84 [template = i32]
// CHECK:STDOUT: %.loc84_5.2: type = converted %int.make_type_32.loc84, %.loc84_5.1 [template = i32]
// CHECK:STDOUT: %.loc84_5.3: type = const_type i32 [template = constants.%.19]
// CHECK:STDOUT: %.loc84_14: type = ptr_type %.19 [template = constants.%.20]
// CHECK:STDOUT: %.loc84_3: %.18 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc84_5.3: type = const_type i32 [template = constants.%.17]
// CHECK:STDOUT: %.loc84_14: type = ptr_type %.17 [template = constants.%.18]
// CHECK:STDOUT: %.loc84_3: %.16 = addr_of <error> [template = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfTupleElementValue() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc92_6: i32 = int_value 1 [template = constants.%.11]
// CHECK:STDOUT: %.loc92_9: i32 = int_value 2 [template = constants.%.12]
// CHECK:STDOUT: %.loc92_10.1: %.13 = tuple_literal (%.loc92_6, %.loc92_9)
// CHECK:STDOUT: %.loc92_12: i32 = int_value 0 [template = constants.%.3]
// CHECK:STDOUT: %tuple: %.13 = tuple_value (%.loc92_6, %.loc92_9) [template = constants.%tuple]
// CHECK:STDOUT: %.loc92_10.2: %.13 = converted %.loc92_10.1, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %.loc92_11: i32 = tuple_access %.loc92_10.2, element0 [template = constants.%.11]
// CHECK:STDOUT: %.loc92_3: %.4 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc92_6: i32 = int_value 1 [template = constants.%.10]
// CHECK:STDOUT: %.loc92_9: i32 = int_value 2 [template = constants.%.11]
// CHECK:STDOUT: %.loc92_10.1: %tuple.type = tuple_literal (%.loc92_6, %.loc92_9)
// CHECK:STDOUT: %.loc92_12: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%.loc92_6, %.loc92_9) [template = constants.%tuple]
// CHECK:STDOUT: %.loc92_10.2: %tuple.type = converted %.loc92_10.1, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %.loc92_11: i32 = tuple_access %.loc92_10.2, element0 [template = constants.%.10]
// CHECK:STDOUT: %.loc92_3: %.3 = addr_of <error> [template = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -293,11 +293,11 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT: %int.make_type_32.loc99: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc99_22.1: type = value_of_initializer %int.make_type_32.loc99 [template = i32]
// CHECK:STDOUT: %.loc99_22.2: type = converted %int.make_type_32.loc99, %.loc99_22.1 [template = i32]
// CHECK:STDOUT: %.loc99_22.3: type = ptr_type i32 [template = constants.%.4]
// CHECK:STDOUT: %param_addr.var: ref %.4 = var param_addr
// CHECK:STDOUT: %param_addr: ref %.4 = bind_name param_addr, %param_addr.var
// CHECK:STDOUT: %.loc99_22.3: type = ptr_type i32 [template = constants.%.3]
// CHECK:STDOUT: %param_addr.var: ref %.3 = var param_addr
// CHECK:STDOUT: %param_addr: ref %.3 = bind_name param_addr, %param_addr.var
// CHECK:STDOUT: %param.ref: i32 = name_ref param, %param
// CHECK:STDOUT: %.loc99_26: %.4 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %.loc99_26: %.3 = addr_of <error> [template = <error>]
// CHECK:STDOUT: assign %param_addr.var, %.loc99_26
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+1 -1
View File
@@ -22,7 +22,7 @@ let n2: i32 = undeclared->foo;
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -24,7 +24,7 @@ fn A() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -26,7 +26,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -44,13 +44,13 @@ fn Deref(n: i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %Deref.type: type = fn_type @Deref [template]
// CHECK:STDOUT: %Deref: %Deref.type = struct_value () [template]
// CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
// CHECK:STDOUT: %.2: type = struct_type {} [template]
// CHECK:STDOUT: %struct: %.2 = struct_value () [template]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template]
// CHECK:STDOUT: %.1: type = struct_type {} [template]
// CHECK:STDOUT: %struct: %.1 = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -88,21 +88,21 @@ fn Deref(n: i32) {
// CHECK:STDOUT: %.loc16: ref <error> = deref %n.ref.loc16
// CHECK:STDOUT: %n.ref.loc21: i32 = name_ref n, %n
// CHECK:STDOUT: %.loc21: ref <error> = deref %n.ref.loc21
// CHECK:STDOUT: %.loc26_5.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %tuple.loc26: %.1 = tuple_value () [template = constants.%tuple]
// CHECK:STDOUT: %.loc26_5.2: %.1 = converted %.loc26_5.1, %tuple.loc26 [template = constants.%tuple]
// CHECK:STDOUT: %.loc26_5.1: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %empty_tuple.loc26: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_5.2: %empty_tuple.type = converted %.loc26_5.1, %empty_tuple.loc26 [template = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_3: ref <error> = deref %.loc26_5.2
// CHECK:STDOUT: %.loc31_4.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %tuple.loc31: %.1 = tuple_value () [template = constants.%tuple]
// CHECK:STDOUT: %.loc31_4.2: %.1 = converted %.loc31_4.1, %tuple.loc31 [template = constants.%tuple]
// CHECK:STDOUT: %.loc31_4.1: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %empty_tuple.loc31: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple]
// CHECK:STDOUT: %.loc31_4.2: %empty_tuple.type = converted %.loc31_4.1, %empty_tuple.loc31 [template = constants.%empty_tuple]
// CHECK:STDOUT: %.loc31_5: ref <error> = deref %.loc31_4.2
// CHECK:STDOUT: %.loc36_5.1: %.2 = struct_literal ()
// CHECK:STDOUT: %struct.loc36: %.2 = struct_value () [template = constants.%struct]
// CHECK:STDOUT: %.loc36_5.2: %.2 = converted %.loc36_5.1, %struct.loc36 [template = constants.%struct]
// CHECK:STDOUT: %.loc36_5.1: %.1 = struct_literal ()
// CHECK:STDOUT: %struct.loc36: %.1 = struct_value () [template = constants.%struct]
// CHECK:STDOUT: %.loc36_5.2: %.1 = converted %.loc36_5.1, %struct.loc36 [template = constants.%struct]
// CHECK:STDOUT: %.loc36_3: ref <error> = deref %.loc36_5.2
// CHECK:STDOUT: %.loc40_4.1: %.2 = struct_literal ()
// CHECK:STDOUT: %struct.loc40: %.2 = struct_value () [template = constants.%struct]
// CHECK:STDOUT: %.loc40_4.2: %.2 = converted %.loc40_4.1, %struct.loc40 [template = constants.%struct]
// CHECK:STDOUT: %.loc40_4.1: %.1 = struct_literal ()
// CHECK:STDOUT: %struct.loc40: %.1 = struct_value () [template = constants.%struct]
// CHECK:STDOUT: %.loc40_4.2: %.1 = converted %.loc40_4.1, %struct.loc40 [template = constants.%struct]
// CHECK:STDOUT: %.loc40_5: ref <error> = deref %.loc40_4.2
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+1 -1
View File
@@ -25,7 +25,7 @@ var p2: i32->foo;
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
+11 -11
View File
@@ -27,7 +27,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
// CHECK:STDOUT: %.4: type = ptr_type %.1 [template]
// CHECK:STDOUT: %.5: type = const_type %.4 [template]
// CHECK:STDOUT: %ConstMismatch.type: type = fn_type @ConstMismatch [template]
// CHECK:STDOUT: %.6: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %ConstMismatch: %ConstMismatch.type = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template]
@@ -38,14 +38,14 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.5 [symbolic]
// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [symbolic]
// CHECK:STDOUT: %ImplicitAs.type.3: type = interface_type @ImplicitAs, @ImplicitAs(%.5) [template]
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%.5) [template]
// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template]
// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template]
// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.5 [template]
// CHECK:STDOUT: %.11: %.7 = assoc_entity element0, imports.%import_ref.6 [symbolic]
// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template]
// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template]
// CHECK:STDOUT: %.10: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -56,7 +56,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+49, loaded [template = constants.%ImplicitAs]
// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+55, unloaded
// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+77, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)]
// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+77, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)]
// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+70, unloaded
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+70, unloaded
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+70, unloaded
@@ -98,8 +98,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.7)]
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.7) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.8)]
// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.6)]
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.6) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.7)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
@@ -154,7 +154,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
// CHECK:STDOUT: %Self => constants.%Self.2
// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2
// CHECK:STDOUT: %Convert => constants.%Convert.2
// CHECK:STDOUT: %.1 => constants.%.9
// CHECK:STDOUT: %.2 => constants.%.10
// CHECK:STDOUT: %.1 => constants.%.8
// CHECK:STDOUT: %.2 => constants.%.9
// CHECK:STDOUT: }
// CHECK:STDOUT:
+16 -16
View File
@@ -25,10 +25,10 @@ var a: i32* = a_ref;
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_value 0 [template]
// CHECK:STDOUT: %.3: type = ptr_type i32 [template]
// CHECK:STDOUT: %.1: i32 = int_value 0 [template]
// CHECK:STDOUT: %.2: type = ptr_type i32 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -55,19 +55,19 @@ var a: i32* = a_ref;
// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc5_15.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32]
// CHECK:STDOUT: %.loc5_15.2: type = converted %int.make_type_32.loc5, %.loc5_15.1 [template = i32]
// CHECK:STDOUT: %.loc5_15.3: type = ptr_type i32 [template = constants.%.3]
// CHECK:STDOUT: %a_ref.var: ref %.3 = var a_ref
// CHECK:STDOUT: %a_ref: ref %.3 = bind_name a_ref, %a_ref.var
// CHECK:STDOUT: %.loc5_15.3: type = ptr_type i32 [template = constants.%.2]
// CHECK:STDOUT: %a_ref.var: ref %.2 = var a_ref
// CHECK:STDOUT: %a_ref: ref %.2 = bind_name a_ref, %a_ref.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc4: i32 = int_value 0 [template = constants.%.2]
// CHECK:STDOUT: %.loc4: i32 = int_value 0 [template = constants.%.1]
// CHECK:STDOUT: assign file.%a_orig.var, %.loc4
// CHECK:STDOUT: %a_orig.ref: ref i32 = name_ref a_orig, file.%a_orig
// CHECK:STDOUT: %.loc5: %.3 = addr_of %a_orig.ref
// CHECK:STDOUT: %.loc5: %.2 = addr_of %a_orig.ref
// CHECK:STDOUT: assign file.%a_ref.var, %.loc5
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -76,14 +76,14 @@ var a: i32* = a_ref;
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = ptr_type i32 [template]
// CHECK:STDOUT: %.1: type = ptr_type i32 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+15, unloaded
// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref Implicit//default, inst+25, loaded
// CHECK:STDOUT: %import_ref.2: ref %.1 = import_ref Implicit//default, inst+25, loaded
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: .Int32 = %import_ref.3
// CHECK:STDOUT: import Core//prelude
@@ -105,17 +105,17 @@ var a: i32* = a_ref;
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32]
// CHECK:STDOUT: %.loc4_11.3: type = ptr_type i32 [template = constants.%.2]
// CHECK:STDOUT: %a.var: ref %.2 = var a
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
// CHECK:STDOUT: %.loc4_11.3: type = ptr_type i32 [template = constants.%.1]
// CHECK:STDOUT: %a.var: ref %.1 = var a
// CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %a_ref.ref: ref %.2 = name_ref a_ref, imports.%import_ref.2
// CHECK:STDOUT: %.loc4: %.2 = bind_value %a_ref.ref
// CHECK:STDOUT: %a_ref.ref: ref %.1 = name_ref a_ref, imports.%import_ref.2
// CHECK:STDOUT: %.loc4: %.1 = bind_value %a_ref.ref
// CHECK:STDOUT: assign file.%a.var, %.loc4
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+26 -26
View File
@@ -17,13 +17,13 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = const_type i32 [template]
// CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
// CHECK:STDOUT: %.4: type = const_type %.3 [template]
// CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
// CHECK:STDOUT: %.6: type = const_type %.5 [template]
// CHECK:STDOUT: %.1: type = const_type i32 [template]
// CHECK:STDOUT: %.2: type = ptr_type %.1 [template]
// CHECK:STDOUT: %.3: type = const_type %.2 [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: type = const_type %.4 [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: }
@@ -44,39 +44,39 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %p.patt: %.6 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %.6 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: %p.patt: %.5 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %.5 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc12_29: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_32.loc12_29 [template = i32]
// CHECK:STDOUT: %.loc12_23.2: type = converted %int.make_type_32.loc12_29, %.loc12_23.1 [template = i32]
// CHECK:STDOUT: %.loc12_23.3: type = const_type i32 [template = constants.%.2]
// CHECK:STDOUT: %.loc12_32: type = ptr_type %.2 [template = constants.%.3]
// CHECK:STDOUT: %.loc12_16: type = const_type %.3 [template = constants.%.4]
// CHECK:STDOUT: %.loc12_34: type = ptr_type %.4 [template = constants.%.5]
// CHECK:STDOUT: %.loc12_9: type = const_type %.5 [template = constants.%.6]
// CHECK:STDOUT: %.loc12_23.3: type = const_type i32 [template = constants.%.1]
// CHECK:STDOUT: %.loc12_32: type = ptr_type %.1 [template = constants.%.2]
// CHECK:STDOUT: %.loc12_16: type = const_type %.2 [template = constants.%.3]
// CHECK:STDOUT: %.loc12_34: type = ptr_type %.3 [template = constants.%.4]
// CHECK:STDOUT: %.loc12_9: type = const_type %.4 [template = constants.%.5]
// CHECK:STDOUT: %int.make_type_32.loc12_47: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc12_41.1: type = value_of_initializer %int.make_type_32.loc12_47 [template = i32]
// CHECK:STDOUT: %.loc12_41.2: type = converted %int.make_type_32.loc12_47, %.loc12_41.1 [template = i32]
// CHECK:STDOUT: %.loc12_41.3: type = const_type i32 [template = constants.%.2]
// CHECK:STDOUT: %p.param: %.6 = value_param runtime_param0
// CHECK:STDOUT: %p: %.6 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1
// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param
// CHECK:STDOUT: %.loc12_41.3: type = const_type i32 [template = constants.%.1]
// CHECK:STDOUT: %p.param: %.5 = value_param runtime_param0
// CHECK:STDOUT: %p: %.5 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1
// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%p.param_patt: %.6) -> %.2 {
// CHECK:STDOUT: fn @F(%p.param_patt: %.5) -> %.1 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %p.ref: %.6 = name_ref p, %p
// CHECK:STDOUT: %.loc13_11.1: ref %.4 = deref %p.ref
// CHECK:STDOUT: %.loc13_11.2: %.4 = bind_value %.loc13_11.1
// CHECK:STDOUT: %.loc13_10.1: ref %.2 = deref %.loc13_11.2
// CHECK:STDOUT: %.loc13_10.2: %.2 = bind_value %.loc13_10.1
// CHECK:STDOUT: %p.ref: %.5 = name_ref p, %p
// CHECK:STDOUT: %.loc13_11.1: ref %.3 = deref %p.ref
// CHECK:STDOUT: %.loc13_11.2: %.3 = bind_value %.loc13_11.1
// CHECK:STDOUT: %.loc13_10.1: ref %.1 = deref %.loc13_11.2
// CHECK:STDOUT: %.loc13_10.2: %.1 = bind_value %.loc13_10.1
// CHECK:STDOUT: return %.loc13_10.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
+30 -30
View File
@@ -20,13 +20,13 @@ fn ConstPtr(p: const i32*) -> (const i32)* {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = ptr_type i32 [template]
// CHECK:STDOUT: %.1: type = ptr_type i32 [template]
// CHECK:STDOUT: %Ptr.type: type = fn_type @Ptr [template]
// CHECK:STDOUT: %Ptr: %Ptr.type = struct_value () [template]
// CHECK:STDOUT: %.3: type = const_type i32 [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.2: type = const_type i32 [template]
// CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
// CHECK:STDOUT: %ConstPtr.type: type = fn_type @ConstPtr [template]
// CHECK:STDOUT: %ConstPtr: %ConstPtr.type = struct_value () [template]
// CHECK:STDOUT: }
@@ -48,58 +48,58 @@ fn ConstPtr(p: const i32*) -> (const i32)* {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Ptr.decl: %Ptr.type = fn_decl @Ptr [template = constants.%Ptr] {
// CHECK:STDOUT: %p.patt: %.2 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %.2 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %.2 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: %p.patt: %.1 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %.1 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %.1 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %.1 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11_11, %.loc11_14.1 [template = i32]
// CHECK:STDOUT: %.loc11_14.3: type = ptr_type i32 [template = constants.%.2]
// CHECK:STDOUT: %.loc11_14.3: type = ptr_type i32 [template = constants.%.1]
// CHECK:STDOUT: %int.make_type_32.loc11_20: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_23.1: type = value_of_initializer %int.make_type_32.loc11_20 [template = i32]
// CHECK:STDOUT: %.loc11_23.2: type = converted %int.make_type_32.loc11_20, %.loc11_23.1 [template = i32]
// CHECK:STDOUT: %.loc11_23.3: type = ptr_type i32 [template = constants.%.2]
// CHECK:STDOUT: %p.param: %.2 = value_param runtime_param0
// CHECK:STDOUT: %p: %.2 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1
// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param
// CHECK:STDOUT: %.loc11_23.3: type = ptr_type i32 [template = constants.%.1]
// CHECK:STDOUT: %p.param: %.1 = value_param runtime_param0
// CHECK:STDOUT: %p: %.1 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %.1 = out_param runtime_param1
// CHECK:STDOUT: %return: ref %.1 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %ConstPtr.decl: %ConstPtr.type = fn_decl @ConstPtr [template = constants.%ConstPtr] {
// CHECK:STDOUT: %p.patt: %.4 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %.4 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %.4 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %.4 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: %p.patt: %.3 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %.3 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %.3 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %.3 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32]
// CHECK:STDOUT: %.loc15_16.2: type = converted %int.make_type_32.loc15_22, %.loc15_16.1 [template = i32]
// CHECK:STDOUT: %.loc15_16.3: type = const_type i32 [template = constants.%.3]
// CHECK:STDOUT: %.loc15_25: type = ptr_type %.3 [template = constants.%.4]
// CHECK:STDOUT: %.loc15_16.3: type = const_type i32 [template = constants.%.2]
// CHECK:STDOUT: %.loc15_25: type = ptr_type %.2 [template = constants.%.3]
// CHECK:STDOUT: %int.make_type_32.loc15_38: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %int.make_type_32.loc15_38 [template = i32]
// CHECK:STDOUT: %.loc15_32.2: type = converted %int.make_type_32.loc15_38, %.loc15_32.1 [template = i32]
// CHECK:STDOUT: %.loc15_32.3: type = const_type i32 [template = constants.%.3]
// CHECK:STDOUT: %.loc15_42: type = ptr_type %.3 [template = constants.%.4]
// CHECK:STDOUT: %p.param: %.4 = value_param runtime_param0
// CHECK:STDOUT: %p: %.4 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %.4 = out_param runtime_param1
// CHECK:STDOUT: %return: ref %.4 = return_slot %return.param
// CHECK:STDOUT: %.loc15_32.3: type = const_type i32 [template = constants.%.2]
// CHECK:STDOUT: %.loc15_42: type = ptr_type %.2 [template = constants.%.3]
// CHECK:STDOUT: %p.param: %.3 = value_param runtime_param0
// CHECK:STDOUT: %p: %.3 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %.3 = out_param runtime_param1
// CHECK:STDOUT: %return: ref %.3 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Ptr(%p.param_patt: %.2) -> %.2 {
// CHECK:STDOUT: fn @Ptr(%p.param_patt: %.1) -> %.1 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %p.ref: %.2 = name_ref p, %p
// CHECK:STDOUT: %p.ref: %.1 = name_ref p, %p
// CHECK:STDOUT: return %p.ref
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @ConstPtr(%p.param_patt: %.4) -> %.4 {
// CHECK:STDOUT: fn @ConstPtr(%p.param_patt: %.3) -> %.3 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p
// CHECK:STDOUT: %p.ref: %.3 = name_ref p, %p
// CHECK:STDOUT: return %p.ref
// CHECK:STDOUT: }
// CHECK:STDOUT: