mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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
@@ -23,6 +23,25 @@ fn RuntimeCall(a: i32, b: i32) -> i32 {
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
||||
// CHECK:STDOUT: %Add.type.b1f: type = fn_type @Add.1 [template]
|
||||
// CHECK:STDOUT: %Add: %Add.type.b1f = struct_value () [template]
|
||||
// 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]
|
||||
// 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: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
|
||||
// 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: %RuntimeCall.type: type = fn_type @RuntimeCall [template]
|
||||
@@ -71,7 +90,40 @@ fn RuntimeCall(a: i32, b: i32) -> i32 {
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: %array_type = binding_pattern arr
|
||||
// CHECK:STDOUT: %.loc13_1: %array_type = var_pattern %arr.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr.var: ref %array_type = var arr
|
||||
// CHECK:STDOUT: %.loc13_25: 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: %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.loc13_20: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc13_20: <bound method> = bound_method %int_1, %impl.elem0.loc13_20 [template = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc13_20: <specific function> = specific_function %Convert.bound.loc13_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_20: init %i32 = call %Convert.specific_fn.loc13_20(%int_1) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc13_20.1: %i32 = value_of_initializer %int.convert_checked.loc13_20 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc13_20.2: %i32 = converted %int_1, %.loc13_20.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc13_23: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc13_23: <bound method> = bound_method %int_2, %impl.elem0.loc13_23 [template = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc13_23: <specific function> = specific_function %Convert.bound.loc13_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_23: init %i32 = call %Convert.specific_fn.loc13_23(%int_2) [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc13_23.1: %i32 = value_of_initializer %int.convert_checked.loc13_23 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc13_23.2: %i32 = converted %int_2, %.loc13_23.1 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%.loc13_20.2, %.loc13_23.2) [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %Convert.bound.loc13_24: <bound method> = bound_method %int.sadd, %impl.elem0.loc13_24 [template = constants.%Convert.bound.2d6]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc13_24: <specific function> = specific_function %Convert.bound.loc13_24, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.377]
|
||||
// CHECK:STDOUT: %.loc13_24.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc13_24.2: %i32 = converted %int.sadd, %.loc13_24.1 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13_24: init Core.IntLiteral = call %Convert.specific_fn.loc13_24(%.loc13_24.2) [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc13_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc13_24.4: Core.IntLiteral = converted %int.sadd, %.loc13_24.3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %.loc13_24.4, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] {
|
||||
// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
|
||||
|
||||
@@ -34,6 +34,30 @@ var arr: [i32; (1 as i32).(I.F)(2)];
|
||||
// CHECK:STDOUT: %F.type.066: type = fn_type @F.2 [template]
|
||||
// CHECK:STDOUT: %F.9ec: %F.type.066 = struct_value () [template]
|
||||
// CHECK:STDOUT: %I.facet: %I.type = facet_value %i32, %impl_witness.da7 [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %Convert.type.99b: type = fn_type @Convert.1, @As(%i32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.71e: type = fn_type @Convert.2, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %impl_witness.882: <witness> = impl_witness (imports.%import_ref.78a), @impl.4(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4fd: type = fn_type @Convert.5, @impl.4(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.197: %Convert.type.4fd = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.c1b: <bound method> = bound_method %int_1.5b8, %Convert.197 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.f9a: <specific function> = specific_function %Convert.bound.c1b, @Convert.5(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %int_1.5d2, %F.9ec [template]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.2, @ImplicitAs(%i32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%import_ref.a5b), @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.3, @impl.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.787: <specific function> = specific_function %Convert.bound.ef9, @Convert.3(%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.3(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.4ad: type = fn_type @Convert.4, @impl.3(%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.4(%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: }
|
||||
@@ -62,7 +86,45 @@ var arr: [i32; (1 as i32).(I.F)(2)];
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.1.%F.decl) [template = constants.%impl_witness.da7]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: %array_type = binding_pattern arr
|
||||
// CHECK:STDOUT: %.loc19_1: %array_type = var_pattern %arr.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr.var: ref %array_type = var arr
|
||||
// CHECK:STDOUT: %.loc19_35: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc19_11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc19_11: 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: %int_32.loc19_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc19_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0.loc19_19: %Convert.type.99b = impl_witness_access constants.%impl_witness.882, element0 [template = constants.%Convert.197]
|
||||
// CHECK:STDOUT: %Convert.bound.loc19_19: <bound method> = bound_method %int_1, %impl.elem0.loc19_19 [template = constants.%Convert.bound.c1b]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc19_19: <specific function> = specific_function %Convert.bound.loc19_19, @Convert.5(constants.%int_32) [template = constants.%Convert.specific_fn.f9a]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc19_19: init %i32 = call %Convert.specific_fn.loc19_19(%int_1) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc19_19.1: %i32 = value_of_initializer %int.convert_checked.loc19_19 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc19_19.2: %i32 = converted %int_1, %.loc19_19.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%I.type]
|
||||
// CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, @I.%assoc0 [template = constants.%assoc0.fa7]
|
||||
// CHECK:STDOUT: %impl.elem0.loc19_26: %F.type.cf0 = impl_witness_access constants.%impl_witness.da7, element0 [template = constants.%F.9ec]
|
||||
// CHECK:STDOUT: %F.bound: <bound method> = bound_method %.loc19_19.2, %impl.elem0.loc19_26 [template = constants.%F.bound]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %impl.elem0.loc19_33: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc19_33: <bound method> = bound_method %int_2, %impl.elem0.loc19_33 [template = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc19_33: <specific function> = specific_function %Convert.bound.loc19_33, @Convert.3(constants.%int_32) [template = constants.%Convert.specific_fn.787]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc19_33: init %i32 = call %Convert.specific_fn.loc19_33(%int_2) [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc19_33.1: %i32 = value_of_initializer %int.convert_checked.loc19_33 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc19_33.2: %i32 = converted %int_2, %.loc19_33.1 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %int.sadd: init %i32 = call %F.bound(%.loc19_19.2, %.loc19_33.2) [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %impl.elem0.loc19_34: %Convert.type.71e = impl_witness_access constants.%impl_witness.023, element0 [template = constants.%Convert.960]
|
||||
// CHECK:STDOUT: %Convert.bound.loc19_34: <bound method> = bound_method %int.sadd, %impl.elem0.loc19_34 [template = constants.%Convert.bound.2d6]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc19_34: <specific function> = specific_function %Convert.bound.loc19_34, @Convert.4(constants.%int_32) [template = constants.%Convert.specific_fn.377]
|
||||
// CHECK:STDOUT: %.loc19_34.1: %i32 = value_of_initializer %int.sadd [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc19_34.2: %i32 = converted %int.sadd, %.loc19_34.1 [template = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc19_34: init Core.IntLiteral = call %Convert.specific_fn.loc19_34(%.loc19_34.2) [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc19_34.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc19_34 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc19_34.4: Core.IntLiteral = converted %int.sadd, %.loc19_34.3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %.loc19_34.4, %i32 [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -131,7 +131,12 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
|
||||
// CHECK:STDOUT: %return.param: ref %MyInt32 = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref %MyInt32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %MyInt32 = binding_pattern v
|
||||
// CHECK:STDOUT: %.loc22: %MyInt32 = var_pattern %v.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %MyInt32 = var v
|
||||
// CHECK:STDOUT: %MyInt32.ref: type = name_ref MyInt32, %MyInt32.decl [template = constants.%MyInt32]
|
||||
// CHECK:STDOUT: %v: ref %MyInt32 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+51
-2
@@ -612,7 +612,11 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %impl_witness.d9b: <witness> = impl_witness (imports.%import_ref.73a) [template]
|
||||
// CHECK:STDOUT: %Convert.type.953: type = fn_type @Convert.3 [template]
|
||||
// CHECK:STDOUT: %Convert.5bc: %Convert.type.953 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.b34: <bound method> = bound_method %int_1.5b8, %Convert.5bc [template]
|
||||
// CHECK:STDOUT: %int_1.f38: %i32.builtin = int_value 1 [template]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %Convert.bound.324: <bound method> = bound_method %int_2.ecc, %Convert.5bc [template]
|
||||
// CHECK:STDOUT: %int_2.5a1: %i32.builtin = int_value 2 [template]
|
||||
// CHECK:STDOUT: %Op.type.545: type = fn_type @Op.1 [template]
|
||||
// CHECK:STDOUT: %Self.as_type.da9: type = facet_access_type %Self.a99 [symbolic]
|
||||
// CHECK:STDOUT: %Op.assoc_type: type = assoc_entity_type %Add.type, %Op.type.545 [template]
|
||||
@@ -620,9 +624,13 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %impl_witness.bd0: <witness> = impl_witness (imports.%import_ref.db4) [template]
|
||||
// CHECK:STDOUT: %Op.type.240: type = fn_type @Op.2 [template]
|
||||
// CHECK:STDOUT: %Op.0e2: %Op.type.240 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Op.bound.393: <bound method> = bound_method %int_1.f38, %Op.0e2 [template]
|
||||
// CHECK:STDOUT: %int_3.a0f: %i32.builtin = int_value 3 [template]
|
||||
// CHECK:STDOUT: %assoc0.5048c6.2: %Convert.assoc_type.c0e = assoc_entity element0, imports.%import_ref.207961.4 [symbolic]
|
||||
// CHECK:STDOUT: %impl_witness.8f3: <witness> = impl_witness (imports.%import_ref.4f9) [template]
|
||||
// CHECK:STDOUT: %Convert.type.0e4: type = fn_type @Convert.4 [template]
|
||||
// CHECK:STDOUT: %Convert.b32: %Convert.type.0e4 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.65a: <bound method> = bound_method %int_3.a0f, %Convert.b32 [template]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32.builtin [template]
|
||||
// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template]
|
||||
@@ -680,7 +688,48 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: .arr = %arr
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: %array_type = binding_pattern arr
|
||||
// CHECK:STDOUT: %.loc4_1: %array_type = var_pattern %arr.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr.var: ref %array_type = var arr
|
||||
// CHECK:STDOUT: %.loc4_39: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %int.make_type_signed.loc4_11: init type = call constants.%Int(%int_32.loc4_11) [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %int.make_type_signed.loc4_22: init type = call constants.%Int(%int_32.loc4_22) [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc4_22.1: type = value_of_initializer %int.make_type_signed.loc4_22 [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc4_22.2: type = converted %int.make_type_signed.loc4_22, %.loc4_22.1 [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %impl.elem0.loc4_19: %Convert.type.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
|
||||
// CHECK:STDOUT: %Convert.bound.loc4_19: <bound method> = bound_method %int_1, %impl.elem0.loc4_19 [template = constants.%Convert.bound.b34]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc4_19: init %i32.builtin = call %Convert.bound.loc4_19(%int_1) [template = constants.%int_1.f38]
|
||||
// CHECK:STDOUT: %.loc4_19.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_19 [template = constants.%int_1.f38]
|
||||
// CHECK:STDOUT: %.loc4_19.2: %i32.builtin = converted %int_1, %.loc4_19.1 [template = constants.%int_1.f38]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_32.loc4_35: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %int.make_type_signed.loc4_35: init type = call constants.%Int(%int_32.loc4_35) [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %int.make_type_signed.loc4_35 [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc4_35.2: type = converted %int.make_type_signed.loc4_35, %.loc4_35.1 [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %impl.elem0.loc4_32: %Convert.type.378 = impl_witness_access constants.%impl_witness.d9b, element0 [template = constants.%Convert.5bc]
|
||||
// CHECK:STDOUT: %Convert.bound.loc4_32: <bound method> = bound_method %int_2, %impl.elem0.loc4_32 [template = constants.%Convert.bound.324]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc4_32: init %i32.builtin = call %Convert.bound.loc4_32(%int_2) [template = constants.%int_2.5a1]
|
||||
// CHECK:STDOUT: %.loc4_32.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_32 [template = constants.%int_2.5a1]
|
||||
// CHECK:STDOUT: %.loc4_32.2: %i32.builtin = converted %int_2, %.loc4_32.1 [template = constants.%int_2.5a1]
|
||||
// CHECK:STDOUT: %impl.elem0.loc4_27.1: %Op.type.545 = impl_witness_access constants.%impl_witness.bd0, element0 [template = constants.%Op.0e2]
|
||||
// CHECK:STDOUT: %Op.bound: <bound method> = bound_method %.loc4_19.2, %impl.elem0.loc4_27.1 [template = constants.%Op.bound.393]
|
||||
// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %Op.bound(%.loc4_19.2, %.loc4_32.2) [template = constants.%int_3.a0f]
|
||||
// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed.loc4_11 [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed.loc4_11, %.loc4_11.1 [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %impl.elem0.loc4_27.2: %Convert.type.71e = impl_witness_access constants.%impl_witness.8f3, element0 [template = constants.%Convert.b32]
|
||||
// CHECK:STDOUT: %Convert.bound.loc4_27: <bound method> = bound_method %int.sadd, %impl.elem0.loc4_27.2 [template = constants.%Convert.bound.65a]
|
||||
// CHECK:STDOUT: %.loc4_27.1: %i32.builtin = value_of_initializer %int.sadd [template = constants.%int_3.a0f]
|
||||
// CHECK:STDOUT: %.loc4_27.2: %i32.builtin = converted %int.sadd, %.loc4_27.1 [template = constants.%int_3.a0f]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc4_27: init Core.IntLiteral = call %Convert.bound.loc4_27(%.loc4_27.2) [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc4_27.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_27 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc4_27.4: Core.IntLiteral = converted %int.sadd, %.loc4_27.3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %.loc4_27.4, %i32.builtin [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -832,8 +881,8 @@ var arr: [i32; (1 as i32) + (2 as i32)] = (3, 4, (3 as i32) + (4 as i32));
|
||||
// CHECK:STDOUT: %.loc4_73.8: ref %i32.builtin = array_index file.%arr.var, %int_2
|
||||
// CHECK:STDOUT: %.loc4_73.9: init %i32.builtin = initialize_from %int.sadd to %.loc4_73.8 [template = constants.%int_7]
|
||||
// CHECK:STDOUT: %.loc4_73.10: init %array_type = array_init (%.loc4_73.4, %.loc4_73.7, %.loc4_73.9) to file.%arr.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc4_74: init %array_type = converted %.loc4_73.1, %.loc4_73.10 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%arr.var, %.loc4_74
|
||||
// CHECK:STDOUT: %.loc4_1: init %array_type = converted %.loc4_73.1, %.loc4_73.10 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%arr.var, %.loc4_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -165,7 +165,13 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] =
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
||||
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
|
||||
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
|
||||
// CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template]
|
||||
// CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template]
|
||||
// CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [template]
|
||||
// CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
@@ -188,6 +194,8 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] =
|
||||
// CHECK:STDOUT: .AsI32 = %import_ref.614
|
||||
// CHECK:STDOUT: import Core//core
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.d91: %AsIntLiteral.type = import_ref Core//core, AsIntLiteral, loaded [template = constants.%AsIntLiteral]
|
||||
// CHECK:STDOUT: %import_ref.a93: %TestAdd.type = import_ref Core//core, TestAdd, loaded [template = constants.%TestAdd]
|
||||
// CHECK:STDOUT: %import_ref.614: %AsI32.type = import_ref Core//core, AsI32, loaded [template = constants.%AsI32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -197,7 +205,40 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] =
|
||||
// CHECK:STDOUT: .arr = %arr
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %arr.patt: %array_type = binding_pattern arr
|
||||
// CHECK:STDOUT: %.loc4_1: %array_type = var_pattern %arr.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr.var: ref %array_type = var arr
|
||||
// CHECK:STDOUT: %.loc4_77: type = splice_block %array_type [template = constants.%array_type] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_32) [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %Core.ref.loc4_16: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %AsIntLiteral.ref: %AsIntLiteral.type = name_ref AsIntLiteral, imports.%import_ref.d91 [template = constants.%AsIntLiteral]
|
||||
// CHECK:STDOUT: %Core.ref.loc4_34: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.a93 [template = constants.%TestAdd]
|
||||
// CHECK:STDOUT: %Core.ref.loc4_47: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %AsI32.ref.loc4_51: %AsI32.type = name_ref AsI32, imports.%import_ref.614 [template = constants.%AsI32]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc4_59: init %i32.builtin = call %AsI32.ref.loc4_51(%int_1) [template = constants.%int_1.f38]
|
||||
// CHECK:STDOUT: %Core.ref.loc4_62: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %AsI32.ref.loc4_66: %AsI32.type = name_ref AsI32, imports.%import_ref.614 [template = constants.%AsI32]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc4_74: init %i32.builtin = call %AsI32.ref.loc4_66(%int_2) [template = constants.%int_2.5a1]
|
||||
// CHECK:STDOUT: %.loc4_59.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_59 [template = constants.%int_1.f38]
|
||||
// CHECK:STDOUT: %.loc4_59.2: %i32.builtin = converted %int.convert_checked.loc4_59, %.loc4_59.1 [template = constants.%int_1.f38]
|
||||
// CHECK:STDOUT: %.loc4_74.1: %i32.builtin = value_of_initializer %int.convert_checked.loc4_74 [template = constants.%int_2.5a1]
|
||||
// CHECK:STDOUT: %.loc4_74.2: %i32.builtin = converted %int.convert_checked.loc4_74, %.loc4_74.1 [template = constants.%int_2.5a1]
|
||||
// CHECK:STDOUT: %int.sadd: init %i32.builtin = call %TestAdd.ref(%.loc4_59.2, %.loc4_74.2) [template = constants.%int_3.a0f]
|
||||
// CHECK:STDOUT: %.loc4_75.1: %i32.builtin = value_of_initializer %int.sadd [template = constants.%int_3.a0f]
|
||||
// CHECK:STDOUT: %.loc4_75.2: %i32.builtin = converted %int.sadd, %.loc4_75.1 [template = constants.%int_3.a0f]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc4_76: init Core.IntLiteral = call %AsIntLiteral.ref(%.loc4_75.2) [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_signed, %.loc4_11.1 [template = constants.%i32.builtin]
|
||||
// CHECK:STDOUT: %.loc4_76.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_76 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc4_76.2: Core.IntLiteral = converted %int.convert_checked.loc4_76, %.loc4_76.1 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %.loc4_76.2, %i32.builtin [template = constants.%array_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -234,8 +275,8 @@ var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] =
|
||||
// CHECK:STDOUT: %.loc4_125.6: ref %i32.builtin = array_index file.%arr.var, %int_2.loc4_125
|
||||
// CHECK:STDOUT: %.loc4_125.7: init %i32.builtin = initialize_from %int.convert_checked.loc4_124 to %.loc4_125.6 [template = constants.%int_3.a0f]
|
||||
// CHECK:STDOUT: %.loc4_125.8: init %array_type = array_init (%.loc4_125.3, %.loc4_125.5, %.loc4_125.7) to file.%arr.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc4_126: init %array_type = converted %.loc4_125.1, %.loc4_125.8 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%arr.var, %.loc4_126
|
||||
// CHECK:STDOUT: %.loc4_1: init %array_type = converted %.loc4_125.1, %.loc4_125.8 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%arr.var, %.loc4_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -45,10 +45,18 @@ fn Run() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Run() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %i32 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc16_3: %i32 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %i32 = var x
|
||||
// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %str: String = string_literal "hello" [template = constants.%str]
|
||||
// CHECK:STDOUT: assign %x.var, <error>
|
||||
// CHECK:STDOUT: %.loc16_10: 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: }
|
||||
// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -13,10 +13,10 @@ fn Foo() -> f64 { return 1.0; }
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `f64` to `i32` [ImplicitAsConversionFailure]
|
||||
// CHECK:STDERR: var x: i32 = Foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+4]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var x: i32 = Foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: i32 = Foo();
|
||||
}
|
||||
@@ -75,12 +75,20 @@ fn Run() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Run() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %i32 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc21_3.1: %i32 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %i32 = var x
|
||||
// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo]
|
||||
// CHECK:STDOUT: %Foo.call: init f64 = call %Foo.ref()
|
||||
// CHECK:STDOUT: %.loc21: %i32 = converted %Foo.call, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %.loc21_3.2: %i32 = converted %Foo.call, <error> [template = <error>]
|
||||
// CHECK:STDOUT: assign %x.var, <error>
|
||||
// CHECK:STDOUT: %.loc21_10: 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: }
|
||||
// CHECK:STDOUT: %x: ref %i32 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+9
-1
@@ -79,8 +79,11 @@ fn Main() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Main() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc16_3: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %Echo.ref: %Echo.type = name_ref Echo, file.%Echo.decl [template = constants.%Echo]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
@@ -91,6 +94,11 @@ fn Main() {
|
||||
// CHECK:STDOUT: %.loc16_21.2: %i32 = converted %int_1, %.loc16_21.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %Echo.call: init %i32 = call %Echo.ref(%.loc16_21.2)
|
||||
// CHECK:STDOUT: assign %b.var, %Echo.call
|
||||
// CHECK:STDOUT: %.loc16_10: 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: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+14
-3
@@ -26,6 +26,7 @@ fn Main() {
|
||||
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Main.type: type = fn_type @Main [template]
|
||||
// CHECK:STDOUT: %Main: %Main.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [template]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template]
|
||||
@@ -89,8 +90,11 @@ fn Main() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Main() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %tuple.type.a1c = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc14_3.1: %tuple.type.a1c = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %tuple.type.a1c = var x
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.a1c = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc14_22.1: %tuple.type.985 = tuple_literal (%int_1)
|
||||
// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
@@ -99,8 +103,15 @@ fn Main() {
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14: init %i32 = call %Convert.specific_fn.loc14(%int_1) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_22.2: init %i32 = converted %int_1, %int.convert_checked.loc14 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc14_22.3: init %tuple.type.a1c = tuple_init (%.loc14_22.2) to %x.var [template = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc14_23: init %tuple.type.a1c = converted %.loc14_22.1, %.loc14_22.3 [template = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %x.var, %.loc14_23
|
||||
// CHECK:STDOUT: %.loc14_3.2: init %tuple.type.a1c = converted %.loc14_22.1, %.loc14_22.3 [template = constants.%tuple]
|
||||
// CHECK:STDOUT: assign %x.var, %.loc14_3.2
|
||||
// CHECK:STDOUT: %.loc14_15.1: type = splice_block %.loc14_15.3 [template = constants.%tuple.type.a1c] {
|
||||
// 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: %.loc14_15.2: %tuple.type.85c = tuple_literal (%i32)
|
||||
// CHECK:STDOUT: %.loc14_15.3: type = converted %.loc14_15.2, constants.%tuple.type.a1c [template = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %tuple.type.a1c = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo]
|
||||
// CHECK:STDOUT: %x.ref: ref %tuple.type.a1c = name_ref x, %x
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
|
||||
|
||||
@@ -57,11 +57,19 @@ fn Main() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Main() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %empty_tuple.type = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc16_3: %empty_tuple.type = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b
|
||||
// CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %B.ref: %A.type = name_ref B, file.%B [template = constants.%A]
|
||||
// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %B.ref()
|
||||
// CHECK:STDOUT: assign %b.var, %A.call
|
||||
// CHECK:STDOUT: %.loc16_11.1: type = splice_block %.loc16_11.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc16_11.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc16_11.3: type = converted %.loc16_11.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -41,11 +41,19 @@ fn Main() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Main() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %empty_tuple.type = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc15_3: %empty_tuple.type = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b
|
||||
// CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %MakeImplicitEmptyTuple.ref: %MakeImplicitEmptyTuple.type = name_ref MakeImplicitEmptyTuple, file.%MakeImplicitEmptyTuple.decl [template = constants.%MakeImplicitEmptyTuple]
|
||||
// CHECK:STDOUT: %MakeImplicitEmptyTuple.call: init %empty_tuple.type = call %MakeImplicitEmptyTuple.ref()
|
||||
// CHECK:STDOUT: assign %b.var, %MakeImplicitEmptyTuple.call
|
||||
// CHECK:STDOUT: %.loc15_11.1: type = splice_block %.loc15_11.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc15_11.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc15_11.3: type = converted %.loc15_11.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -506,15 +506,56 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %empty_tuple.type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc6_1: %empty_tuple.type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
|
||||
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc7_1: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %.loc7_8: type = splice_block %i32.loc7 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7: 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: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %struct_type.c = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc8_1: %struct_type.c = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
|
||||
// CHECK:STDOUT: %.loc8_16: type = splice_block %struct_type.c [template = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %empty_tuple.type = binding_pattern d
|
||||
// CHECK:STDOUT: %.loc9_1: %empty_tuple.type = var_pattern %d.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d
|
||||
// CHECK:STDOUT: %.loc9_9.1: type = splice_block %.loc9_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc9_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc9_9.3: type = converted %.loc9_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %e.patt: %empty_tuple.type = binding_pattern e
|
||||
// CHECK:STDOUT: %.loc10_1: %empty_tuple.type = var_pattern %e.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -656,15 +697,56 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {}
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %empty_tuple.type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc52_1: %empty_tuple.type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
|
||||
// CHECK:STDOUT: %.loc52_9.1: type = splice_block %.loc52_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc52_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc52_9.3: type = converted %.loc52_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc53_1: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %.loc53_8: type = splice_block %i32.loc53 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc53: 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: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %struct_type.c = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc54_1: %struct_type.c = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
|
||||
// CHECK:STDOUT: %.loc54_16: type = splice_block %struct_type.c [template = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %empty_tuple.type = binding_pattern d
|
||||
// CHECK:STDOUT: %.loc55_1: %empty_tuple.type = var_pattern %d.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d
|
||||
// CHECK:STDOUT: %.loc55_9.1: type = splice_block %.loc55_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc55_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc55_9.3: type = converted %.loc55_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %e.patt: %empty_tuple.type = binding_pattern e
|
||||
// CHECK:STDOUT: %.loc56_1: %empty_tuple.type = var_pattern %e.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e
|
||||
// CHECK:STDOUT: %.loc56_9.1: type = splice_block %.loc56_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc56_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc56_9.3: type = converted %.loc56_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -806,15 +888,56 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [template = constants.%E] {} {}
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %empty_tuple.type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc12_1: %empty_tuple.type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
|
||||
// CHECK:STDOUT: %.loc12_9.1: type = splice_block %.loc12_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc12_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc12_9.3: type = converted %.loc12_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc13_1: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %.loc13_8: type = splice_block %i32.loc13 [template = constants.%i32] {
|
||||
// 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: }
|
||||
// CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %struct_type.c = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc14_1: %struct_type.c = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
|
||||
// CHECK:STDOUT: %.loc14_16: type = splice_block %struct_type.c [template = constants.%struct_type.c] {
|
||||
// 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: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %empty_tuple.type = binding_pattern d
|
||||
// CHECK:STDOUT: %.loc15_1: %empty_tuple.type = var_pattern %d.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d
|
||||
// CHECK:STDOUT: %.loc15_9.1: type = splice_block %.loc15_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc15_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc15_9.3: type = converted %.loc15_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %e.patt: %empty_tuple.type = binding_pattern e
|
||||
// CHECK:STDOUT: %.loc16_1: %empty_tuple.type = var_pattern %e.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e
|
||||
// CHECK:STDOUT: %.loc16_9.1: type = splice_block %.loc16_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc16_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc16_9.3: type = converted %.loc16_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -930,15 +1053,56 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %empty_tuple.type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc52_1: %empty_tuple.type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
|
||||
// CHECK:STDOUT: %.loc52_9.1: type = splice_block %.loc52_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc52_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc52_9.3: type = converted %.loc52_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc53_1: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %.loc53_8: type = splice_block %i32.loc53 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc53: 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: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %struct_type.c = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc54_1: %struct_type.c = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
|
||||
// CHECK:STDOUT: %.loc54_16: type = splice_block %struct_type.c [template = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %empty_tuple.type = binding_pattern d
|
||||
// CHECK:STDOUT: %.loc55_1: %empty_tuple.type = var_pattern %d.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d
|
||||
// CHECK:STDOUT: %.loc55_9.1: type = splice_block %.loc55_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc55_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc55_9.3: type = converted %.loc55_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %e.patt: %empty_tuple.type = binding_pattern e
|
||||
// CHECK:STDOUT: %.loc56_1: %empty_tuple.type = var_pattern %e.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e
|
||||
// CHECK:STDOUT: %.loc56_9.1: type = splice_block %.loc56_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc56_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc56_9.3: type = converted %.loc56_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1054,15 +1218,56 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %empty_tuple.type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc52_1: %empty_tuple.type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
|
||||
// CHECK:STDOUT: %.loc52_9.1: type = splice_block %.loc52_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc52_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc52_9.3: type = converted %.loc52_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc53_1: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %.loc53_8: type = splice_block %i32.loc53 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc53: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc53: 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: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %struct_type.c = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc54_1: %struct_type.c = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
|
||||
// CHECK:STDOUT: %.loc54_16: type = splice_block %struct_type.c [template = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %int_32.loc54: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc54: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %d.patt: %empty_tuple.type = binding_pattern d
|
||||
// CHECK:STDOUT: %.loc55_1: %empty_tuple.type = var_pattern %d.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d
|
||||
// CHECK:STDOUT: %.loc55_9.1: type = splice_block %.loc55_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc55_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc55_9.3: type = converted %.loc55_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %e.patt: %empty_tuple.type = binding_pattern e
|
||||
// CHECK:STDOUT: %.loc56_1: %empty_tuple.type = var_pattern %e.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var e
|
||||
// CHECK:STDOUT: %.loc56_9.1: type = splice_block %.loc56_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc56_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc56_9.3: type = converted %.loc56_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: ref %empty_tuple.type = bind_name e, %e.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -93,7 +93,15 @@ var f: () = F();
|
||||
// CHECK:STDOUT: .f = %f
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc6_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -115,7 +115,15 @@ extern library "basic" fn F();
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %empty_tuple.type = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc4_1: %empty_tuple.type = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x
|
||||
// CHECK:STDOUT: %.loc4_9.1: type = splice_block %.loc4_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc4_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_9.3: type = converted %.loc4_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+14
-5
@@ -103,6 +103,7 @@ fn A {
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %x: %empty_tuple.type = bind_symbolic_name x [symbolic]
|
||||
// CHECK:STDOUT: %x.patt: %empty_tuple.type = symbolic_binding_pattern x [symbolic]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template]
|
||||
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
|
||||
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
|
||||
@@ -113,8 +114,16 @@ fn A {
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: .A = %A.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var x
|
||||
// CHECK:STDOUT: %x: %empty_tuple.type = bind_symbolic_name x, %x.var [symbolic = constants.%x]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %empty_tuple.type = symbolic_binding_pattern x [symbolic = constants.%x.patt]
|
||||
// CHECK:STDOUT: %.loc8_1: %empty_tuple.type = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var: ref %empty_tuple.type = var <invalid>
|
||||
// CHECK:STDOUT: %.loc8_10.1: type = splice_block %.loc8_10.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc8_10.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc8_10.3: type = converted %.loc8_10.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: %empty_tuple.type = bind_symbolic_name x, %.var [symbolic = constants.%x]
|
||||
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -128,9 +137,9 @@ fn A {
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc8_15.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc8_15.2: init %empty_tuple.type = tuple_init () to file.%x.var [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_16: init %empty_tuple.type = converted %.loc8_15.1, %.loc8_15.2 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc8_16
|
||||
// CHECK:STDOUT: %.loc8_15.2: init %empty_tuple.type = tuple_init () to file.%.var [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_1: init %empty_tuple.type = converted %.loc8_15.1, %.loc8_15.2 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: assign file.%.var, %.loc8_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+10
-2
@@ -606,7 +606,11 @@ fn F() {
|
||||
// CHECK:STDOUT: %x: %C1 = bind_name x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} {}
|
||||
// CHECK:STDOUT: %.loc18: %D.elem = field_decl C1, element0 [template]
|
||||
// CHECK:STDOUT: %.loc18_9: %D.elem = field_decl C1, element0 [template]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %.loc18_3: %D.elem = var_pattern %.loc18_9
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var: ref %D.elem = var <invalid>
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.C1 [template = constants.%complete_type.ec1]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1170,7 +1174,11 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @B {
|
||||
// CHECK:STDOUT: %.loc9: %B.elem = field_decl v, element0 [template]
|
||||
// CHECK:STDOUT: %.loc9_10: %B.elem = field_decl v, element0 [template]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %.loc9_5: %B.elem = var_pattern %.loc9_10
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var: ref %B.elem = var <invalid>
|
||||
// CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.96d] {} {}
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.v [template = constants.%complete_type.57e]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
|
||||
@@ -288,11 +288,36 @@ fn D() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %empty_tuple.type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc6_1: %empty_tuple.type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
|
||||
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc7_1: %i32 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var b
|
||||
// CHECK:STDOUT: %.loc7_8: type = splice_block %i32.loc7 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc7: 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: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %struct_type.c = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc8_1: %struct_type.c = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var c
|
||||
// CHECK:STDOUT: %.loc8_16: type = splice_block %struct_type.c [template = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [template = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = bind_name c, %c.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -243,7 +243,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc4_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc4_9.1: type = splice_block %.loc4_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc4_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_9.3: type = converted %.loc4_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -277,7 +285,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc10_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -312,7 +328,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc10_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -349,7 +373,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc4_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc4_9.1: type = splice_block %.loc4_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc4_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_9.3: type = converted %.loc4_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -383,7 +415,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc10_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -418,7 +458,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc10_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -455,7 +503,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc4_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc4_9.1: type = splice_block %.loc4_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc4_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_9.3: type = converted %.loc4_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: %Forward.decl: %Forward.type = fn_decl @Forward [template = constants.%Forward] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
@@ -493,7 +549,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc10_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -528,7 +592,15 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %f.patt: %empty_tuple.type = binding_pattern f
|
||||
// CHECK:STDOUT: %.loc10_1: %empty_tuple.type = var_pattern %f.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var f
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = bind_name f, %f.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+16
@@ -98,9 +98,25 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %empty_struct_type = binding_pattern v
|
||||
// CHECK:STDOUT: %.loc9_11: %empty_struct_type = var_pattern %v.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %empty_struct_type = var v
|
||||
// CHECK:STDOUT: %.loc9_19.1: type = splice_block %.loc9_19.3 [template = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc9_19.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc9_19.3: type = converted %.loc9_19.2, constants.%empty_struct_type [template = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %empty_struct_type = bind_name v, %v.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %w.patt: %empty_struct_type = binding_pattern w
|
||||
// CHECK:STDOUT: %.loc14_13: %empty_struct_type = var_pattern %w.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %w.var: ref %empty_struct_type = var w
|
||||
// CHECK:STDOUT: %.loc14_21.1: type = splice_block %.loc14_21.3 [template = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc14_21.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc14_21.3: type = converted %.loc14_21.2, constants.%empty_struct_type [template = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %w: ref %empty_struct_type = bind_name w, %w.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+22
-10
@@ -10,9 +10,9 @@
|
||||
|
||||
fn F(T:! type, U:! type) {
|
||||
var p: T*;
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:3: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:14: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
|
||||
// CHECK:STDERR: let n: U = *p;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
let n: U = *p;
|
||||
}
|
||||
@@ -55,18 +55,30 @@ fn F(T:! type, U:! type) {
|
||||
// CHECK:STDOUT: %U.patt.loc11_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc11_16.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr (constants.%ptr)]
|
||||
// CHECK:STDOUT: %require_complete.loc12: <witness> = require_complete_type @F.%ptr (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.6e5)]
|
||||
// CHECK:STDOUT: %ptr.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr.loc12_11.2 (constants.%ptr)]
|
||||
// CHECK:STDOUT: %require_complete.loc12: <witness> = require_complete_type @F.%ptr.loc12_11.2 (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.6e5)]
|
||||
// CHECK:STDOUT: %require_complete.loc17: <witness> = require_complete_type @F.%U.loc11_16.2 (%U) [symbolic = %require_complete.loc17 (constants.%require_complete.b54)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %p.var: ref @F.%ptr (%ptr) = var p
|
||||
// CHECK:STDOUT: %p: ref @F.%ptr (%ptr) = bind_name p, %p.var
|
||||
// CHECK:STDOUT: %p.ref: ref @F.%ptr (%ptr) = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc17_15: @F.%ptr (%ptr) = bind_value %p.ref
|
||||
// CHECK:STDOUT: %.loc17_14: ref @F.%T.loc11_6.2 (%T) = deref %.loc17_15
|
||||
// CHECK:STDOUT: %.loc17_16: @F.%U.loc11_16.2 (%U) = converted %.loc17_14, <error> [template = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %p.patt: @F.%ptr.loc12_11.2 (%ptr) = binding_pattern p
|
||||
// CHECK:STDOUT: %.loc12_3: @F.%ptr.loc12_11.2 (%ptr) = var_pattern %p.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.var: ref @F.%ptr.loc12_11.2 (%ptr) = var p
|
||||
// CHECK:STDOUT: %.loc12_11: type = splice_block %ptr.loc12_11.1 [symbolic = %ptr.loc12_11.2 (constants.%ptr)] {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %ptr.loc12_11.1: type = ptr_type %T [symbolic = %ptr.loc12_11.2 (constants.%ptr)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: ref @F.%ptr.loc12_11.2 (%ptr) = bind_name p, %p.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %n.patt: @F.%U.loc11_16.2 (%U) = binding_pattern n
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.ref: ref @F.%ptr.loc12_11.2 (%ptr) = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc17_15: @F.%ptr.loc12_11.2 (%ptr) = bind_value %p.ref
|
||||
// CHECK:STDOUT: %.loc17_14.1: ref @F.%T.loc11_6.2 (%T) = deref %.loc17_15
|
||||
// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc11_16.1 [symbolic = %U.loc11_16.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %.loc17_14.2: @F.%U.loc11_16.2 (%U) = converted %.loc17_14.1, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %n: @F.%U.loc11_16.2 (%U) = bind_name n, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -43,19 +43,30 @@ fn F(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: %ptr: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr (constants.%ptr)]
|
||||
// CHECK:STDOUT: %require_complete.loc12: <witness> = require_complete_type @F.%ptr (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.6e5)]
|
||||
// CHECK:STDOUT: %ptr.loc12_11.2: type = ptr_type @F.%T.loc11_6.2 (%T) [symbolic = %ptr.loc12_11.2 (constants.%ptr)]
|
||||
// CHECK:STDOUT: %require_complete.loc12: <witness> = require_complete_type @F.%ptr.loc12_11.2 (%ptr) [symbolic = %require_complete.loc12 (constants.%require_complete.6e5)]
|
||||
// CHECK:STDOUT: %require_complete.loc13: <witness> = require_complete_type @F.%T.loc11_6.2 (%T) [symbolic = %require_complete.loc13 (constants.%require_complete.4ae)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%T.param_patt: type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %p.var: ref @F.%ptr (%ptr) = var p
|
||||
// CHECK:STDOUT: %p: ref @F.%ptr (%ptr) = bind_name p, %p.var
|
||||
// CHECK:STDOUT: %p.ref: ref @F.%ptr (%ptr) = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc13_15: @F.%ptr (%ptr) = bind_value %p.ref
|
||||
// CHECK:STDOUT: %.loc13_14.1: ref @F.%T.loc11_6.2 (%T) = deref %.loc13_15
|
||||
// CHECK:STDOUT: %.loc13_14.2: @F.%T.loc11_6.2 (%T) = bind_value %.loc13_14.1
|
||||
// CHECK:STDOUT: %n: @F.%T.loc11_6.2 (%T) = bind_name n, %.loc13_14.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %p.patt: @F.%ptr.loc12_11.2 (%ptr) = binding_pattern p
|
||||
// CHECK:STDOUT: %.loc12_3: @F.%ptr.loc12_11.2 (%ptr) = var_pattern %p.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.var: ref @F.%ptr.loc12_11.2 (%ptr) = var p
|
||||
// CHECK:STDOUT: %.loc12_11: type = splice_block %ptr.loc12_11.1 [symbolic = %ptr.loc12_11.2 (constants.%ptr)] {
|
||||
// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %ptr.loc12_11.1: type = ptr_type %T [symbolic = %ptr.loc12_11.2 (constants.%ptr)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: ref @F.%ptr.loc12_11.2 (%ptr) = bind_name p, %p.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %n.patt: @F.%T.loc11_6.2 (%T) = binding_pattern n
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.ref: ref @F.%ptr.loc12_11.2 (%ptr) = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc13_15: @F.%ptr.loc12_11.2 (%ptr) = bind_value %p.ref
|
||||
// CHECK:STDOUT: %.loc13_14: ref @F.%T.loc11_6.2 (%T) = deref %.loc13_15
|
||||
// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %n: ref @F.%T.loc11_6.2 (%T) = bind_name n, %.loc13_14
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -55,7 +55,11 @@ fn F(T:! type, n: T) -> T {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%T.param_patt: type, %n.param_patt: @F.%T.loc11_6.2 (%T)) -> @F.%T.loc11_6.2 (%T) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %m.patt: @F.%T.loc11_6.2 (%T) = binding_pattern m
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %n.ref: @F.%T.loc11_6.2 (%T) = name_ref n, %n
|
||||
// CHECK:STDOUT: %T.ref.loc12: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %m: @F.%T.loc11_6.2 (%T) = bind_name m, %n.ref
|
||||
// CHECK:STDOUT: %m.ref: @F.%T.loc11_6.2 (%T) = name_ref m, %m
|
||||
// CHECK:STDOUT: return %m.ref
|
||||
|
||||
@@ -44,6 +44,8 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ErrorIfNIsZero.type: type = fn_type @ErrorIfNIsZero [template]
|
||||
// CHECK:STDOUT: %ErrorIfNIsZero: %ErrorIfNIsZero.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [template]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic]
|
||||
// CHECK:STDOUT: %require_complete.b4f: <witness> = require_complete_type %Int [symbolic]
|
||||
// CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [template]
|
||||
@@ -62,6 +64,7 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.72f: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %import_ref.485: %Int.type = import_ref Core//prelude/types/int, Int, loaded [template = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -77,7 +80,7 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<invalid>
|
||||
// CHECK:STDOUT: %.loc4_39.1: type = splice_block %.loc4_39.3 [template = Core.IntLiteral] {
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %Core.ref.loc4: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.72f [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc4_39.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
|
||||
@@ -93,13 +96,23 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %N.patt.loc4_19.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_19.2 (constants.%N.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N.loc4_19.2) [symbolic = %Int (constants.%Int)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @ErrorIfNIsZero.%Int (%Int) [symbolic = %require_complete (constants.%require_complete.b4f)]
|
||||
// CHECK:STDOUT: %Int.loc15_20.2: type = class_type @Int, @Int(%N.loc4_19.2) [symbolic = %Int.loc15_20.2 (constants.%Int)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) [symbolic = %require_complete (constants.%require_complete.b4f)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int (%Int) = var v
|
||||
// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int (%Int) = bind_name v, %v.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = binding_pattern v
|
||||
// CHECK:STDOUT: %.loc15_3: @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = var_pattern %v.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = var v
|
||||
// CHECK:STDOUT: %.loc15_20: type = splice_block %Int.loc15_20.1 [symbolic = %Int.loc15_20.2 (constants.%Int)] {
|
||||
// CHECK:STDOUT: %Core.ref.loc15: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.485 [template = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc4_19.1 [symbolic = %N.loc4_19.2 (constants.%N)]
|
||||
// CHECK:STDOUT: %Int.loc15_20.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_20.2 (constants.%Int)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = bind_name v, %v.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -123,7 +136,7 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %N.patt.loc4_19.2 => constants.%int_0
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Int => constants.%i0
|
||||
// CHECK:STDOUT: %Int.loc15_20.2 => constants.%i0
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.d94
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+36
-11
@@ -111,7 +111,11 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %.loc15: %C.elem = field_decl arr, element0 [template]
|
||||
// CHECK:STDOUT: %.loc15_18: %C.elem = field_decl arr, element0 [template]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %.loc15_11: %C.elem = var_pattern %.loc15_18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.var: ref %C.elem = var <invalid>
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.arr.5f2 [template = constants.%complete_type.22a]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT: }
|
||||
@@ -139,19 +143,30 @@ fn G() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc18_3: %i32 = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %i32 = var a
|
||||
// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %Wrap.ref.loc18: %Wrap.type = name_ref Wrap, file.%Wrap.decl [template = constants.%Wrap.generic]
|
||||
// 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_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %Wrap.loc18: type = class_type @Wrap, @Wrap(constants.%i32) [template = constants.%Wrap.f84]
|
||||
// CHECK:STDOUT: %.loc18: %Make.type.572 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%i32) [template = constants.%Make.2c5]
|
||||
// CHECK:STDOUT: %Make.ref.loc18: %Make.type.572 = name_ref Make, %.loc18 [template = constants.%Make.2c5]
|
||||
// CHECK:STDOUT: %.loc18_25: %Make.type.572 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%i32) [template = constants.%Make.2c5]
|
||||
// CHECK:STDOUT: %Make.ref.loc18: %Make.type.572 = name_ref Make, %.loc18_25 [template = constants.%Make.2c5]
|
||||
// CHECK:STDOUT: %Make.specific_fn.loc18: <specific function> = specific_function %Make.ref.loc18, @Make(constants.%i32) [template = constants.%Make.specific_fn.f29]
|
||||
// CHECK:STDOUT: %Make.call.loc18: init %i32 = call %Make.specific_fn.loc18()
|
||||
// CHECK:STDOUT: assign %a.var, %Make.call.loc18
|
||||
// CHECK:STDOUT: %.loc18_10: type = splice_block %i32.loc18_10 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc18_10: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc18_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %empty_tuple.type = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc19_3: %empty_tuple.type = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %empty_tuple.type = var b
|
||||
// CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %Wrap.ref.loc19: %Wrap.type = name_ref Wrap, file.%Wrap.decl [template = constants.%Wrap.generic]
|
||||
// CHECK:STDOUT: %.loc19_21: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc19_22: type = converted %.loc19_21, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
@@ -161,17 +176,27 @@ fn G() {
|
||||
// CHECK:STDOUT: %Make.specific_fn.loc19: <specific function> = specific_function %Make.ref.loc19, @Make(constants.%empty_tuple.type) [template = constants.%Make.specific_fn.e43]
|
||||
// CHECK:STDOUT: %Make.call.loc19: init %empty_tuple.type = call %Make.specific_fn.loc19()
|
||||
// CHECK:STDOUT: assign %b.var, %Make.call.loc19
|
||||
// CHECK:STDOUT: %.loc19_11.1: type = splice_block %.loc19_11.3 [template = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc19_11.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc19_11.3: type = converted %.loc19_11.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %empty_tuple.type = bind_name b, %b.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %C = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc20_3.1: %C = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %C = var c
|
||||
// CHECK:STDOUT: %c: ref %C = bind_name c, %c.var
|
||||
// CHECK:STDOUT: %Wrap.ref.loc20: %Wrap.type = name_ref Wrap, file.%Wrap.decl [template = constants.%Wrap.generic]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %C.ref.loc20_19: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %Wrap.loc20: type = class_type @Wrap, @Wrap(constants.%C) [template = constants.%Wrap.2eb]
|
||||
// CHECK:STDOUT: %.loc20_21: %Make.type.708 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%C) [template = constants.%Make.e4b]
|
||||
// CHECK:STDOUT: %Make.ref.loc20: %Make.type.708 = name_ref Make, %.loc20_21 [template = constants.%Make.e4b]
|
||||
// CHECK:STDOUT: %Make.specific_fn.loc20: <specific function> = specific_function %Make.ref.loc20, @Make(constants.%C) [template = constants.%Make.specific_fn.834]
|
||||
// CHECK:STDOUT: %.loc20_7: ref %C = splice_block %c.var {}
|
||||
// CHECK:STDOUT: %Make.call.loc20: init %C = call %Make.specific_fn.loc20() to %.loc20_7
|
||||
// CHECK:STDOUT: %.loc20_3.2: ref %C = splice_block %c.var {}
|
||||
// CHECK:STDOUT: %Make.call.loc20: init %C = call %Make.specific_fn.loc20() to %.loc20_3.2
|
||||
// CHECK:STDOUT: assign %c.var, %Make.call.loc20
|
||||
// CHECK:STDOUT: %C.ref.loc20_10: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %c: ref %C = bind_name c, %c.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user