mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Convert array bounds to IntLiteral. (#4526)
Instead of leaving array bounds as whatever integer type they arrive as, convert them to the `IntLiteral` type as part of forming an `ArrayType`. This ensures that array types canonicalize properly even when the bounds are specified with different types. Create an empty generic definition for a generic builtin function to avoid this causing "use of undefined generic function" errors.
This commit is contained in:
+19
-5
@@ -22,12 +22,19 @@ var arr: [i32; Add(1, 2)];
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template]
|
||||
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template]
|
||||
// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.27: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.28: <bound method> = bound_method %.3, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.30: type = array_type %.29, i32 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int32 = %import_ref
|
||||
// CHECK:STDOUT: .Int32 = %import_ref.1
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.2
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -71,9 +78,16 @@ var arr: [i32; Add(1, 2)];
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc13_20, %.loc13_23) [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32, %.loc13_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc13_25: type = array_type %int.sadd, i32 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %arr.var: ref %.4 = var arr
|
||||
// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: %.loc13_19.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc13_19.2: <bound method> = bound_method %int.sadd, %.loc13_19.1 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %.loc13_19.3: i32 = value_of_initializer %int.sadd [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc13_19.4: i32 = converted %int.sadd, %.loc13_19.3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_19.2(%.loc13_19.4) [template = constants.%.29]
|
||||
// CHECK:STDOUT: %.loc13_19.5: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.29]
|
||||
// CHECK:STDOUT: %.loc13_19.6: Core.IntLiteral = converted %int.sadd, %.loc13_19.5 [template = constants.%.29]
|
||||
// CHECK:STDOUT: %.loc13_25: type = array_type %.loc13_19.6, i32 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %arr.var: ref %.30 = var arr
|
||||
// CHECK:STDOUT: %arr: ref %.30 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd";
|
||||
|
||||
+48
-34
@@ -22,7 +22,7 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Self.1: %I.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
|
||||
// CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: type = assoc_entity_type %I.type, %F.type.1 [template]
|
||||
@@ -36,12 +36,19 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: %.5: <bound method> = bound_method %.4, %F.2 [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.7: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.8: type = array_type %.7, i32 [template]
|
||||
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template]
|
||||
// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.31: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.32: <bound method> = bound_method %.7, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.33: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.34: type = array_type %.33, i32 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int32 = %import_ref
|
||||
// CHECK:STDOUT: .Int32 = %import_ref.1
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.2
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -55,7 +62,7 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
|
||||
// CHECK:STDOUT: impl_decl @impl [template] {} {
|
||||
// CHECK:STDOUT: impl_decl @impl.1 [template] {} {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32]
|
||||
@@ -71,36 +78,43 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc19_17.2(%.loc19_16, %.loc19_24) [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc19_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc19_11.2: type = converted %int.make_type_32, %.loc19_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc19_26: type = array_type %int.sadd, i32 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %arr.var: ref %.8 = var arr
|
||||
// CHECK:STDOUT: %arr: ref %.8 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: %.loc19_23.1: %Convert.type.2 = interface_witness_access constants.%.31, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc19_23.2: <bound method> = bound_method %int.sadd, %.loc19_23.1 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc19_23.3: i32 = value_of_initializer %int.sadd [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc19_23.4: i32 = converted %int.sadd, %.loc19_23.3 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc19_23.2(%.loc19_23.4) [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc19_23.5: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc19_23.6: Core.IntLiteral = converted %int.sadd, %.loc19_23.5 [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc19_26: type = array_type %.loc19_23.6, i32 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %arr.var: ref %.34 = var arr
|
||||
// CHECK:STDOUT: %arr: ref %.34 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1]
|
||||
// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {
|
||||
// CHECK:STDOUT: %self.patt: @F.1.%Self (%Self) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self) = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %other.patt: @F.1.%Self (%Self) = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: @F.1.%Self (%Self) = value_param_pattern %other.patt, runtime_param1
|
||||
// CHECK:STDOUT: %return.patt: @F.1.%Self (%Self) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @F.1.%Self (%Self) = out_param_pattern %return.patt, runtime_param2
|
||||
// CHECK:STDOUT: %self.patt: @F.1.%Self (%Self.1) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @F.1.%Self (%Self.1) = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %other.patt: @F.1.%Self (%Self.1) = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: @F.1.%Self (%Self.1) = value_param_pattern %other.patt, runtime_param1
|
||||
// CHECK:STDOUT: %return.patt: @F.1.%Self (%Self.1) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @F.1.%Self (%Self.1) = out_param_pattern %return.patt, runtime_param2
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc12_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %Self.ref.loc12_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc12_27.1: type = facet_type_access %Self.ref.loc12_27 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc12_27.2: type = converted %Self.ref.loc12_27, %.loc12_27.1 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %Self.ref.loc12_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc12_36.1: type = facet_type_access %Self.ref.loc12_36 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc12_36.2: type = converted %Self.ref.loc12_36, %.loc12_36.1 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %self.param: @F.1.%Self (%Self) = value_param runtime_param0
|
||||
// CHECK:STDOUT: %self: @F.1.%Self (%Self) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @F.1.%Self (%Self) = value_param runtime_param1
|
||||
// CHECK:STDOUT: %other: @F.1.%Self (%Self) = bind_name other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @F.1.%Self (%Self) = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref @F.1.%Self (%Self) = return_slot %return.param
|
||||
// CHECK:STDOUT: %Self.ref.loc12_14: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc12_14.1: type = facet_type_access %Self.ref.loc12_14 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc12_14.2: type = converted %Self.ref.loc12_14, %.loc12_14.1 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %Self.ref.loc12_27: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc12_27.1: type = facet_type_access %Self.ref.loc12_27 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc12_27.2: type = converted %Self.ref.loc12_27, %.loc12_27.1 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %Self.ref.loc12_36: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc12_36.1: type = facet_type_access %Self.ref.loc12_36 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc12_36.2: type = converted %Self.ref.loc12_36, %.loc12_36.1 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %self.param: @F.1.%Self (%Self.1) = value_param runtime_param0
|
||||
// CHECK:STDOUT: %self: @F.1.%Self (%Self.1) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @F.1.%Self (%Self.1) = value_param runtime_param1
|
||||
// CHECK:STDOUT: %other: @F.1.%Self (%Self.1) = bind_name other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @F.1.%Self (%Self.1) = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref @F.1.%Self (%Self.1) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc12: %.1 = assoc_entity element0, %F.decl [template = constants.%.2]
|
||||
// CHECK:STDOUT:
|
||||
@@ -110,7 +124,7 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: witness = (%F.decl)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl: %.loc15_6.2 as %I.ref {
|
||||
// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %I.ref {
|
||||
// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {
|
||||
// CHECK:STDOUT: %self.patt: i32 = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0
|
||||
@@ -143,15 +157,15 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)](%other.param_patt: @F.1.%Self (%Self)) -> @F.1.%Self (%Self);
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self.1)](%other.param_patt: @F.1.%Self (%Self.1)) -> @F.1.%Self (%Self.1);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.1(constants.%Self) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self
|
||||
// CHECK:STDOUT: specific @F.1(constants.%Self.1) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.1(i32) {
|
||||
|
||||
+410
-127
@@ -13,21 +13,28 @@
|
||||
package Core;
|
||||
|
||||
fn Int32() -> type = "int.make_type_32";
|
||||
fn IntLiteral() -> type = "int_literal.make_type";
|
||||
|
||||
interface Add {
|
||||
fn Op[self: Self](other: Self) -> Self;
|
||||
}
|
||||
|
||||
interface ImplicitAs(T:! type) {
|
||||
fn Convert[self: Self]() -> T;
|
||||
}
|
||||
|
||||
impl i32 as Add {
|
||||
fn Op[self: Self](other: Self) -> Self = "int.sadd";
|
||||
}
|
||||
|
||||
impl i32 as ImplicitAs(IntLiteral()) {
|
||||
fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked";
|
||||
}
|
||||
|
||||
// --- user.carbon
|
||||
|
||||
import Core;
|
||||
|
||||
// TODO: This should be in `Core`, but currently impl lookup only looks in the
|
||||
// current file.
|
||||
impl i32 as Core.Add {
|
||||
fn Op[self: Self](other: Self) -> Self = "int.sadd";
|
||||
}
|
||||
|
||||
var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
|
||||
// CHECK:STDOUT: --- core.carbon
|
||||
@@ -35,18 +42,43 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
|
||||
// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template]
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Op.type: type = fn_type @Op [template]
|
||||
// CHECK:STDOUT: %Op: %Op.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: type = assoc_entity_type %Add.type, %Op.type [template]
|
||||
// CHECK:STDOUT: %Self.1: %Add.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template]
|
||||
// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: type = assoc_entity_type %Add.type, %Op.type.1 [template]
|
||||
// CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @Add.%Op.decl [template]
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
|
||||
// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
|
||||
// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @ImplicitAs.%Convert.decl [symbolic]
|
||||
// CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template]
|
||||
// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.5: <witness> = interface_witness (%Op.2) [template]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
|
||||
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2 [template]
|
||||
// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.3 [template]
|
||||
// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, @ImplicitAs.%Convert.decl [template]
|
||||
// CHECK:STDOUT: %.8: <witness> = interface_witness (%Convert.2) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Int32 = %Int32.decl
|
||||
// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl
|
||||
// CHECK:STDOUT: .Add = %Add.decl
|
||||
// CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {
|
||||
// CHECK:STDOUT: %return.patt: type = return_slot_pattern
|
||||
@@ -55,53 +87,231 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0
|
||||
// CHECK:STDOUT: %return: ref type = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] {
|
||||
// CHECK:STDOUT: %return.patt: type = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0
|
||||
// CHECK:STDOUT: %return: ref type = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%Add.type] {} {}
|
||||
// CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.1 = interface_decl @ImplicitAs [template = constants.%ImplicitAs] {
|
||||
// CHECK:STDOUT: %T.patt.loc11_22.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_22.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc11_22.1, runtime_param<invalid> [symbolic = %T.patt.loc11_22.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
|
||||
// CHECK:STDOUT: %T.loc11_22.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc11_22.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: impl_decl @impl.1 [template] {} {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_6.2: type = converted %int.make_type_32, %.loc15_6.1 [template = i32]
|
||||
// CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: impl_decl @impl.2 [template] {} {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc19_6.2: type = converted %int.make_type_32, %.loc19_6.1 [template = i32]
|
||||
// CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.1 = name_ref ImplicitAs, file.%ImplicitAs.decl [template = constants.%ImplicitAs]
|
||||
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc19_23.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc19_23.2: type = converted %int_literal.make_type, %.loc19_23.1 [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template = constants.%ImplicitAs.type.3]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @Add {
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT: %Op.decl: %Op.type = fn_decl @Op [template = constants.%Op] {
|
||||
// CHECK:STDOUT: %self.patt: @Op.%Self (%Self) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @Op.%Self (%Self) = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %other.patt: @Op.%Self (%Self) = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: @Op.%Self (%Self) = value_param_pattern %other.patt, runtime_param1
|
||||
// CHECK:STDOUT: %return.patt: @Op.%Self (%Self) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @Op.%Self (%Self) = out_param_pattern %return.patt, runtime_param2
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1]
|
||||
// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] {
|
||||
// CHECK:STDOUT: %self.patt: @Op.1.%Self (%Self.1) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @Op.1.%Self (%Self.1) = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %other.patt: @Op.1.%Self (%Self.1) = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: @Op.1.%Self (%Self.1) = value_param_pattern %other.patt, runtime_param1
|
||||
// CHECK:STDOUT: %return.patt: @Op.1.%Self (%Self.1) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @Op.1.%Self (%Self.1) = out_param_pattern %return.patt, runtime_param2
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc7_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc7_15.1: type = facet_type_access %Self.ref.loc7_15 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc7_15.2: type = converted %Self.ref.loc7_15, %.loc7_15.1 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %Self.ref.loc7_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc7_28.1: type = facet_type_access %Self.ref.loc7_28 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc7_28.2: type = converted %Self.ref.loc7_28, %.loc7_28.1 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %Self.ref.loc7_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc7_37.1: type = facet_type_access %Self.ref.loc7_37 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %.loc7_37.2: type = converted %Self.ref.loc7_37, %.loc7_37.1 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %self.param: @Op.%Self (%Self) = value_param runtime_param0
|
||||
// CHECK:STDOUT: %self: @Op.%Self (%Self) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @Op.%Self (%Self) = value_param runtime_param1
|
||||
// CHECK:STDOUT: %other: @Op.%Self (%Self) = bind_name other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @Op.%Self (%Self) = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref @Op.%Self (%Self) = return_slot %return.param
|
||||
// CHECK:STDOUT: %Self.ref.loc8_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc8_15.1: type = facet_type_access %Self.ref.loc8_15 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc8_15.2: type = converted %Self.ref.loc8_15, %.loc8_15.1 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %Self.ref.loc8_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc8_28.1: type = facet_type_access %Self.ref.loc8_28 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc8_28.2: type = converted %Self.ref.loc8_28, %.loc8_28.1 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %Self.ref.loc8_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc8_37.1: type = facet_type_access %Self.ref.loc8_37 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %.loc8_37.2: type = converted %Self.ref.loc8_37, %.loc8_37.1 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT: %self.param: @Op.1.%Self (%Self.1) = value_param runtime_param0
|
||||
// CHECK:STDOUT: %self: @Op.1.%Self (%Self.1) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %other.param: @Op.1.%Self (%Self.1) = value_param runtime_param1
|
||||
// CHECK:STDOUT: %other: @Op.1.%Self (%Self.1) = bind_name other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref @Op.1.%Self (%Self.1) = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref @Op.1.%Self (%Self.1) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc7: %.1 = assoc_entity element0, %Op.decl [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc8: %.1 = assoc_entity element0, %Op.decl [template = constants.%.2]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: .Op = %.loc7
|
||||
// CHECK:STDOUT: .Op = %.loc8
|
||||
// CHECK:STDOUT: witness = (%Op.decl)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc11_22.1: type) {
|
||||
// CHECK:STDOUT: %T.loc11_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_22.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc11_22.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_22.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc11_22.2)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
||||
// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.2)]
|
||||
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T.loc11_22.2) [symbolic = %Convert.type (constants.%Convert.type.1)]
|
||||
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
|
||||
// CHECK:STDOUT: %.loc12_32.2: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.loc12_32.2 (constants.%.3)]
|
||||
// CHECK:STDOUT: %.loc12_32.3: @ImplicitAs.%.loc12_32.2 (%.3) = assoc_entity element0, %Convert.decl [symbolic = %.loc12_32.3 (constants.%.4)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.2)]
|
||||
// CHECK:STDOUT: %Convert.decl: @ImplicitAs.%Convert.type (%Convert.type.1) = fn_decl @Convert.1 [symbolic = @ImplicitAs.%Convert (constants.%Convert.1)] {
|
||||
// CHECK:STDOUT: %self.patt: @Convert.1.%Self (%Self.2) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @Convert.1.%Self (%Self.2) = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %return.patt: @Convert.1.%T (%T) = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: @Convert.1.%T (%T) = out_param_pattern %return.patt, runtime_param1
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc12_20.1: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.2)]
|
||||
// CHECK:STDOUT: %Self.ref: @Convert.1.%ImplicitAs.type (%ImplicitAs.type.2) = name_ref Self, %.loc12_20.1 [symbolic = %Self (constants.%Self.2)]
|
||||
// CHECK:STDOUT: %.loc12_20.2: type = facet_type_access %Self.ref [symbolic = %Self (constants.%Self.2)]
|
||||
// CHECK:STDOUT: %.loc12_20.3: type = converted %Self.ref, %.loc12_20.2 [symbolic = %Self (constants.%Self.2)]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc11_22.1 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %self.param: @Convert.1.%Self (%Self.2) = value_param runtime_param0
|
||||
// CHECK:STDOUT: %self: @Convert.1.%Self (%Self.2) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %return.param: ref @Convert.1.%T (%T) = out_param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref @Convert.1.%T (%T) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc12_32.1: @ImplicitAs.%.loc12_32.2 (%.3) = assoc_entity element0, %Convert.decl [symbolic = %.loc12_32.3 (constants.%.4)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.1
|
||||
// CHECK:STDOUT: .Convert = %.loc12_32.1
|
||||
// CHECK:STDOUT: witness = (%Convert.decl)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl.1: %.loc15_6.2 as %Add.ref {
|
||||
// CHECK:STDOUT: %Op.decl: %Op.type.2 = fn_decl @Op.2 [template = constants.%Op.2] {
|
||||
// CHECK:STDOUT: %self.patt: i32 = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %other.patt: i32 = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: i32 = value_param_pattern %other.patt, runtime_param1
|
||||
// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @impl.1.%.loc15_6.2 [template = i32]
|
||||
// CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @impl.1.%.loc15_6.2 [template = i32]
|
||||
// CHECK:STDOUT: %Self.ref.loc16_37: type = name_ref Self, @impl.1.%.loc15_6.2 [template = i32]
|
||||
// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0
|
||||
// CHECK:STDOUT: %self: i32 = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %other.param: i32 = value_param runtime_param1
|
||||
// CHECK:STDOUT: %other: i32 = bind_name other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc15_17: <witness> = interface_witness (%Op.decl) [template = constants.%.5]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Op = %Op.decl
|
||||
// CHECK:STDOUT: witness = %.loc15_17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl.2: %.loc19_6.2 as %ImplicitAs.type {
|
||||
// CHECK:STDOUT: %Convert.decl: %Convert.type.2 = fn_decl @Convert.2 [template = constants.%Convert.2] {
|
||||
// CHECK:STDOUT: %self.patt: i32 = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.2.%.loc19_6.2 [template = i32]
|
||||
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc20_42.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc20_42.2: type = converted %int_literal.make_type, %.loc20_42.1 [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0
|
||||
// CHECK:STDOUT: %self: i32 = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc19_38: <witness> = interface_witness (%Convert.decl) [template = constants.%.8]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Convert = %Convert.decl
|
||||
// CHECK:STDOUT: witness = %.loc19_38
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Op(@Add.%Self: %Add.type) {
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Op.%Self (%Self)](%other.param_patt: @Op.%Self (%Self)) -> @Op.%Self (%Self);
|
||||
// CHECK:STDOUT: generic fn @Op.1(@Add.%Self: %Add.type) {
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self (%Self.1)](%other.param_patt: @Op.1.%Self (%Self.1)) -> @Op.1.%Self (%Self.1);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op(constants.%Self) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self
|
||||
// CHECK:STDOUT: generic fn @Convert.1(@ImplicitAs.%T.loc11_22.1: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
||||
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%T (%T);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Op.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Convert.2[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.1(constants.%Self.1) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc11_22.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc11_22.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) {
|
||||
// CHECK:STDOUT: %T.loc11_22.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc11_22.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self.2) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
|
||||
// CHECK:STDOUT: %Self => constants.%Self.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(%T.loc11_22.2) {
|
||||
// CHECK:STDOUT: %T.loc11_22.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc11_22.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.1(i32) {
|
||||
// CHECK:STDOUT: %Self => i32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
|
||||
// CHECK:STDOUT: %T.loc11_22.2 => Core.IntLiteral
|
||||
// CHECK:STDOUT: %T.patt.loc11_22.2 => Core.IntLiteral
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
|
||||
// CHECK:STDOUT: %Self.2 => constants.%Self.2
|
||||
// CHECK:STDOUT: %Convert.type => constants.%Convert.type.3
|
||||
// CHECK:STDOUT: %Convert => constants.%Convert.3
|
||||
// CHECK:STDOUT: %.loc12_32.2 => constants.%.6
|
||||
// CHECK:STDOUT: %.loc12_32.3 => constants.%.7
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Convert.1(Core.IntLiteral, i32) {
|
||||
// CHECK:STDOUT: %T => Core.IntLiteral
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
|
||||
// CHECK:STDOUT: %Self => i32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- user.carbon
|
||||
@@ -109,38 +319,67 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template]
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Self.1: %Add.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Op.type.1: type = fn_type @Op.1 [template]
|
||||
// CHECK:STDOUT: %Op.1: %Op.type.1 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.3: type = assoc_entity_type %Add.type, %Op.type.1 [template]
|
||||
// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.6 [template]
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
|
||||
// CHECK:STDOUT: %Self.3: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
|
||||
// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.16 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template]
|
||||
// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.17 [template]
|
||||
// CHECK:STDOUT: %Op.type.2: type = fn_type @Op.2 [template]
|
||||
// CHECK:STDOUT: %Op.2: %Op.type.2 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: <witness> = interface_witness (%Op.1) [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.4: type = assoc_entity_type %Add.type, %Op.type.2 [template]
|
||||
// CHECK:STDOUT: %.5: %.4 = assoc_entity element0, imports.%import_ref.6 [template]
|
||||
// CHECK:STDOUT: %.6: <bound method> = bound_method %.2, %Op.1 [template]
|
||||
// CHECK:STDOUT: %.7: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.8: type = array_type %.7, i32 [template]
|
||||
// CHECK:STDOUT: %.10: i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: %.11: <bound method> = bound_method %.7, %Op.1 [template]
|
||||
// CHECK:STDOUT: %.12: i32 = int_value 7 [template]
|
||||
// CHECK:STDOUT: %.9: <witness> = interface_witness (%Op.2) [template]
|
||||
// CHECK:STDOUT: %.10: <bound method> = bound_method %.1, %Op.2 [template]
|
||||
// CHECK:STDOUT: %.11: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.12: %.5 = assoc_entity element0, imports.%import_ref.19 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.2 [template]
|
||||
// CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.13: <witness> = interface_witness (%Convert.3) [template]
|
||||
// CHECK:STDOUT: %.14: <bound method> = bound_method %.11, %Convert.3 [template]
|
||||
// CHECK:STDOUT: %.15: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.16: type = array_type %.15, i32 [template]
|
||||
// CHECK:STDOUT: %.18: i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: %.19: <bound method> = bound_method %.11, %Op.2 [template]
|
||||
// CHECK:STDOUT: %.20: i32 = int_value 7 [template]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.13: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.8 = tuple_value (%.7, %.10, %.12) [template]
|
||||
// CHECK:STDOUT: %.21: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.16 = tuple_value (%.11, %.18, %.20) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int32 = %import_ref.1
|
||||
// CHECK:STDOUT: .Add = %import_ref.2
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.18
|
||||
// CHECK:STDOUT: import Core//default
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.2: type = import_ref Core//default, inst+9, loaded [template = constants.%Add.type]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+11, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: %.4 = import_ref Core//default, inst+39, loaded [template = constants.%.5]
|
||||
// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+34, loaded [template = constants.%Op.2]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+18, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: %.3 = import_ref Core//default, inst+46, loaded [template = constants.%.4]
|
||||
// CHECK:STDOUT: %import_ref.5 = import_ref Core//default, inst+41, unloaded
|
||||
// CHECK:STDOUT: %import_ref.7: type = import_ref Core//default, inst+92, loaded [template = i32]
|
||||
// CHECK:STDOUT: %import_ref.8: type = import_ref Core//default, inst+93, loaded [template = constants.%Add.type]
|
||||
// CHECK:STDOUT: %import_ref.9: <witness> = import_ref Core//default, inst+113, loaded [template = constants.%.9]
|
||||
// CHECK:STDOUT: %import_ref.10 = import_ref Core//default, inst+60, unloaded
|
||||
// CHECK:STDOUT: %import_ref.11: @ImplicitAs.%.1 (%.5) = import_ref Core//default, inst+82, loaded [symbolic = @ImplicitAs.%.2 (constants.%.12)]
|
||||
// CHECK:STDOUT: %import_ref.12 = import_ref Core//default, inst+75, unloaded
|
||||
// CHECK:STDOUT: %import_ref.13: type = import_ref Core//default, inst+117, loaded [template = i32]
|
||||
// CHECK:STDOUT: %import_ref.14: type = import_ref Core//default, inst+123, loaded [template = constants.%ImplicitAs.type.3]
|
||||
// CHECK:STDOUT: %import_ref.15: <witness> = import_ref Core//default, inst+146, loaded [template = constants.%.13]
|
||||
// CHECK:STDOUT: %import_ref.16 = import_ref Core//default, inst+75, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -149,24 +388,24 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT: .arr = %arr
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: impl_decl @impl [template] {} {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32, %.loc6_6.1 [template = i32]
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.2 [template = constants.%Add.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc10_16: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc10_20: i32 = int_value 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc10_18.1: %Op.type.2 = interface_witness_access constants.%.1, element0 [template = constants.%Op.1]
|
||||
// CHECK:STDOUT: %.loc10_18.2: <bound method> = bound_method %.loc10_16, %.loc10_18.1 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_18.2(%.loc10_16, %.loc10_20) [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc10_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc10_11.2: type = converted %int.make_type_32, %.loc10_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc10_21: type = array_type %int.sadd, i32 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %arr.var: ref %.8 = var arr
|
||||
// CHECK:STDOUT: %arr: ref %.8 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: %.loc4_16: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_20: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc4_18.1: %Op.type.1 = interface_witness_access constants.%.9, element0 [template = constants.%Op.2]
|
||||
// CHECK:STDOUT: %.loc4_18.2: <bound method> = bound_method %.loc4_16, %.loc4_18.1 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc4_18.2(%.loc4_16, %.loc4_20) [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc4_18.3: %Convert.type.2 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.3]
|
||||
// CHECK:STDOUT: %.loc4_18.4: <bound method> = bound_method %int.sadd, %.loc4_18.3 [template = constants.%.14]
|
||||
// CHECK:STDOUT: %.loc4_18.5: i32 = value_of_initializer %int.sadd [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc4_18.6: i32 = converted %int.sadd, %.loc4_18.5 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc4_18.4(%.loc4_18.6) [template = constants.%.15]
|
||||
// CHECK:STDOUT: %.loc4_18.7: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.15]
|
||||
// CHECK:STDOUT: %.loc4_18.8: Core.IntLiteral = converted %int.sadd, %.loc4_18.7 [template = constants.%.15]
|
||||
// CHECK:STDOUT: %.loc4_21: type = array_type %.loc4_18.8, i32 [template = constants.%.16]
|
||||
// CHECK:STDOUT: %arr.var: ref %.16 = var arr
|
||||
// CHECK:STDOUT: %arr: ref %.16 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @Add {
|
||||
@@ -176,72 +415,116 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT: witness = (imports.%import_ref.5)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl: %.loc6_6.2 as %Add.ref {
|
||||
// CHECK:STDOUT: %Op.decl: %Op.type.1 = fn_decl @Op.1 [template = constants.%Op.1] {
|
||||
// CHECK:STDOUT: %self.patt: i32 = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: i32 = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %other.patt: i32 = binding_pattern other
|
||||
// CHECK:STDOUT: %other.param_patt: i32 = value_param_pattern %other.patt, runtime_param1
|
||||
// CHECK:STDOUT: %return.patt: i32 = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: i32 = out_param_pattern %return.patt, runtime_param2
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref.loc7_15: type = name_ref Self, @impl.%.loc6_6.2 [template = i32]
|
||||
// CHECK:STDOUT: %Self.ref.loc7_28: type = name_ref Self, @impl.%.loc6_6.2 [template = i32]
|
||||
// CHECK:STDOUT: %Self.ref.loc7_37: type = name_ref Self, @impl.%.loc6_6.2 [template = i32]
|
||||
// CHECK:STDOUT: %self.param: i32 = value_param runtime_param0
|
||||
// CHECK:STDOUT: %self: i32 = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %other.param: i32 = value_param runtime_param1
|
||||
// CHECK:STDOUT: %other: i32 = bind_name other, %other.param
|
||||
// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc6_22: <witness> = interface_witness (%Op.decl) [template = constants.%.1]
|
||||
// CHECK:STDOUT: generic interface @ImplicitAs(constants.%T: type) {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
||||
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)]
|
||||
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%T) [symbolic = %Convert.type (constants.%Convert.type.1)]
|
||||
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
|
||||
// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.5)]
|
||||
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.5) = assoc_entity element0, imports.%import_ref.16 [symbolic = %.2 (constants.%.6)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%import_ref.10
|
||||
// CHECK:STDOUT: .Convert = imports.%import_ref.11
|
||||
// CHECK:STDOUT: witness = (imports.%import_ref.12)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl.1: imports.%import_ref.7 as imports.%import_ref.8 {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Op = %Op.decl
|
||||
// CHECK:STDOUT: witness = %.loc6_22
|
||||
// CHECK:STDOUT: witness = imports.%import_ref.9
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl.2: imports.%import_ref.13 as imports.%import_ref.14 {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: witness = imports.%import_ref.15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Op.1[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: generic fn @Op.1(constants.%Self.1: %Add.type) {
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Op.2(constants.%Self: %Add.type) {
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self (%Self)](%other.param_patt: @Op.2.%Self (%Self)) -> @Op.2.%Self (%Self);
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self (%Self.1)](%other.param_patt: @Op.1.%Self (%Self.1)) -> @Op.1.%Self (%Self.1);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Convert.1(constants.%T: type, constants.%Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
|
||||
// CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
||||
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.3)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.3)]() -> @Convert.1.%T (%T);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Op.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Convert.2[%self.param_patt: i32]() -> Core.IntLiteral = "int.convert_checked";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc10_26: i32 = int_value 3 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc10_29: i32 = int_value 4 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc10_32: i32 = int_value 3 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc10_36: i32 = int_value 4 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc10_34.1: %Op.type.2 = interface_witness_access constants.%.1, element0 [template = constants.%Op.1]
|
||||
// CHECK:STDOUT: %.loc10_34.2: <bound method> = bound_method %.loc10_32, %.loc10_34.1 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc10_34.2(%.loc10_32, %.loc10_36) [template = constants.%.12]
|
||||
// CHECK:STDOUT: %.loc10_37.1: %tuple.type = tuple_literal (%.loc10_26, %.loc10_29, %int.sadd)
|
||||
// CHECK:STDOUT: %.loc10_37.2: i32 = int_value 0 [template = constants.%.13]
|
||||
// CHECK:STDOUT: %.loc10_37.3: ref i32 = array_index file.%arr.var, %.loc10_37.2
|
||||
// CHECK:STDOUT: %.loc10_37.4: init i32 = initialize_from %.loc10_26 to %.loc10_37.3 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc10_37.5: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc10_37.6: ref i32 = array_index file.%arr.var, %.loc10_37.5
|
||||
// CHECK:STDOUT: %.loc10_37.7: init i32 = initialize_from %.loc10_29 to %.loc10_37.6 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc10_37.8: i32 = int_value 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc10_37.9: ref i32 = array_index file.%arr.var, %.loc10_37.8
|
||||
// CHECK:STDOUT: %.loc10_37.10: init i32 = initialize_from %int.sadd to %.loc10_37.9 [template = constants.%.12]
|
||||
// CHECK:STDOUT: %.loc10_37.11: init %.8 = array_init (%.loc10_37.4, %.loc10_37.7, %.loc10_37.10) to file.%arr.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc10_38: init %.8 = converted %.loc10_37.1, %.loc10_37.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%arr.var, %.loc10_38
|
||||
// CHECK:STDOUT: %.loc4_26: i32 = int_value 3 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc4_29: i32 = int_value 4 [template = constants.%.18]
|
||||
// CHECK:STDOUT: %.loc4_32: i32 = int_value 3 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc4_36: i32 = int_value 4 [template = constants.%.18]
|
||||
// CHECK:STDOUT: %.loc4_34.1: %Op.type.1 = interface_witness_access constants.%.9, element0 [template = constants.%Op.2]
|
||||
// CHECK:STDOUT: %.loc4_34.2: <bound method> = bound_method %.loc4_32, %.loc4_34.1 [template = constants.%.19]
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %.loc4_34.2(%.loc4_32, %.loc4_36) [template = constants.%.20]
|
||||
// CHECK:STDOUT: %.loc4_37.1: %tuple.type = tuple_literal (%.loc4_26, %.loc4_29, %int.sadd)
|
||||
// CHECK:STDOUT: %.loc4_37.2: i32 = int_value 0 [template = constants.%.21]
|
||||
// CHECK:STDOUT: %.loc4_37.3: ref i32 = array_index file.%arr.var, %.loc4_37.2
|
||||
// CHECK:STDOUT: %.loc4_37.4: init i32 = initialize_from %.loc4_26 to %.loc4_37.3 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc4_37.5: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_37.6: ref i32 = array_index file.%arr.var, %.loc4_37.5
|
||||
// CHECK:STDOUT: %.loc4_37.7: init i32 = initialize_from %.loc4_29 to %.loc4_37.6 [template = constants.%.18]
|
||||
// CHECK:STDOUT: %.loc4_37.8: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc4_37.9: ref i32 = array_index file.%arr.var, %.loc4_37.8
|
||||
// CHECK:STDOUT: %.loc4_37.10: init i32 = initialize_from %int.sadd to %.loc4_37.9 [template = constants.%.20]
|
||||
// CHECK:STDOUT: %.loc4_37.11: init %.16 = array_init (%.loc4_37.4, %.loc4_37.7, %.loc4_37.10) to file.%arr.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc4_38: init %.16 = converted %.loc4_37.1, %.loc4_37.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%arr.var, %.loc4_38
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.2(constants.%Self) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self
|
||||
// CHECK:STDOUT: specific @Op.1(constants.%Self.1) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Op.2(i32) {
|
||||
// CHECK:STDOUT: %Self => i32
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%T) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %T.patt => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
|
||||
// CHECK:STDOUT: %T => Core.IntLiteral
|
||||
// CHECK:STDOUT: %T.patt => Core.IntLiteral
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
|
||||
// CHECK:STDOUT: %Self => constants.%Self.3
|
||||
// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2
|
||||
// CHECK:STDOUT: %Convert => constants.%Convert.2
|
||||
// CHECK:STDOUT: %.1 => constants.%.7
|
||||
// CHECK:STDOUT: %.2 => constants.%.8
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(%T) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %T.patt => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%T) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %T.patt => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Convert.1(constants.%T, constants.%Self.2) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
|
||||
// CHECK:STDOUT: %Self => constants.%Self.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -15,11 +15,14 @@ package Core library "[[@TEST_NAME]]";
|
||||
fn Int32() -> type = "int.make_type_32";
|
||||
fn TestAdd(a: i32, b: i32) -> i32 = "int.sadd";
|
||||
|
||||
fn IntLiteral() -> type = "int_literal.make_type";
|
||||
fn AsIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked";
|
||||
|
||||
// --- use.carbon
|
||||
|
||||
import Core library "core";
|
||||
|
||||
var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
|
||||
var arr: [i32; Core.AsIntLiteral(Core.TestAdd(1, 2))] = (1, 2, 3);
|
||||
|
||||
// CHECK:STDOUT: --- core.carbon
|
||||
// CHECK:STDOUT:
|
||||
@@ -28,12 +31,18 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template]
|
||||
// CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
|
||||
// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template]
|
||||
// CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Int32 = %Int32.decl
|
||||
// CHECK:STDOUT: .TestAdd = %TestAdd.decl
|
||||
// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl
|
||||
// CHECK:STDOUT: .AsIntLiteral = %AsIntLiteral.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Int32.decl: %Int32.type = fn_decl @Int32 [template = constants.%Int32] {
|
||||
// CHECK:STDOUT: %return.patt: type = return_slot_pattern
|
||||
@@ -66,35 +75,69 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
|
||||
// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] {
|
||||
// CHECK:STDOUT: %return.patt: type = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0
|
||||
// CHECK:STDOUT: %return: ref type = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %AsIntLiteral.decl: %AsIntLiteral.type = fn_decl @AsIntLiteral [template = constants.%AsIntLiteral] {
|
||||
// CHECK:STDOUT: %a.patt: i32 = binding_pattern a
|
||||
// CHECK:STDOUT: %a.param_patt: i32 = value_param_pattern %a.patt, runtime_param0
|
||||
// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc8_20.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc8_20.2: type = converted %int.make_type_32, %.loc8_20.1 [template = i32]
|
||||
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
|
||||
// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc8_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %.loc8_39.2: type = converted %int_literal.make_type, %.loc8_39.1 [template = Core.IntLiteral]
|
||||
// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0
|
||||
// CHECK:STDOUT: %a: i32 = bind_name a, %a.param
|
||||
// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @TestAdd(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- use.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [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: %.1: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template]
|
||||
// CHECK:STDOUT: %.4: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.4 = tuple_value (%.1, %.2, %.3) [template]
|
||||
// CHECK:STDOUT: %.7: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.5 = tuple_value (%.1, %.2, %.3) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int32 = %import_ref.1
|
||||
// CHECK:STDOUT: .TestAdd = %import_ref.2
|
||||
// CHECK:STDOUT: .AsIntLiteral = %import_ref.2
|
||||
// CHECK:STDOUT: .TestAdd = %import_ref.3
|
||||
// CHECK:STDOUT: import Core//core
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+30, loaded [template = constants.%TestAdd]
|
||||
// CHECK:STDOUT: %import_ref.2: %AsIntLiteral.type = import_ref Core//core, inst+55, loaded [template = constants.%AsIntLiteral]
|
||||
// CHECK:STDOUT: %import_ref.3: %TestAdd.type = import_ref Core//core, inst+30, loaded [template = constants.%TestAdd]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -104,40 +147,49 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.2 [template = constants.%TestAdd]
|
||||
// CHECK:STDOUT: %.loc4_29: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_32: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %TestAdd.ref(%.loc4_29, %.loc4_32) [template = constants.%.3]
|
||||
// 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.2 [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.3 [template = constants.%TestAdd]
|
||||
// CHECK:STDOUT: %.loc4_47: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_50: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %TestAdd.ref(%.loc4_47, %.loc4_50) [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc4_46.1: i32 = value_of_initializer %int.sadd [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc4_46.2: i32 = converted %int.sadd, %.loc4_46.1 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %AsIntLiteral.ref(%.loc4_46.2) [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc4_34: type = array_type %int.sadd, i32 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %arr.var: ref %.4 = var arr
|
||||
// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: %.loc4_33.1: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc4_33.2: Core.IntLiteral = converted %int.convert_checked, %.loc4_33.1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc4_53: type = array_type %.loc4_33.2, i32 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %arr.var: ref %.5 = var arr
|
||||
// CHECK:STDOUT: %arr: ref %.5 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: i32) -> Core.IntLiteral = "int.convert_checked";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @TestAdd(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc4_39: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_42: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc4_45: i32 = int_value 3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc4_46.1: %tuple.type = tuple_literal (%.loc4_39, %.loc4_42, %.loc4_45)
|
||||
// CHECK:STDOUT: %.loc4_46.2: i32 = int_value 0 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc4_46.3: ref i32 = array_index file.%arr.var, %.loc4_46.2
|
||||
// CHECK:STDOUT: %.loc4_46.4: init i32 = initialize_from %.loc4_39 to %.loc4_46.3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_46.5: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_46.6: ref i32 = array_index file.%arr.var, %.loc4_46.5
|
||||
// CHECK:STDOUT: %.loc4_46.7: init i32 = initialize_from %.loc4_42 to %.loc4_46.6 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc4_46.8: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc4_46.9: ref i32 = array_index file.%arr.var, %.loc4_46.8
|
||||
// CHECK:STDOUT: %.loc4_46.10: init i32 = initialize_from %.loc4_45 to %.loc4_46.9 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc4_46.11: init %.4 = array_init (%.loc4_46.4, %.loc4_46.7, %.loc4_46.10) to file.%arr.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc4_47: init %.4 = converted %.loc4_46.1, %.loc4_46.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%arr.var, %.loc4_47
|
||||
// CHECK:STDOUT: %.loc4_58: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_61: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc4_64: i32 = int_value 3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc4_65.1: %tuple.type = tuple_literal (%.loc4_58, %.loc4_61, %.loc4_64)
|
||||
// CHECK:STDOUT: %.loc4_65.2: i32 = int_value 0 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc4_65.3: ref i32 = array_index file.%arr.var, %.loc4_65.2
|
||||
// CHECK:STDOUT: %.loc4_65.4: init i32 = initialize_from %.loc4_58 to %.loc4_65.3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_65.5: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc4_65.6: ref i32 = array_index file.%arr.var, %.loc4_65.5
|
||||
// CHECK:STDOUT: %.loc4_65.7: init i32 = initialize_from %.loc4_61 to %.loc4_65.6 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc4_65.8: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc4_65.9: ref i32 = array_index file.%arr.var, %.loc4_65.8
|
||||
// CHECK:STDOUT: %.loc4_65.10: init i32 = initialize_from %.loc4_64 to %.loc4_65.9 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc4_65.11: init %.5 = array_init (%.loc4_65.4, %.loc4_65.7, %.loc4_65.10) to file.%arr.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc4_66: init %.5 = converted %.loc4_65.1, %.loc4_65.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%arr.var, %.loc4_66
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -47,6 +47,8 @@ fn F(n: i32, a: [i32; n]*);
|
||||
// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32.loc14_9, %.loc14_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc14_18: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %.loc14_18.1: type = value_of_initializer %int.make_type_32.loc14_18 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_18.2: type = converted %int.make_type_32.loc14_18, %.loc14_18.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_25: type = ptr_type <error> [template = <error>]
|
||||
// CHECK:STDOUT: %n.param: i32 = value_param runtime_param0
|
||||
// CHECK:STDOUT: %n: i32 = bind_name n, %n.param
|
||||
|
||||
@@ -18,15 +18,22 @@ fn F(N:! i32, a: [i32; N]*);
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %N.1: i32 = bind_symbolic_name N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %N.patt.1: i32 = symbolic_binding_pattern N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template]
|
||||
// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.24: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.25: <bound method> = bound_method %N.1, %Convert.15 [symbolic]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.25(%N.1) [symbolic]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int32 = %import_ref
|
||||
// CHECK:STDOUT: .Int32 = %import_ref.1
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.2
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -39,8 +46,8 @@ fn F(N:! i32, a: [i32; N]*);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
||||
// CHECK:STDOUT: %N.patt.loc14_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)]
|
||||
// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc14_6.1, runtime_param<invalid> [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)]
|
||||
// CHECK:STDOUT: %N.patt.loc14_6.1: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)]
|
||||
// CHECK:STDOUT: %N.param_patt: i32 = value_param_pattern %N.patt.loc14_6.1, runtime_param<invalid> [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)]
|
||||
// CHECK:STDOUT: %a.patt: <error> = binding_pattern a
|
||||
// CHECK:STDOUT: %a.param_patt: <error> = value_param_pattern %a.patt, runtime_param0
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -48,27 +55,36 @@ fn F(N:! i32, a: [i32; N]*);
|
||||
// CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14_10 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_10.2: type = converted %int.make_type_32.loc14_10, %.loc14_10.1 [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc14_19: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N)]
|
||||
// CHECK:STDOUT: %N.ref: i32 = name_ref N, %N.loc14_6.1 [symbolic = %N.loc14_6.2 (constants.%N.1)]
|
||||
// CHECK:STDOUT: %.loc14_19.1: type = value_of_initializer %int.make_type_32.loc14_19 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_19.2: type = converted %int.make_type_32.loc14_19, %.loc14_19.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_25: type = array_type %N.ref, i32 [template = <error>]
|
||||
// CHECK:STDOUT: %.loc14_24.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc14_24.2: <bound method> = bound_method %N.ref, %.loc14_24.1 [symbolic = %.loc14_24.5 (constants.%.25)]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_24.1: init Core.IntLiteral = call %.loc14_24.2(%N.ref) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT: %.loc14_24.3: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14_24.1 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT: %.loc14_24.4: Core.IntLiteral = converted %N.ref, %.loc14_24.3 [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT: %.loc14_25: type = array_type %.loc14_24.4, i32 [template = <error>]
|
||||
// CHECK:STDOUT: %.loc14_26: type = ptr_type <error> [template = <error>]
|
||||
// CHECK:STDOUT: %N.param: i32 = value_param runtime_param<invalid>
|
||||
// CHECK:STDOUT: %N.loc14_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N)]
|
||||
// CHECK:STDOUT: %N.loc14_6.1: i32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_6.2 (constants.%N.1)]
|
||||
// CHECK:STDOUT: %a.param: <error> = value_param runtime_param0
|
||||
// CHECK:STDOUT: %a: <error> = bind_name a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%N.loc14_6.1: i32) {
|
||||
// CHECK:STDOUT: %N.loc14_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N)]
|
||||
// CHECK:STDOUT: %N.patt.loc14_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt)]
|
||||
// CHECK:STDOUT: %N.loc14_6.2: i32 = bind_symbolic_name N, 0 [symbolic = %N.loc14_6.2 (constants.%N.1)]
|
||||
// CHECK:STDOUT: %N.patt.loc14_6.2: i32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_6.2 (constants.%N.patt.1)]
|
||||
// CHECK:STDOUT: %.loc14_24.5: <bound method> = bound_method %N.loc14_6.2, constants.%Convert.15 [symbolic = %.loc14_24.5 (constants.%.25)]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_24.2: init Core.IntLiteral = call %.loc14_24.5(%N.loc14_6.2) [symbolic = %int.convert_checked.loc14_24.2 (constants.%int.convert_checked)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%N.param_patt: i32, %a.param_patt: <error>);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%N) {
|
||||
// CHECK:STDOUT: %N.loc14_6.2 => constants.%N
|
||||
// CHECK:STDOUT: %N.patt.loc14_6.2 => constants.%N
|
||||
// CHECK:STDOUT: specific @F(constants.%N.1) {
|
||||
// CHECK:STDOUT: %N.loc14_6.2 => constants.%N.1
|
||||
// CHECK:STDOUT: %N.patt.loc14_6.2 => constants.%N.1
|
||||
// CHECK:STDOUT: %.loc14_24.5 => constants.%.25
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14_24.2 => constants.%int.convert_checked
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+30
-18
@@ -38,29 +38,36 @@ fn G() {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 100 [template]
|
||||
// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template]
|
||||
// CHECK:STDOUT: %.7: type = unbound_element_type %C, %.5 [template]
|
||||
// CHECK:STDOUT: %.8: type = struct_type {.arr: %.5} [template]
|
||||
// CHECK:STDOUT: %.9: <witness> = complete_type_witness %.8 [template]
|
||||
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.11 [template]
|
||||
// CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.28: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.29: <bound method> = bound_method %.4, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.30: Core.IntLiteral = int_value 100 [template]
|
||||
// CHECK:STDOUT: %.31: type = array_type %.30, i32 [template]
|
||||
// CHECK:STDOUT: %.33: type = unbound_element_type %C, %.31 [template]
|
||||
// CHECK:STDOUT: %.34: type = struct_type {.arr: %.31} [template]
|
||||
// CHECK:STDOUT: %.35: <witness> = complete_type_witness %.34 [template]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Wrap.3: type = class_type @Wrap, @Wrap(i32) [template]
|
||||
// CHECK:STDOUT: %Make.type.2: type = fn_type @Make, @Wrap(i32) [template]
|
||||
// CHECK:STDOUT: %Make.2: %Make.type.2 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.11: <specific function> = specific_function %Make.2, @Make(i32) [template]
|
||||
// CHECK:STDOUT: %.37: <specific function> = specific_function %Make.2, @Make(i32) [template]
|
||||
// CHECK:STDOUT: %Wrap.4: type = class_type @Wrap, @Wrap(%empty_tuple.type) [template]
|
||||
// CHECK:STDOUT: %Make.type.3: type = fn_type @Make, @Wrap(%empty_tuple.type) [template]
|
||||
// CHECK:STDOUT: %Make.3: %Make.type.3 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.12: <specific function> = specific_function %Make.3, @Make(%empty_tuple.type) [template]
|
||||
// CHECK:STDOUT: %.38: <specific function> = specific_function %Make.3, @Make(%empty_tuple.type) [template]
|
||||
// CHECK:STDOUT: %Wrap.5: type = class_type @Wrap, @Wrap(%C) [template]
|
||||
// CHECK:STDOUT: %Make.type.4: type = fn_type @Make, @Wrap(%C) [template]
|
||||
// CHECK:STDOUT: %Make.4: %Make.type.4 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.15: <specific function> = specific_function %Make.4, @Make(%C) [template]
|
||||
// CHECK:STDOUT: %.41: <specific function> = specific_function %Make.4, @Make(%C) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .Int32 = %import_ref
|
||||
// CHECK:STDOUT: .Int32 = %import_ref.1
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.2
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -112,12 +119,17 @@ fn G() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_26: i32 = int_value 100 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc15_26.1: i32 = int_value 100 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc15_21.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_21.2: type = converted %int.make_type_32, %.loc15_21.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26, i32 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc15_18: %.7 = field_decl arr, element0 [template]
|
||||
// CHECK:STDOUT: %.loc15_32: <witness> = complete_type_witness %.8 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc15_26.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc15_26.3: <bound method> = bound_method %.loc15_26.1, %.loc15_26.2 [template = constants.%.29]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc15_26.3(%.loc15_26.1) [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc15_26.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc15_26.5: Core.IntLiteral = converted %.loc15_26.1, %.loc15_26.4 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc15_29: type = array_type %.loc15_26.5, i32 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc15_18: %.33 = field_decl arr, element0 [template]
|
||||
// CHECK:STDOUT: %.loc15_32: <witness> = complete_type_witness %.34 [template = constants.%.35]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
@@ -158,7 +170,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %Wrap.loc18: type = class_type @Wrap, @Wrap(i32) [template = constants.%Wrap.3]
|
||||
// CHECK:STDOUT: %.loc18_25.1: %Make.type.2 = specific_constant @Wrap.%Make.decl, @Wrap(i32) [template = constants.%Make.2]
|
||||
// CHECK:STDOUT: %Make.ref.loc18: %Make.type.2 = name_ref Make, %.loc18_25.1 [template = constants.%Make.2]
|
||||
// CHECK:STDOUT: %.loc18_25.2: <specific function> = specific_function %Make.ref.loc18, @Make(i32) [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc18_25.2: <specific function> = specific_function %Make.ref.loc18, @Make(i32) [template = constants.%.37]
|
||||
// CHECK:STDOUT: %Make.call.loc18: init i32 = call %.loc18_25.2()
|
||||
// CHECK:STDOUT: assign %a.var, %Make.call.loc18
|
||||
// CHECK:STDOUT: %.loc19_11.1: %empty_tuple.type = tuple_literal ()
|
||||
@@ -171,7 +183,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %Wrap.loc19: type = class_type @Wrap, @Wrap(constants.%empty_tuple.type) [template = constants.%Wrap.4]
|
||||
// CHECK:STDOUT: %.loc19_23.1: %Make.type.3 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%empty_tuple.type) [template = constants.%Make.3]
|
||||
// CHECK:STDOUT: %Make.ref.loc19: %Make.type.3 = name_ref Make, %.loc19_23.1 [template = constants.%Make.3]
|
||||
// CHECK:STDOUT: %.loc19_23.2: <specific function> = specific_function %Make.ref.loc19, @Make(constants.%empty_tuple.type) [template = constants.%.12]
|
||||
// CHECK:STDOUT: %.loc19_23.2: <specific function> = specific_function %Make.ref.loc19, @Make(constants.%empty_tuple.type) [template = constants.%.38]
|
||||
// CHECK:STDOUT: %Make.call.loc19: init %empty_tuple.type = call %.loc19_23.2()
|
||||
// CHECK:STDOUT: assign %b.var, %Make.call.loc19
|
||||
// CHECK:STDOUT: %C.ref.loc20_10: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
@@ -182,7 +194,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %Wrap.loc20: type = class_type @Wrap, @Wrap(constants.%C) [template = constants.%Wrap.5]
|
||||
// CHECK:STDOUT: %.loc20_21.1: %Make.type.4 = specific_constant @Wrap.%Make.decl, @Wrap(constants.%C) [template = constants.%Make.4]
|
||||
// CHECK:STDOUT: %Make.ref.loc20: %Make.type.4 = name_ref Make, %.loc20_21.1 [template = constants.%Make.4]
|
||||
// CHECK:STDOUT: %.loc20_21.2: <specific function> = specific_function %Make.ref.loc20, @Make(constants.%C) [template = constants.%.15]
|
||||
// CHECK:STDOUT: %.loc20_21.2: <specific function> = specific_function %Make.ref.loc20, @Make(constants.%C) [template = constants.%.41]
|
||||
// CHECK:STDOUT: %.loc20_7: ref %C = splice_block %c.var {}
|
||||
// CHECK:STDOUT: %Make.call.loc20: init %C = call %.loc20_21.2() to %.loc20_7
|
||||
// CHECK:STDOUT: assign %c.var, %Make.call.loc20
|
||||
@@ -236,7 +248,7 @@ fn G() {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Make.type => constants.%Make.type.2
|
||||
// CHECK:STDOUT: %Make => constants.%Make.2
|
||||
// CHECK:STDOUT: %.loc12_27.3 => constants.%.11
|
||||
// CHECK:STDOUT: %.loc12_27.3 => constants.%.37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Wrap(constants.%empty_tuple.type) {
|
||||
@@ -254,7 +266,7 @@ fn G() {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Make.type => constants.%Make.type.3
|
||||
// CHECK:STDOUT: %Make => constants.%Make.3
|
||||
// CHECK:STDOUT: %.loc12_27.3 => constants.%.12
|
||||
// CHECK:STDOUT: %.loc12_27.3 => constants.%.38
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Wrap(constants.%C) {
|
||||
@@ -272,6 +284,6 @@ fn G() {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Make.type => constants.%Make.type.4
|
||||
// CHECK:STDOUT: %Make => constants.%Make.4
|
||||
// CHECK:STDOUT: %.loc12_27.3 => constants.%.15
|
||||
// CHECK:STDOUT: %.loc12_27.3 => constants.%.41
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user