mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 19:01:07 +01:00
Model var as a pattern operator (#4720)
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
6572da7314
commit
13434f0e8a
+19
-3
@@ -69,8 +69,11 @@ fn G() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %array_type = binding_pattern v
|
||||
// CHECK:STDOUT: %.loc14_3.1: %array_type = var_pattern %v.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %array_type = var v
|
||||
// CHECK:STDOUT: %v: ref %array_type = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %F.ref.loc14_34: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
||||
// CHECK:STDOUT: %.loc14_42.1: ref %tuple.type.189 = splice_block %.loc14_42.2 {
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
|
||||
@@ -85,8 +88,21 @@ fn G() {
|
||||
// CHECK:STDOUT: %F.call.loc14_41: init %tuple.type.189 = call %F.ref.loc14_39() to %.loc14_42.3
|
||||
// CHECK:STDOUT: %.loc14_42.5: %tuple.type.99b = tuple_literal (%F.call.loc14_36, %F.call.loc14_41)
|
||||
// CHECK:STDOUT: %.loc14_42.6: init %array_type = array_init (%F.call.loc14_36, %F.call.loc14_41) to %v.var
|
||||
// CHECK:STDOUT: %.loc14_43: init %array_type = converted %.loc14_42.5, %.loc14_42.6
|
||||
// CHECK:STDOUT: assign %v.var, %.loc14_43
|
||||
// CHECK:STDOUT: %.loc14_3.2: init %array_type = converted %.loc14_42.5, %.loc14_42.6
|
||||
// CHECK:STDOUT: assign %v.var, %.loc14_3.2
|
||||
// CHECK:STDOUT: %.loc14_29: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc14_12: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_17: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14_25.1: %tuple.type.ff9 = tuple_literal (%i32.loc14_12, %i32.loc14_17, %i32.loc14_22)
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc14_25.2: type = converted %.loc14_25.1, constants.%tuple.type.189 [template = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_2, %tuple.type.189 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %array_type = bind_name v, %v.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+36
-11
@@ -41,6 +41,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %Convert.specific_fn.b42: <specific function> = specific_function %Convert.bound.b30, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [template]
|
||||
// CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [template]
|
||||
// CHECK:STDOUT: %tuple.type.189: type = tuple_type (%i32, %i32, %i32) [template]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.189 = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [template]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -65,12 +66,15 @@ fn G() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc13_3.1: %array_type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type = var a
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %int_1.loc13_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2.loc13_25: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3.loc13: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc13_29.1: %tuple.type.37f = tuple_literal (%int_1.loc13_22, %int_2.loc13_25, %int_3.loc13)
|
||||
// CHECK:STDOUT: %int_3.loc13_28: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc13_29.1: %tuple.type.37f = tuple_literal (%int_1.loc13_22, %int_2.loc13_25, %int_3.loc13_28)
|
||||
// CHECK:STDOUT: %impl.elem0.loc13_29.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc13_29.1: <bound method> = bound_method %int_1.loc13_22, %impl.elem0.loc13_29.1 [template = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc13_29.1: <specific function> = specific_function %Convert.bound.loc13_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
|
||||
@@ -88,18 +92,28 @@ fn G() {
|
||||
// CHECK:STDOUT: %.loc13_29.6: ref %i32 = array_index %a.var, %int_1.loc13_29
|
||||
// CHECK:STDOUT: %.loc13_29.7: init %i32 = initialize_from %.loc13_29.5 to %.loc13_29.6 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc13_29.3: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc13_29.3: <bound method> = bound_method %int_3.loc13, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.b30]
|
||||
// CHECK:STDOUT: %Convert.bound.loc13_29.3: <bound method> = bound_method %int_3.loc13_28, %impl.elem0.loc13_29.3 [template = constants.%Convert.bound.b30]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc13_29.3: <specific function> = specific_function %Convert.bound.loc13_29.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %Convert.specific_fn.loc13_29.3(%int_3.loc13) [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc13_29.8: init %i32 = converted %int_3.loc13, %int.convert_checked.loc13_29.3 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_29.3: init %i32 = call %Convert.specific_fn.loc13_29.3(%int_3.loc13_28) [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc13_29.8: init %i32 = converted %int_3.loc13_28, %int.convert_checked.loc13_29.3 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int_2.loc13_29: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc13_29.9: ref %i32 = array_index %a.var, %int_2.loc13_29
|
||||
// CHECK:STDOUT: %.loc13_29.10: init %i32 = initialize_from %.loc13_29.8 to %.loc13_29.9 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc13_29.11: init %array_type = array_init (%.loc13_29.4, %.loc13_29.7, %.loc13_29.10) to %a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc13_30: init %array_type = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc13_30
|
||||
// CHECK:STDOUT: %.loc13_3.2: init %array_type = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc13_3.2
|
||||
// CHECK:STDOUT: %.loc13_17: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3.loc13_16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_3.loc13_16, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %tuple.type.189 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc14_3.1: %tuple.type.189 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %tuple.type.189 = var b
|
||||
// CHECK:STDOUT: %b: ref %tuple.type.189 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3.loc14: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
@@ -126,8 +140,19 @@ fn G() {
|
||||
// CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %b.var, element2
|
||||
// CHECK:STDOUT: %.loc14_36.7: init %i32 = initialize_from %.loc14_36.6 to %tuple.elem2 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc14_36.8: init %tuple.type.189 = tuple_init (%.loc14_36.3, %.loc14_36.5, %.loc14_36.7) to %b.var [template = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc14_37: init %tuple.type.189 = converted %.loc14_36.1, %.loc14_36.8 [template = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %b.var, %.loc14_37
|
||||
// CHECK:STDOUT: %.loc14_3.2: init %tuple.type.189 = converted %.loc14_36.1, %.loc14_36.8 [template = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %b.var, %.loc14_3.2
|
||||
// CHECK:STDOUT: %.loc14_24.1: type = splice_block %.loc14_24.3 [template = constants.%tuple.type.189] {
|
||||
// CHECK:STDOUT: %int_32.loc14_11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14_24.2: %tuple.type.ff9 = tuple_literal (%i32.loc14_11, %i32.loc14_16, %i32.loc14_21)
|
||||
// CHECK:STDOUT: %.loc14_24.3: type = converted %.loc14_24.2, constants.%tuple.type.189 [template = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %tuple.type.189 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+13
-3
@@ -86,8 +86,11 @@ fn Run() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Run() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %t.patt: %array_type = binding_pattern t
|
||||
// CHECK:STDOUT: %.loc14_3.1: %array_type = var_pattern %t.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t.var: ref %array_type = var t
|
||||
// CHECK:STDOUT: %t: ref %array_type = bind_name t, %t.var
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
||||
// CHECK:STDOUT: %F.call: init %tuple.type.a1c = call %F.ref()
|
||||
// CHECK:STDOUT: %.loc14_23.1: ref %tuple.type.a1c = temporary_storage
|
||||
@@ -98,8 +101,15 @@ fn Run() {
|
||||
// CHECK:STDOUT: %.loc14_23.4: ref %i32 = array_index %t.var, %int_0
|
||||
// CHECK:STDOUT: %.loc14_23.5: init %i32 = initialize_from %.loc14_23.3 to %.loc14_23.4
|
||||
// CHECK:STDOUT: %.loc14_23.6: init %array_type = array_init (%.loc14_23.5) to %t.var
|
||||
// CHECK:STDOUT: %.loc14_24: init %array_type = converted %F.call, %.loc14_23.6
|
||||
// CHECK:STDOUT: assign %t.var, %.loc14_24
|
||||
// CHECK:STDOUT: %.loc14_3.2: init %array_type = converted %F.call, %.loc14_23.6
|
||||
// CHECK:STDOUT: assign %t.var, %.loc14_3.2
|
||||
// CHECK:STDOUT: %.loc14_17: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %array_type = bind_name t, %t.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+29
-4
@@ -16,6 +16,7 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
||||
// CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [template]
|
||||
// CHECK:STDOUT: %tuple.type.189: type = tuple_type (%i32, %i32, %i32) [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
|
||||
@@ -55,9 +56,33 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %tuple.type.189 = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc11_1: %tuple.type.189 = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.189 = var a
|
||||
// CHECK:STDOUT: %.loc11_22.1: type = splice_block %.loc11_22.3 [template = constants.%tuple.type.189] {
|
||||
// CHECK:STDOUT: %int_32.loc11_9: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_14: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_19: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_22.2: %tuple.type.ff9 = tuple_literal (%i32.loc11_9, %i32.loc11_14, %i32.loc11_19)
|
||||
// CHECK:STDOUT: %.loc11_22.3: type = converted %.loc11_22.2, constants.%tuple.type.189 [template = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.189 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %array_type = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc12_1: %array_type = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %array_type = var b
|
||||
// CHECK:STDOUT: %.loc12_15: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %array_type = bind_name b, %b.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -89,8 +114,8 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: %tuple.elem2.loc11: ref %i32 = tuple_access file.%a.var, element2
|
||||
// CHECK:STDOUT: %.loc11_34.7: init %i32 = initialize_from %.loc11_34.6 to %tuple.elem2.loc11 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc11_34.8: init %tuple.type.189 = tuple_init (%.loc11_34.3, %.loc11_34.5, %.loc11_34.7) to file.%a.var [template = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_35: init %tuple.type.189 = converted %.loc11_34.1, %.loc11_34.8 [template = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_35
|
||||
// CHECK:STDOUT: %.loc11_1: init %tuple.type.189 = converted %.loc11_34.1, %.loc11_34.8 [template = constants.%tuple]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.189 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %tuple.elem0.loc12: ref %i32 = tuple_access %a.ref, element0
|
||||
// CHECK:STDOUT: %.loc12_19.1: %i32 = bind_value %tuple.elem0.loc12
|
||||
@@ -108,8 +133,8 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: %.loc12_19.8: ref %i32 = array_index file.%b.var, %int_2.loc12
|
||||
// CHECK:STDOUT: %.loc12_19.9: init %i32 = initialize_from %.loc12_19.7 to %.loc12_19.8
|
||||
// CHECK:STDOUT: %.loc12_19.10: init %array_type = array_init (%.loc12_19.3, %.loc12_19.6, %.loc12_19.9) to file.%b.var
|
||||
// CHECK:STDOUT: %.loc12_20: init %array_type = converted %a.ref, %.loc12_19.10
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_20
|
||||
// CHECK:STDOUT: %.loc12_1: init %array_type = converted %a.ref, %.loc12_19.10
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+41
-6
@@ -30,6 +30,9 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %array.237: %array_type.0cb = tuple_value (%int_1.5d2) [template]
|
||||
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
|
||||
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
|
||||
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %array_type.ce7: type = array_type %int_2, f64 [template]
|
||||
// CHECK:STDOUT: %float.6e4: f64 = float_literal 11.100000000000001 [template]
|
||||
@@ -63,11 +66,43 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: .c = %c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type.0cb = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc11_1: %array_type.0cb = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type.0cb = var a
|
||||
// CHECK:STDOUT: %.loc11_15: type = splice_block %array_type.loc11 [template = constants.%array_type.0cb] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %array_type.loc11: type = array_type %int_1, %i32 [template = constants.%array_type.0cb]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type.0cb = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %array_type.ce7 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc12_1: %array_type.ce7 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %array_type.ce7 = var b
|
||||
// CHECK:STDOUT: %.loc12_15: type = splice_block %array_type.loc12 [template = constants.%array_type.ce7] {
|
||||
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
||||
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %float.make_type [template = f64]
|
||||
// CHECK:STDOUT: %.loc12_9.2: type = converted %float.make_type, %.loc12_9.1 [template = f64]
|
||||
// CHECK:STDOUT: %array_type.loc12: type = array_type %int_2, f64 [template = constants.%array_type.ce7]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %array_type.ce7 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %array_type.c13 = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc13_1: %array_type.c13 = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %array_type.c13 = var c
|
||||
// CHECK:STDOUT: %.loc13_14: type = splice_block %array_type.loc13 [template = constants.%array_type.c13] {
|
||||
// CHECK:STDOUT: %.loc13_10.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5]
|
||||
// CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %array_type.loc13: type = array_type %int_5, %empty_tuple.type [template = constants.%array_type.c13]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %array_type.c13 = bind_name c, %c.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -84,8 +119,8 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %.loc11_22.3: ref %i32 = array_index file.%a.var, %int_0.loc11
|
||||
// CHECK:STDOUT: %.loc11_22.4: init %i32 = initialize_from %.loc11_22.2 to %.loc11_22.3 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc11_22.5: init %array_type.0cb = array_init (%.loc11_22.4) to file.%a.var [template = constants.%array.237]
|
||||
// CHECK:STDOUT: %.loc11_23: init %array_type.0cb = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%array.237]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_23
|
||||
// CHECK:STDOUT: %.loc11_1: init %array_type.0cb = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%array.237]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %float.loc12_20: f64 = float_literal 11.100000000000001 [template = constants.%float.6e4]
|
||||
// CHECK:STDOUT: %float.loc12_26: f64 = float_literal 2.2000000000000002 [template = constants.%float.9f7]
|
||||
// CHECK:STDOUT: %.loc12_30.1: %tuple.type.bdb = tuple_literal (%float.loc12_20, %float.loc12_26)
|
||||
@@ -96,8 +131,8 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %.loc12_30.4: ref f64 = array_index file.%b.var, %int_1.loc12
|
||||
// CHECK:STDOUT: %.loc12_30.5: init f64 = initialize_from %float.loc12_26 to %.loc12_30.4 [template = constants.%float.9f7]
|
||||
// CHECK:STDOUT: %.loc12_30.6: init %array_type.ce7 = array_init (%.loc12_30.3, %.loc12_30.5) to file.%b.var [template = constants.%array.6a2]
|
||||
// CHECK:STDOUT: %.loc12_31: init %array_type.ce7 = converted %.loc12_30.1, %.loc12_30.6 [template = constants.%array.6a2]
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_31
|
||||
// CHECK:STDOUT: %.loc12_1: init %array_type.ce7 = converted %.loc12_30.1, %.loc12_30.6 [template = constants.%array.6a2]
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_1
|
||||
// CHECK:STDOUT: %.loc13_20.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc13_24.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc13_28.1: %empty_tuple.type = tuple_literal ()
|
||||
@@ -125,8 +160,8 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %.loc13_36.2: init %empty_tuple.type = tuple_init () to %.loc13_38.10 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.11: init %empty_tuple.type = converted %.loc13_36.1, %.loc13_36.2 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.12: init %array_type.c13 = array_init (%.loc13_38.3, %.loc13_38.5, %.loc13_38.7, %.loc13_38.9, %.loc13_38.11) to file.%c.var [template = constants.%array.1cb]
|
||||
// CHECK:STDOUT: %.loc13_39: init %array_type.c13 = converted %.loc13_38.1, %.loc13_38.12 [template = constants.%array.1cb]
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc13_39
|
||||
// CHECK:STDOUT: %.loc13_1: init %array_type.c13 = converted %.loc13_38.1, %.loc13_38.12 [template = constants.%array.1cb]
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc13_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+87
-6
@@ -28,6 +28,7 @@ let c: [i32; ConvertToU32(3)]* = &a;
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%import_ref.a5b), @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
|
||||
@@ -38,6 +39,11 @@ let c: [i32; ConvertToU32(3)]* = &a;
|
||||
// CHECK:STDOUT: %Convert.specific_fn.787: <specific function> = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %impl_witness.023: <witness> = impl_witness (imports.%import_ref.85c), @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.2d6: <bound method> = bound_method %int_3.822, %Convert.960 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.377: <specific function> = specific_function %Convert.bound.2d6, @Convert.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [template]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template]
|
||||
@@ -46,6 +52,12 @@ let c: [i32; ConvertToU32(3)]* = &a;
|
||||
// CHECK:STDOUT: %Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.b42: <specific function> = specific_function %Convert.bound.b30, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [template]
|
||||
// CHECK:STDOUT: %int_3.d14: %u32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %impl_witness.8da2: <witness> = impl_witness (imports.%import_ref.823), @impl.45(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.e06: type = fn_type @Convert.9, @impl.45(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.47f: %Convert.type.e06 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.258: <bound method> = bound_method %int_3.d14, %Convert.47f [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.d14: <specific function> = specific_function %Convert.bound.258, @Convert.9(%int_32) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -64,8 +76,8 @@ let c: [i32; ConvertToU32(3)]* = &a;
|
||||
// CHECK:STDOUT: .Add = %Add.decl
|
||||
// CHECK:STDOUT: .ConvertToU32 = %ConvertToU32.decl
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = @__global_init.%b
|
||||
// CHECK:STDOUT: .c = @__global_init.%c
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: .c = %c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Add.decl: %Add.type.b1f = fn_decl @Add.1 [template = constants.%Add] {
|
||||
@@ -110,8 +122,79 @@ let c: [i32; ConvertToU32(3)]* = &a;
|
||||
// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc14_1: %array_type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type = var a
|
||||
// CHECK:STDOUT: %.loc14_23: type = splice_block %array_type.loc14 [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %Add.ref: %Add.type.b1f = name_ref Add, %Add.decl [template = constants.%Add]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_18: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc14_18: <bound method> = bound_method %int_1, %impl.elem0.loc14_18 [template = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc14_18: <specific function> = specific_function %Convert.bound.loc14_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_18: init %i32 = call %Convert.specific_fn.loc14_18(%int_1) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_18.1: %i32 = value_of_initializer %int.convert_checked.loc14_18 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_18.2: %i32 = converted %int_1, %.loc14_18.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_21: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc14_21: <bound method> = bound_method %int_2, %impl.elem0.loc14_21 [template = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc14_21: <specific function> = specific_function %Convert.bound.loc14_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_21: init %i32 = call %Convert.specific_fn.loc14_21(%int_2) [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc14_21.1: %i32 = value_of_initializer %int.convert_checked.loc14_21 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc14_21.2: %i32 = converted %int_2, %.loc14_21.1 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc14_18.2, %.loc14_21.2) [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %impl.elem0.loc14_22: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %Convert.bound.loc14_22: <bound method> = bound_method %int.sadd, %impl.elem0.loc14_22 [template = constants.%Convert.bound.2d6]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc14_22: <specific function> = specific_function %Convert.bound.loc14_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.377]
|
||||
// CHECK:STDOUT: %.loc14_22.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc14_22.2: %i32 = converted %int.sadd, %.loc14_22.1 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_22: init Core.IntLiteral = call %Convert.specific_fn.loc14_22(%.loc14_22.2) [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc14_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_22 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc14_22.4: Core.IntLiteral = converted %int.sadd, %.loc14_22.3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type.loc14: type = array_type %.loc14_22.4, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %ptr = binding_pattern b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc15: type = splice_block %ptr.loc15 [template = constants.%ptr] {
|
||||
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3.loc15: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type.loc15: type = array_type %int_3.loc15, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: %ptr.loc15: type = ptr_type %array_type [template = constants.%ptr]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: %ptr = bind_name b, @__global_init.%addr.loc15
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %ptr = binding_pattern c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc16_30: type = splice_block %ptr.loc16 [template = constants.%ptr] {
|
||||
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %ConvertToU32.ref: %ConvertToU32.type = name_ref ConvertToU32, %ConvertToU32.decl [template = constants.%ConvertToU32]
|
||||
// CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %impl.elem0.loc16_27: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc16_27: <bound method> = bound_method %int_3.loc16, %impl.elem0.loc16_27 [template = constants.%Convert.bound.b30]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc16_27: <specific function> = specific_function %Convert.bound.loc16_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc16_27: init %i32 = call %Convert.specific_fn.loc16_27(%int_3.loc16) [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc16_27.1: %i32 = value_of_initializer %int.convert_checked.loc16_27 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc16_27.2: %i32 = converted %int_3.loc16, %.loc16_27.1 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc16_28.1: init %u32 = call %ConvertToU32.ref(%.loc16_27.2) [template = constants.%int_3.d14]
|
||||
// CHECK:STDOUT: %impl.elem0.loc16_28: %Convert.type.71e = impl_witness_access constants.%impl_witness.8da2, element0 [template = constants.%Convert.47f]
|
||||
// CHECK:STDOUT: %Convert.bound.loc16_28: <bound method> = bound_method %int.convert_checked.loc16_28.1, %impl.elem0.loc16_28 [template = constants.%Convert.bound.258]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc16_28: <specific function> = specific_function %Convert.bound.loc16_28, @Convert.9(constants.%int_32) [template = constants.%Convert.specific_fn.d14]
|
||||
// CHECK:STDOUT: %.loc16_28.1: %u32 = value_of_initializer %int.convert_checked.loc16_28.1 [template = constants.%int_3.d14]
|
||||
// CHECK:STDOUT: %.loc16_28.2: %u32 = converted %int.convert_checked.loc16_28.1, %.loc16_28.1 [template = constants.%int_3.d14]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc16_28.2: init Core.IntLiteral = call %Convert.specific_fn.loc16_28(%.loc16_28.2) [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc16_28.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_28.2 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc16_28.4: Core.IntLiteral = converted %int.convert_checked.loc16_28.1, %.loc16_28.3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type.loc16: type = array_type %.loc16_28.4, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: %ptr.loc16: type = ptr_type %array_type [template = constants.%ptr]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: %ptr = bind_name c, @__global_init.%addr.loc16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd";
|
||||
@@ -149,14 +232,12 @@ let c: [i32; ConvertToU32(3)]* = &a;
|
||||
// CHECK:STDOUT: %.loc14_35.9: ref %i32 = array_index file.%a.var, %int_2.loc14_35
|
||||
// CHECK:STDOUT: %.loc14_35.10: init %i32 = initialize_from %.loc14_35.8 to %.loc14_35.9 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc14_35.11: init %array_type = array_init (%.loc14_35.4, %.loc14_35.7, %.loc14_35.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc14_36: init %array_type = converted %.loc14_35.1, %.loc14_35.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc14_36
|
||||
// CHECK:STDOUT: %.loc14_1: init %array_type = converted %.loc14_35.1, %.loc14_35.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc14_1
|
||||
// CHECK:STDOUT: %a.ref.loc15: ref %array_type = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %addr.loc15: %ptr = addr_of %a.ref.loc15
|
||||
// CHECK:STDOUT: %b: %ptr = bind_name b, %addr.loc15
|
||||
// CHECK:STDOUT: %a.ref.loc16: ref %array_type = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %addr.loc16: %ptr = addr_of %a.ref.loc16
|
||||
// CHECK:STDOUT: %c: %ptr = bind_name c, %addr.loc16
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+43
-1
@@ -23,6 +23,22 @@ var a: [i32; Negate(1)];
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
||||
// CHECK:STDOUT: %Negate.type.15b: type = fn_type @Negate.1 [template]
|
||||
// CHECK:STDOUT: %Negate: %Negate.type.15b = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%import_ref.a5b), @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.70c: <specific function> = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %int_-1.251: %i32 = int_value -1 [template]
|
||||
// CHECK:STDOUT: %impl_witness.023: <witness> = impl_witness (imports.%import_ref.85c), @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.75d: <bound method> = bound_method %int_-1.251, %Convert.960 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.4af: <specific function> = specific_function %Convert.bound.75d, @Convert.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_-1.638: Core.IntLiteral = int_value -1 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -58,8 +74,34 @@ var a: [i32; Negate(1)];
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: <error> = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc17_1: <error> = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref <error> = var a
|
||||
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc17_23: type = splice_block %array_type [template = <error>] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %Negate.ref: %Negate.type.15b = name_ref Negate, %Negate.decl [template = constants.%Negate]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc17_21: <bound method> = bound_method %int_1, %impl.elem0.loc17_21 [template = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc17_21: <specific function> = specific_function %Convert.bound.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %Convert.specific_fn.loc17_21(%int_1) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %int.convert_checked.loc17_21 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_1, %.loc17_21.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc17_21.2) [template = constants.%int_-1.251]
|
||||
// CHECK:STDOUT: %impl.elem0.loc17_22: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %Convert.bound.loc17_22: <bound method> = bound_method %int.snegate, %impl.elem0.loc17_22 [template = constants.%Convert.bound.75d]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc17_22: <specific function> = specific_function %Convert.bound.loc17_22, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.4af]
|
||||
// CHECK:STDOUT: %.loc17_22.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1.251]
|
||||
// CHECK:STDOUT: %.loc17_22.2: %i32 = converted %int.snegate, %.loc17_22.1 [template = constants.%int_-1.251]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc17_22: init Core.IntLiteral = call %Convert.specific_fn.loc17_22(%.loc17_22.2) [template = constants.%int_-1.638]
|
||||
// CHECK:STDOUT: %.loc17_22.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17_22 [template = constants.%int_-1.638]
|
||||
// CHECK:STDOUT: %.loc17_22.4: Core.IntLiteral = converted %int.snegate, %.loc17_22.3 [template = constants.%int_-1.638]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %.loc17_22.4, %i32 [template = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: <error> = bind_name a, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Negate.1(%n.param_patt: %i32) -> %i32 = "int.snegate";
|
||||
|
||||
+26
-2
@@ -26,6 +26,10 @@ var b: [1; 39999999999999999993];
|
||||
// CHECK:STDOUT: --- fail_bound_overflow.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_39999999999999999993: Core.IntLiteral = int_value 39999999999999999993 [template]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -44,9 +48,29 @@ var b: [1; 39999999999999999993];
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: <error> = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc15_1: <error> = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref <error> = var a
|
||||
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc15_34: type = splice_block %array_type.loc15 [template = <error>] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_39999999999999999993.loc15: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%int_39999999999999999993]
|
||||
// CHECK:STDOUT: %array_type.loc15: type = array_type %int_39999999999999999993.loc15, %i32 [template = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: <error> = bind_name a, <error>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: <error> = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc24_1: <error> = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref <error> = var b
|
||||
// CHECK:STDOUT: %b: ref <error> = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %.loc24_32: type = splice_block %array_type.loc24 [template = <error>] {
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_39999999999999999993.loc24: Core.IntLiteral = int_value 39999999999999999993 [template = constants.%int_39999999999999999993]
|
||||
// CHECK:STDOUT: %.loc24_9: type = converted %int_1, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %array_type.loc24: type = array_type %int_39999999999999999993.loc24, <error> [template = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: <error> = bind_name b, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -25,6 +25,8 @@ var p: Incomplete* = &a[0];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_1, %Incomplete [template]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -45,9 +47,26 @@ var p: Incomplete* = &a[0];
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {}
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: <error> = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc20_1: <error> = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref <error> = var a
|
||||
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc20_22: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_1, %Incomplete [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: <error> = bind_name a, <error>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %p.patt: %ptr = binding_pattern p
|
||||
// CHECK:STDOUT: %.loc22_1: %ptr = var_pattern %p.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.var: ref %ptr = var p
|
||||
// CHECK:STDOUT: %.loc22_18: type = splice_block %ptr [template = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc22: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template = constants.%ptr]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -55,7 +74,7 @@ var p: Incomplete* = &a[0];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.ref: ref <error> = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %a.ref: <error> = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
|
||||
// CHECK:STDOUT: %addr: <error> = addr_of <error> [template = <error>]
|
||||
// CHECK:STDOUT: assign file.%p.var, <error>
|
||||
|
||||
+12
-1
@@ -20,6 +20,7 @@ var a: [1; 1];
|
||||
// CHECK:STDOUT: --- fail_invalid_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -36,7 +37,17 @@ var a: [1; 1];
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: <error> = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc18_1: <error> = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref <error> = var a
|
||||
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc18_13: type = splice_block %array_type [template = <error>] {
|
||||
// CHECK:STDOUT: %int_1.loc18_9: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_1.loc18_12: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc18_9: type = converted %int_1.loc18_9, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_1.loc18_12, <error> [template = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: <error> = bind_name a, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -40,7 +40,17 @@ var a: [i32; 1] = (1, 2, 3);
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc15_1: %array_type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type = var a
|
||||
// CHECK:STDOUT: %.loc15_15: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_1, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -60,9 +60,27 @@ var b: i32 = a[{.index = 3}.index];
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc11_1: %array_type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type = var a
|
||||
// CHECK:STDOUT: %.loc11_15: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc16_1: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %.loc16_8: type = splice_block %i32.loc16 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -97,8 +115,8 @@ var b: i32 = a[{.index = 3}.index];
|
||||
// CHECK:STDOUT: %.loc11_27.9: ref %i32 = array_index file.%a.var, %int_2.loc11_27
|
||||
// CHECK:STDOUT: %.loc11_27.10: init %i32 = initialize_from %.loc11_27.8 to %.loc11_27.9 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc11_27.11: init %array_type = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_28: init %array_type = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_28
|
||||
// CHECK:STDOUT: %.loc11_1: init %array_type = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %array_type = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %int_3.loc16: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc16_27.1: %struct_type.index = struct_literal (%int_3.loc16)
|
||||
|
||||
@@ -59,9 +59,11 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1.5b8, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [template]
|
||||
// CHECK:STDOUT: %tuple.type.9e7: type = tuple_type (%i32, String, String) [template]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
|
||||
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -85,17 +87,79 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: .d = %d
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc18_1: %array_type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type = var a
|
||||
// CHECK:STDOUT: %.loc18_15: type = splice_block %array_type.loc18 [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3.loc18: Core.IntLiteral = int_value 3 [template = constants.%int_3]
|
||||
// CHECK:STDOUT: %array_type.loc18: type = array_type %int_3.loc18, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %t1.patt: %tuple.type.9e7 = binding_pattern t1
|
||||
// CHECK:STDOUT: %.loc20_1: %tuple.type.9e7 = var_pattern %t1.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t1.var: ref %tuple.type.9e7 = var t1
|
||||
// CHECK:STDOUT: %.loc20_29.1: type = splice_block %.loc20_29.3 [template = constants.%tuple.type.9e7] {
|
||||
// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc20_29.2: %tuple.type.ff9 = tuple_literal (%i32.loc20, String, String)
|
||||
// CHECK:STDOUT: %.loc20_29.3: type = converted %.loc20_29.2, constants.%tuple.type.9e7 [template = constants.%tuple.type.9e7]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t1: ref %tuple.type.9e7 = bind_name t1, %t1.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %array_type = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc28_1: %array_type = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %array_type = var b
|
||||
// CHECK:STDOUT: %.loc28_15: type = splice_block %array_type.loc28 [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc28: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3.loc28: Core.IntLiteral = int_value 3 [template = constants.%int_3]
|
||||
// CHECK:STDOUT: %array_type.loc28: type = array_type %int_3.loc28, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %array_type = bind_name b, %b.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %array_type = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc34_1: %array_type = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %array_type = var c
|
||||
// CHECK:STDOUT: %.loc34_15: type = splice_block %array_type.loc34 [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3.loc34: Core.IntLiteral = int_value 3 [template = constants.%int_3]
|
||||
// CHECK:STDOUT: %array_type.loc34: type = array_type %int_3.loc34, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %array_type = bind_name c, %c.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %t2.patt: %tuple.type.d07 = binding_pattern t2
|
||||
// CHECK:STDOUT: %.loc36_1: %tuple.type.d07 = var_pattern %t2.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t2.var: ref %tuple.type.d07 = var t2
|
||||
// CHECK:STDOUT: %.loc36_18.1: type = splice_block %.loc36_18.3 [template = constants.%tuple.type.d07] {
|
||||
// CHECK:STDOUT: %int_32.loc36_10: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc36_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc36_15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc36_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc36_18.2: %tuple.type.24b = tuple_literal (%i32.loc36_10, %i32.loc36_15)
|
||||
// CHECK:STDOUT: %.loc36_18.3: type = converted %.loc36_18.2, constants.%tuple.type.d07 [template = constants.%tuple.type.d07]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t2: ref %tuple.type.d07 = bind_name t2, %t2.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %array_type = binding_pattern d
|
||||
// CHECK:STDOUT: %.loc41_1: %array_type = var_pattern %d.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %array_type = var d
|
||||
// CHECK:STDOUT: %.loc41_15: type = splice_block %array_type.loc41 [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc41: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc41: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3.loc41: Core.IntLiteral = int_value 3 [template = constants.%int_3]
|
||||
// CHECK:STDOUT: %array_type.loc41: type = array_type %int_3.loc41, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %array_type = bind_name d, %d.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+17
-8
@@ -54,18 +54,27 @@ fn G(T:! type) {
|
||||
// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %array_type: type = array_type constants.%int_0, @G.%T.loc11_6.2 (%T) [symbolic = %array_type (constants.%array_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @G.%array_type (%array_type) [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %array: @G.%array_type (%array_type) = tuple_value () [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: %array_type.loc13_17.2: type = array_type constants.%int_0, @G.%T.loc11_6.2 (%T) [symbolic = %array_type.loc13_17.2 (constants.%array_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @G.%array_type.loc13_17.2 (%array_type) [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %array: @G.%array_type.loc13_17.2 (%array_type) = tuple_value () [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%T.param_patt: type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %arr.var: ref @G.%array_type (%array_type) = var arr
|
||||
// CHECK:STDOUT: %arr: ref @G.%array_type (%array_type) = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: @G.%array_type.loc13_17.2 (%array_type) = binding_pattern arr
|
||||
// CHECK:STDOUT: %.loc13_3.1: @G.%array_type.loc13_17.2 (%array_type) = var_pattern %arr.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr.var: ref @G.%array_type.loc13_17.2 (%array_type) = var arr
|
||||
// CHECK:STDOUT: %.loc13_22.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc13_22.2: init @G.%array_type (%array_type) = array_init () to %arr.var [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: %.loc13_23: init @G.%array_type (%array_type) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: assign %arr.var, %.loc13_23
|
||||
// CHECK:STDOUT: %.loc13_22.2: init @G.%array_type.loc13_17.2 (%array_type) = array_init () to %arr.var [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: %.loc13_3.2: init @G.%array_type.loc13_17.2 (%array_type) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: assign %arr.var, %.loc13_3.2
|
||||
// CHECK:STDOUT: %.loc13_17: type = splice_block %array_type.loc13_17.1 [symbolic = %array_type.loc13_17.2 (constants.%array_type)] {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
|
||||
// CHECK:STDOUT: %array_type.loc13_17.1: type = array_type %int_0, %T [symbolic = %array_type.loc13_17.2 (constants.%array_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr: ref @G.%array_type.loc13_17.2 (%array_type) = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+20
-2
@@ -56,9 +56,27 @@ var b: i32 = a[{.index = 2}.index];
|
||||
// CHECK:STDOUT: .b = %b
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc11_1: %array_type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type = var a
|
||||
// CHECK:STDOUT: %.loc11_15: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_3, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc12_1: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %.loc12_8: type = splice_block %i32.loc12 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -93,8 +111,8 @@ var b: i32 = a[{.index = 2}.index];
|
||||
// CHECK:STDOUT: %.loc11_27.9: ref %i32 = array_index file.%a.var, %int_2.loc11_27
|
||||
// CHECK:STDOUT: %.loc11_27.10: init %i32 = initialize_from %.loc11_27.8 to %.loc11_27.9 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc11_27.11: init %array_type = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_28: init %array_type = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_28
|
||||
// CHECK:STDOUT: %.loc11_1: init %array_type = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: %a.ref: ref %array_type = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc12_27.1: %struct_type.index = struct_literal (%int_2.loc12)
|
||||
|
||||
+29
-11
@@ -44,6 +44,8 @@ fn H() { G(3); }
|
||||
// CHECK:STDOUT: %N.patt.8e2: %i32 = symbolic_binding_pattern N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %impl_witness.023: <witness> = impl_witness (imports.%import_ref.85c), @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.3, @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.960: %Convert.type.4ad = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %N.51e, %Convert.960 [symbolic]
|
||||
@@ -77,9 +79,9 @@ fn H() { G(3); }
|
||||
// CHECK:STDOUT: %N.param_patt: %i32 = value_param_pattern %N.patt.loc4_6.1, runtime_param<invalid> [symbolic = %N.patt.loc4_6.2 (constants.%N.patt.8e2)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %N.param: %i32 = value_param runtime_param<invalid>
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %N.loc4_6.1: %i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_6.2 (constants.%N.51e)]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -90,21 +92,37 @@ fn H() { G(3); }
|
||||
// CHECK:STDOUT: %N.patt.loc4_6.2: %i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt.8e2)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %N.loc4_6.2, constants.%Convert.960 [symbolic = %Convert.bound (constants.%Convert.bound)]
|
||||
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn (constants.%Convert.specific_fn)]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %Convert.specific_fn(%N.loc4_6.2) [symbolic = %int.convert_checked (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int.convert_checked, %i32 [symbolic = %array_type (constants.%array_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @F.%array_type (%array_type) [symbolic = %require_complete (constants.%require_complete.9dc)]
|
||||
// CHECK:STDOUT: %Convert.bound.loc9_18.2: <bound method> = bound_method %N.loc4_6.2, constants.%Convert.960 [symbolic = %Convert.bound.loc9_18.2 (constants.%Convert.bound)]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc9_18.2: <specific function> = specific_function %Convert.bound.loc9_18.2, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc9_18.2 (constants.%Convert.specific_fn)]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc9_18.2: init Core.IntLiteral = call %Convert.specific_fn.loc9_18.2(%N.loc4_6.2) [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT: %array_type.loc9_19.2: type = array_type %int.convert_checked.loc9_18.2, %i32 [symbolic = %array_type.loc9_19.2 (constants.%array_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @F.%array_type.loc9_19.2 (%array_type) [symbolic = %require_complete (constants.%require_complete.9dc)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%N.param_patt: %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %arr.var: ref @F.%array_type (%array_type) = var arr
|
||||
// CHECK:STDOUT: %arr: ref @F.%array_type (%array_type) = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: @F.%array_type.loc9_19.2 (%array_type) = binding_pattern arr
|
||||
// CHECK:STDOUT: %.loc9_3: @F.%array_type.loc9_19.2 (%array_type) = var_pattern %arr.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr.var: ref @F.%array_type.loc9_19.2 (%array_type) = var arr
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc9: %tuple.type = tuple_literal (%int_1, %int_2, %int_3)
|
||||
// CHECK:STDOUT: %.loc9_31: %tuple.type = tuple_literal (%int_1, %int_2, %int_3)
|
||||
// CHECK:STDOUT: assign %arr.var, <error>
|
||||
// CHECK:STDOUT: %.loc9_19: type = splice_block %array_type.loc9_19.1 [symbolic = %array_type.loc9_19.2 (constants.%array_type)] {
|
||||
// CHECK:STDOUT: %int_32.loc9: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %N.ref: %i32 = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N.51e)]
|
||||
// CHECK:STDOUT: %impl.elem0: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %Convert.bound.loc9_18.1: <bound method> = bound_method %N.ref, %impl.elem0 [symbolic = %Convert.bound.loc9_18.2 (constants.%Convert.bound)]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc9_18.1: <specific function> = specific_function %Convert.bound.loc9_18.1, @Convert.3(constants.%int_32) [symbolic = %Convert.specific_fn.loc9_18.2 (constants.%Convert.specific_fn)]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc9_18.1: init Core.IntLiteral = call %Convert.specific_fn.loc9_18.1(%N.ref) [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT: %.loc9_18.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc9_18.1 [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT: %.loc9_18.2: Core.IntLiteral = converted %N.ref, %.loc9_18.1 [symbolic = %int.convert_checked.loc9_18.2 (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT: %array_type.loc9_19.1: type = array_type %.loc9_18.2, %i32 [symbolic = %array_type.loc9_19.2 (constants.%array_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr: ref @F.%array_type.loc9_19.2 (%array_type) = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+12
-2
@@ -76,7 +76,17 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc11_1: %array_type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type = var a
|
||||
// CHECK:STDOUT: %.loc11_15: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9.988]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_9, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -165,8 +175,8 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
// CHECK:STDOUT: %.loc11_45.27: ref %i32 = array_index file.%a.var, %int_8.loc11_45
|
||||
// CHECK:STDOUT: %.loc11_45.28: init %i32 = initialize_from %.loc11_45.26 to %.loc11_45.27 [template = constants.%int_9.f88]
|
||||
// CHECK:STDOUT: %.loc11_45.29: init %array_type = array_init (%.loc11_45.4, %.loc11_45.7, %.loc11_45.10, %.loc11_45.13, %.loc11_45.16, %.loc11_45.19, %.loc11_45.22, %.loc11_45.25, %.loc11_45.28) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_46: init %array_type = converted %.loc11_45.1, %.loc11_45.29 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_46
|
||||
// CHECK:STDOUT: %.loc11_1: init %array_type = converted %.loc11_45.1, %.loc11_45.29 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user