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:
+24
-12
@@ -26,15 +26,22 @@ fn G() {
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, %tuple.type.2 [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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, %tuple.type.2 [template]
|
||||
// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.2, %tuple.type.2) [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.31: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %.32: i32 = int_value 1 [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: }
|
||||
@@ -76,7 +83,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %int.make_type_32.loc14_17: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc14_22: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_25.1: %tuple.type.1 = tuple_literal (%int.make_type_32.loc14_12, %int.make_type_32.loc14_17, %int.make_type_32.loc14_22)
|
||||
// CHECK:STDOUT: %.loc14_28: i32 = int_value 2 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc14_28.1: i32 = int_value 2 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc14_25.2: type = value_of_initializer %int.make_type_32.loc14_12 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_25.3: type = converted %int.make_type_32.loc14_12, %.loc14_25.2 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_25.4: type = value_of_initializer %int.make_type_32.loc14_17 [template = i32]
|
||||
@@ -84,24 +91,29 @@ fn G() {
|
||||
// CHECK:STDOUT: %.loc14_25.6: type = value_of_initializer %int.make_type_32.loc14_22 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_25.7: type = converted %int.make_type_32.loc14_22, %.loc14_25.6 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_25.8: type = converted %.loc14_25.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
|
||||
// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28, %tuple.type.2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %v.var: ref %.2 = var v
|
||||
// CHECK:STDOUT: %v: ref %.2 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %.loc14_28.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc14_28.3: <bound method> = bound_method %.loc14_28.1, %.loc14_28.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc14_28.3(%.loc14_28.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc14_28.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc14_28.5: Core.IntLiteral = converted %.loc14_28.1, %.loc14_28.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28.5, %tuple.type.2 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %v.var: ref %.28 = var v
|
||||
// CHECK:STDOUT: %v: ref %.28 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %F.ref.loc14_34: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
||||
// CHECK:STDOUT: %.loc14_42.3: ref %tuple.type.2 = splice_block %.loc14_42.2 {
|
||||
// CHECK:STDOUT: %.loc14_42.1: i32 = int_value 0 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_42.1: i32 = int_value 0 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc14_42.2: ref %tuple.type.2 = array_index %v.var, %.loc14_42.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.call.loc14_35: init %tuple.type.2 = call %F.ref.loc14_34() to %.loc14_42.3
|
||||
// CHECK:STDOUT: %F.ref.loc14_39: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
||||
// CHECK:STDOUT: %.loc14_42.6: ref %tuple.type.2 = splice_block %.loc14_42.5 {
|
||||
// CHECK:STDOUT: %.loc14_42.4: i32 = int_value 1 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc14_42.4: i32 = int_value 1 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc14_42.5: ref %tuple.type.2 = array_index %v.var, %.loc14_42.4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.call.loc14_40: init %tuple.type.2 = call %F.ref.loc14_39() to %.loc14_42.6
|
||||
// CHECK:STDOUT: %.loc14_42.7: %tuple.type.3 = tuple_literal (%F.call.loc14_35, %F.call.loc14_40)
|
||||
// CHECK:STDOUT: %.loc14_42.8: init %.2 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var
|
||||
// CHECK:STDOUT: %.loc14_43: init %.2 = converted %.loc14_42.7, %.loc14_42.8
|
||||
// CHECK:STDOUT: %.loc14_42.8: init %.28 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var
|
||||
// CHECK:STDOUT: %.loc14_43: init %.28 = converted %.loc14_42.7, %.loc14_42.8
|
||||
// CHECK:STDOUT: assign %v.var, %.loc14_43
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+36
-24
@@ -22,19 +22,26 @@ fn G() {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 2 [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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.31: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template]
|
||||
// CHECK:STDOUT: %.32: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [template]
|
||||
// CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.4, %.5, %.1) [template]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.30, %.31, %.1) [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: }
|
||||
@@ -52,27 +59,32 @@ fn G() {
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc13_16: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_16.1: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_11.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
|
||||
// CHECK:STDOUT: %.loc13_11.2: type = converted %int.make_type_32.loc13, %.loc13_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc13_17: type = array_type %.loc13_16, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.var: ref %.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc13_22: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc13_25: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc13_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc13_16.3: <bound method> = bound_method %.loc13_16.1, %.loc13_16.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_16.3(%.loc13_16.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc13_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc13_16.5: Core.IntLiteral = converted %.loc13_16.1, %.loc13_16.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc13_17: type = array_type %.loc13_16.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %a.var: ref %.28 = var a
|
||||
// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc13_22: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc13_25: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc13_28: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_29.1: %tuple.type.1 = tuple_literal (%.loc13_22, %.loc13_25, %.loc13_28)
|
||||
// CHECK:STDOUT: %.loc13_29.2: i32 = int_value 0 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc13_29.2: i32 = int_value 0 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc13_29.3: ref i32 = array_index %a.var, %.loc13_29.2
|
||||
// CHECK:STDOUT: %.loc13_29.4: init i32 = initialize_from %.loc13_22 to %.loc13_29.3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc13_29.5: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc13_29.4: init i32 = initialize_from %.loc13_22 to %.loc13_29.3 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc13_29.5: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc13_29.6: ref i32 = array_index %a.var, %.loc13_29.5
|
||||
// CHECK:STDOUT: %.loc13_29.7: init i32 = initialize_from %.loc13_25 to %.loc13_29.6 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc13_29.8: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc13_29.7: init i32 = initialize_from %.loc13_25 to %.loc13_29.6 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc13_29.8: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc13_29.9: ref i32 = array_index %a.var, %.loc13_29.8
|
||||
// CHECK:STDOUT: %.loc13_29.10: init i32 = initialize_from %.loc13_28 to %.loc13_29.9 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_29.11: init %.2 = array_init (%.loc13_29.4, %.loc13_29.7, %.loc13_29.10) to %a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc13_30: init %.2 = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc13_29.11: init %.28 = array_init (%.loc13_29.4, %.loc13_29.7, %.loc13_29.10) to %a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc13_30: init %.28 = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc13_30
|
||||
// CHECK:STDOUT: %int.make_type_32.loc14_11: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc14_16: init type = call constants.%Int32() [template = i32]
|
||||
@@ -87,14 +99,14 @@ fn G() {
|
||||
// CHECK:STDOUT: %.loc14_24.8: type = converted %.loc14_24.1, constants.%tuple.type.1 [template = constants.%tuple.type.1]
|
||||
// CHECK:STDOUT: %b.var: ref %tuple.type.1 = var b
|
||||
// CHECK:STDOUT: %b: ref %tuple.type.1 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %.loc14_29: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_32: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_29: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc14_32: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc14_35: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc14_36.1: %tuple.type.1 = tuple_literal (%.loc14_29, %.loc14_32, %.loc14_35)
|
||||
// CHECK:STDOUT: %.loc14_36.2: ref i32 = tuple_access %b.var, element0
|
||||
// CHECK:STDOUT: %.loc14_36.3: init i32 = initialize_from %.loc14_29 to %.loc14_36.2 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_36.3: init i32 = initialize_from %.loc14_29 to %.loc14_36.2 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc14_36.4: ref i32 = tuple_access %b.var, element1
|
||||
// CHECK:STDOUT: %.loc14_36.5: init i32 = initialize_from %.loc14_32 to %.loc14_36.4 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_36.5: init i32 = initialize_from %.loc14_32 to %.loc14_36.4 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc14_36.6: ref i32 = tuple_access %b.var, element2
|
||||
// CHECK:STDOUT: %.loc14_36.7: init i32 = initialize_from %.loc14_35 to %.loc14_36.6 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc14_36.8: init %tuple.type.1 = tuple_init (%.loc14_36.3, %.loc14_36.5, %.loc14_36.7) to %b.var [template = constants.%tuple]
|
||||
|
||||
+20
-8
@@ -28,12 +28,19 @@ fn Run() {
|
||||
// CHECK:STDOUT: %Run.type: type = fn_type @Run [template]
|
||||
// CHECK:STDOUT: %Run: %Run.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.3: type = array_type %.2, 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: %.26: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.27: <bound method> = bound_method %.2, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.28: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.29: type = array_type %.28, 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: }
|
||||
@@ -73,12 +80,17 @@ fn Run() {
|
||||
// CHECK:STDOUT: fn @Run() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_16: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc14_16.1: i32 = int_value 1 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_11.2: type = converted %int.make_type_32, %.loc14_11.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16, i32 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %t.var: ref %.3 = var t
|
||||
// CHECK:STDOUT: %t: ref %.3 = bind_name t, %t.var
|
||||
// CHECK:STDOUT: %.loc14_16.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc14_16.3: <bound method> = bound_method %.loc14_16.1, %.loc14_16.2 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc14_16.3(%.loc14_16.1) [template = constants.%.28]
|
||||
// CHECK:STDOUT: %.loc14_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.28]
|
||||
// CHECK:STDOUT: %.loc14_16.5: Core.IntLiteral = converted %.loc14_16.1, %.loc14_16.4 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %.loc14_17: type = array_type %.loc14_16.5, i32 [template = constants.%.29]
|
||||
// CHECK:STDOUT: %t.var: ref %.29 = var t
|
||||
// CHECK:STDOUT: %t: ref %.29 = bind_name t, %t.var
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
||||
// CHECK:STDOUT: %F.call: init %tuple.type.2 = call %F.ref()
|
||||
// CHECK:STDOUT: %.loc14_22.1: ref %tuple.type.2 = temporary_storage
|
||||
@@ -88,8 +100,8 @@ fn Run() {
|
||||
// CHECK:STDOUT: %.loc14_22.5: i32 = int_value 0 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc14_22.6: ref i32 = array_index %t.var, %.loc14_22.5
|
||||
// CHECK:STDOUT: %.loc14_22.7: init i32 = initialize_from %.loc14_22.4 to %.loc14_22.6
|
||||
// CHECK:STDOUT: %.loc14_22.8: init %.3 = array_init (%.loc14_22.7) to %t.var
|
||||
// CHECK:STDOUT: %.loc14_24: init %.3 = converted %F.call, %.loc14_22.8
|
||||
// CHECK:STDOUT: %.loc14_22.8: init %.29 = array_init (%.loc14_22.7) to %t.var
|
||||
// CHECK:STDOUT: %.loc14_24: init %.29 = converted %F.call, %.loc14_22.8
|
||||
// CHECK:STDOUT: assign %t.var, %.loc14_24
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+22
-10
@@ -22,13 +22,20 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.2 = tuple_value (%.2, %.3, %.4) [template]
|
||||
// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template]
|
||||
// CHECK:STDOUT: %.7: i32 = int_value 0 [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 3 [template]
|
||||
// CHECK:STDOUT: %.31: type = array_type %.30, i32 [template]
|
||||
// CHECK:STDOUT: %.33: i32 = int_value 0 [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,12 +62,17 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_14: i32 = int_value 3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc12_14.1: i32 = int_value 3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_9.2: type = converted %int.make_type_32.loc12, %.loc12_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14, i32 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %b.var: ref %.5 = var b
|
||||
// CHECK:STDOUT: %b: ref %.5 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %.loc12_14.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc12_14.3: <bound method> = bound_method %.loc12_14.1, %.loc12_14.2 [template = constants.%.29]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc12_14.3(%.loc12_14.1) [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc12_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc12_14.5: Core.IntLiteral = converted %.loc12_14.1, %.loc12_14.4 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14.5, i32 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %b.var: ref %.31 = var b
|
||||
// CHECK:STDOUT: %b: ref %.31 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
@@ -81,7 +93,7 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: %a.ref: ref %tuple.type.2 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc12_19.1: ref i32 = tuple_access %a.ref, element0
|
||||
// CHECK:STDOUT: %.loc12_19.2: i32 = bind_value %.loc12_19.1
|
||||
// CHECK:STDOUT: %.loc12_19.3: i32 = int_value 0 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc12_19.3: i32 = int_value 0 [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc12_19.4: ref i32 = array_index file.%b.var, %.loc12_19.3
|
||||
// CHECK:STDOUT: %.loc12_19.5: init i32 = initialize_from %.loc12_19.2 to %.loc12_19.4
|
||||
// CHECK:STDOUT: %.loc12_19.6: ref i32 = tuple_access %a.ref, element1
|
||||
@@ -94,8 +106,8 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: %.loc12_19.13: i32 = int_value 2 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc12_19.14: ref i32 = array_index file.%b.var, %.loc12_19.13
|
||||
// CHECK:STDOUT: %.loc12_19.15: init i32 = initialize_from %.loc12_19.12 to %.loc12_19.14
|
||||
// CHECK:STDOUT: %.loc12_19.16: init %.5 = array_init (%.loc12_19.5, %.loc12_19.10, %.loc12_19.15) to file.%b.var
|
||||
// CHECK:STDOUT: %.loc12_20: init %.5 = converted %a.ref, %.loc12_19.16
|
||||
// CHECK:STDOUT: %.loc12_19.16: init %.31 = array_init (%.loc12_19.5, %.loc12_19.10, %.loc12_19.15) to file.%b.var
|
||||
// CHECK:STDOUT: %.loc12_20: init %.31 = converted %a.ref, %.loc12_19.16
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_20
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+70
-44
@@ -19,32 +19,43 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, 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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template]
|
||||
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32) [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array.1: %.2 = tuple_value (%.1) [template]
|
||||
// CHECK:STDOUT: %.5: Core.IntLiteral = int_value 64 [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array.1: %.28 = tuple_value (%.1) [template]
|
||||
// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 64 [template]
|
||||
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
|
||||
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.7: type = array_type %.6, f64 [template]
|
||||
// CHECK:STDOUT: %.9: f64 = float_literal 11.100000000000001 [template]
|
||||
// CHECK:STDOUT: %.10: f64 = float_literal 2.2000000000000002 [template]
|
||||
// CHECK:STDOUT: %.32: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.33: <bound method> = bound_method %.32, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.35: type = array_type %.34, f64 [template]
|
||||
// CHECK:STDOUT: %.37: f64 = float_literal 11.100000000000001 [template]
|
||||
// CHECK:STDOUT: %.38: f64 = float_literal 2.2000000000000002 [template]
|
||||
// CHECK:STDOUT: %tuple.type.2: type = tuple_type (f64, f64) [template]
|
||||
// CHECK:STDOUT: %array.2: %.7 = tuple_value (%.9, %.10) [template]
|
||||
// CHECK:STDOUT: %.11: i32 = int_value 5 [template]
|
||||
// CHECK:STDOUT: %.12: type = array_type %.11, %empty_tuple.type [template]
|
||||
// CHECK:STDOUT: %array.2: %.35 = tuple_value (%.37, %.38) [template]
|
||||
// CHECK:STDOUT: %.39: i32 = int_value 5 [template]
|
||||
// CHECK:STDOUT: %.40: <bound method> = bound_method %.39, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.41: Core.IntLiteral = int_value 5 [template]
|
||||
// CHECK:STDOUT: %.42: type = array_type %.41, %empty_tuple.type [template]
|
||||
// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%empty_tuple.type, %empty_tuple.type, %empty_tuple.type, %empty_tuple.type, %empty_tuple.type) [template]
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template]
|
||||
// CHECK:STDOUT: %.14: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.15: i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: %array.3: %.12 = tuple_value (%empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple) [template]
|
||||
// CHECK:STDOUT: %.44: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.45: i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: %array.3: %.42 = tuple_value (%empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple, %empty_tuple) [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: .Float = %import_ref.2
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.2
|
||||
// CHECK:STDOUT: .Float = %import_ref.51
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -59,49 +70,64 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_14: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.var: ref %.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc12_9.1: Core.IntLiteral = int_value 64 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc11_14.3: <bound method> = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc11 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %a.var: ref %.28 = var a
|
||||
// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc12_9.1: Core.IntLiteral = int_value 64 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_9.1) [template = f64]
|
||||
// CHECK:STDOUT: %.loc12_14: i32 = int_value 2 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc12_14.1: i32 = int_value 2 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc12_9.2: type = value_of_initializer %float.make_type [template = f64]
|
||||
// CHECK:STDOUT: %.loc12_9.3: type = converted %float.make_type, %.loc12_9.2 [template = f64]
|
||||
// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14, f64 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %b.var: ref %.7 = var b
|
||||
// CHECK:STDOUT: %b: ref %.7 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %.loc12_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc12_14.3: <bound method> = bound_method %.loc12_14.1, %.loc12_14.2 [template = constants.%.33]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc12: init Core.IntLiteral = call %.loc12_14.3(%.loc12_14.1) [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc12_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc12 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc12_14.5: Core.IntLiteral = converted %.loc12_14.1, %.loc12_14.4 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc12_15: type = array_type %.loc12_14.5, f64 [template = constants.%.35]
|
||||
// CHECK:STDOUT: %b.var: ref %.35 = var b
|
||||
// CHECK:STDOUT: %b: ref %.35 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %.loc13_10.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc13_13: i32 = int_value 5 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc13_13.1: i32 = int_value 5 [template = constants.%.39]
|
||||
// CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc13_14: type = array_type %.loc13_13, %empty_tuple.type [template = constants.%.12]
|
||||
// CHECK:STDOUT: %c.var: ref %.12 = var c
|
||||
// CHECK:STDOUT: %c: ref %.12 = bind_name c, %c.var
|
||||
// CHECK:STDOUT: %.loc13_13.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc13_13.3: <bound method> = bound_method %.loc13_13.1, %.loc13_13.2 [template = constants.%.40]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc13: init Core.IntLiteral = call %.loc13_13.3(%.loc13_13.1) [template = constants.%.41]
|
||||
// CHECK:STDOUT: %.loc13_13.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc13 [template = constants.%.41]
|
||||
// CHECK:STDOUT: %.loc13_13.5: Core.IntLiteral = converted %.loc13_13.1, %.loc13_13.4 [template = constants.%.41]
|
||||
// CHECK:STDOUT: %.loc13_14: type = array_type %.loc13_13.5, %empty_tuple.type [template = constants.%.42]
|
||||
// CHECK:STDOUT: %c.var: ref %.42 = var c
|
||||
// CHECK:STDOUT: %c: ref %.42 = bind_name c, %c.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_22.1: %tuple.type.1 = tuple_literal (%.loc11_20)
|
||||
// CHECK:STDOUT: %.loc11_22.2: i32 = int_value 0 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_22.2: i32 = int_value 0 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_22.3: ref i32 = array_index file.%a.var, %.loc11_22.2
|
||||
// CHECK:STDOUT: %.loc11_22.4: init i32 = initialize_from %.loc11_20 to %.loc11_22.3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_22.5: init %.2 = array_init (%.loc11_22.4) to file.%a.var [template = constants.%array.1]
|
||||
// CHECK:STDOUT: %.loc11_23: init %.2 = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%array.1]
|
||||
// CHECK:STDOUT: %.loc11_22.5: init %.28 = array_init (%.loc11_22.4) to file.%a.var [template = constants.%array.1]
|
||||
// CHECK:STDOUT: %.loc11_23: init %.28 = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%array.1]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_23
|
||||
// CHECK:STDOUT: %.loc12_20: f64 = float_literal 11.100000000000001 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc12_26: f64 = float_literal 2.2000000000000002 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc12_20: f64 = float_literal 11.100000000000001 [template = constants.%.37]
|
||||
// CHECK:STDOUT: %.loc12_26: f64 = float_literal 2.2000000000000002 [template = constants.%.38]
|
||||
// CHECK:STDOUT: %.loc12_30.1: %tuple.type.2 = tuple_literal (%.loc12_20, %.loc12_26)
|
||||
// CHECK:STDOUT: %.loc12_30.2: i32 = int_value 0 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc12_30.2: i32 = int_value 0 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc12_30.3: ref f64 = array_index file.%b.var, %.loc12_30.2
|
||||
// CHECK:STDOUT: %.loc12_30.4: init f64 = initialize_from %.loc12_20 to %.loc12_30.3 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc12_30.4: init f64 = initialize_from %.loc12_20 to %.loc12_30.3 [template = constants.%.37]
|
||||
// CHECK:STDOUT: %.loc12_30.5: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc12_30.6: ref f64 = array_index file.%b.var, %.loc12_30.5
|
||||
// CHECK:STDOUT: %.loc12_30.7: init f64 = initialize_from %.loc12_26 to %.loc12_30.6 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc12_30.8: init %.7 = array_init (%.loc12_30.4, %.loc12_30.7) to file.%b.var [template = constants.%array.2]
|
||||
// CHECK:STDOUT: %.loc12_31: init %.7 = converted %.loc12_30.1, %.loc12_30.8 [template = constants.%array.2]
|
||||
// CHECK:STDOUT: %.loc12_30.7: init f64 = initialize_from %.loc12_26 to %.loc12_30.6 [template = constants.%.38]
|
||||
// CHECK:STDOUT: %.loc12_30.8: init %.35 = array_init (%.loc12_30.4, %.loc12_30.7) to file.%b.var [template = constants.%array.2]
|
||||
// CHECK:STDOUT: %.loc12_31: init %.35 = converted %.loc12_30.1, %.loc12_30.8 [template = constants.%array.2]
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_31
|
||||
// CHECK:STDOUT: %.loc13_20.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc13_24.1: %empty_tuple.type = tuple_literal ()
|
||||
@@ -109,7 +135,7 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %.loc13_32.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc13_36.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc13_38.1: %tuple.type.3 = tuple_literal (%.loc13_20.1, %.loc13_24.1, %.loc13_28.1, %.loc13_32.1, %.loc13_36.1)
|
||||
// CHECK:STDOUT: %.loc13_38.2: i32 = int_value 0 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc13_38.2: i32 = int_value 0 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc13_38.3: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.2
|
||||
// CHECK:STDOUT: %.loc13_20.2: init %empty_tuple.type = tuple_init () to %.loc13_38.3 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.4: init %empty_tuple.type = converted %.loc13_20.1, %.loc13_20.2 [template = constants.%empty_tuple]
|
||||
@@ -117,20 +143,20 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %.loc13_38.6: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.5
|
||||
// CHECK:STDOUT: %.loc13_24.2: init %empty_tuple.type = tuple_init () to %.loc13_38.6 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.7: init %empty_tuple.type = converted %.loc13_24.1, %.loc13_24.2 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.8: i32 = int_value 2 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc13_38.8: i32 = int_value 2 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc13_38.9: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.8
|
||||
// CHECK:STDOUT: %.loc13_28.2: init %empty_tuple.type = tuple_init () to %.loc13_38.9 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.10: init %empty_tuple.type = converted %.loc13_28.1, %.loc13_28.2 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.11: i32 = int_value 3 [template = constants.%.14]
|
||||
// CHECK:STDOUT: %.loc13_38.11: i32 = int_value 3 [template = constants.%.44]
|
||||
// CHECK:STDOUT: %.loc13_38.12: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.11
|
||||
// CHECK:STDOUT: %.loc13_32.2: init %empty_tuple.type = tuple_init () to %.loc13_38.12 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.13: init %empty_tuple.type = converted %.loc13_32.1, %.loc13_32.2 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.14: i32 = int_value 4 [template = constants.%.15]
|
||||
// CHECK:STDOUT: %.loc13_38.14: i32 = int_value 4 [template = constants.%.45]
|
||||
// CHECK:STDOUT: %.loc13_38.15: ref %empty_tuple.type = array_index file.%c.var, %.loc13_38.14
|
||||
// CHECK:STDOUT: %.loc13_36.2: init %empty_tuple.type = tuple_init () to %.loc13_38.15 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.16: init %empty_tuple.type = converted %.loc13_36.1, %.loc13_36.2 [template = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc13_38.17: init %.12 = array_init (%.loc13_38.4, %.loc13_38.7, %.loc13_38.10, %.loc13_38.13, %.loc13_38.16) to file.%c.var [template = constants.%array.3]
|
||||
// CHECK:STDOUT: %.loc13_39: init %.12 = converted %.loc13_38.1, %.loc13_38.17 [template = constants.%array.3]
|
||||
// CHECK:STDOUT: %.loc13_38.17: init %.42 = array_init (%.loc13_38.4, %.loc13_38.7, %.loc13_38.10, %.loc13_38.13, %.loc13_38.16) to file.%c.var [template = constants.%array.3]
|
||||
// CHECK:STDOUT: %.loc13_39: init %.42 = converted %.loc13_38.1, %.loc13_38.17 [template = constants.%array.3]
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc13_39
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+115
-40
@@ -9,9 +9,11 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/canonicalize_index.carbon
|
||||
|
||||
fn Add(a: i32, b: i32) -> i32 = "int.sadd";
|
||||
fn ConvertToU32(a: i32) -> u32 = "int.convert_checked";
|
||||
|
||||
var a: [i32; Add(1, 2)] = (1, 2, 3);
|
||||
let b: [i32; 3]* = &a;
|
||||
let c: [i32; ConvertToU32(3)]* = &a;
|
||||
|
||||
// CHECK:STDOUT: --- canonicalize_index.carbon
|
||||
// CHECK:STDOUT:
|
||||
@@ -20,19 +22,39 @@ let b: [i32; 3]* = &a;
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Add.type: type = fn_type @Add [template]
|
||||
// CHECK:STDOUT: %Add: %Add.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: %.5: type = ptr_type %.4 [template]
|
||||
// CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template]
|
||||
// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template]
|
||||
// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.2: type = int_type unsigned, %.1 [template]
|
||||
// CHECK:STDOUT: %ConvertToU32.type: type = fn_type @ConvertToU32 [template]
|
||||
// CHECK:STDOUT: %ConvertToU32: %ConvertToU32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 3 [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: %.29: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.30: <bound method> = bound_method %.5, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.31: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.32: type = array_type %.31, i32 [template]
|
||||
// CHECK:STDOUT: %.33: type = ptr_type %.32 [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: %.34: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.32 = tuple_value (%.3, %.4, %.5) [template]
|
||||
// CHECK:STDOUT: %.35: %.2 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.5, @impl.6(%.1) [template]
|
||||
// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.37: <witness> = interface_witness (%Convert.16) [template]
|
||||
// CHECK:STDOUT: %.38: <bound method> = bound_method %.35, %Convert.16 [template]
|
||||
// CHECK:STDOUT: %.39: <specific function> = specific_function %.38, @Convert.5(%.1) [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: .UInt = %import_ref.2
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.3
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -42,8 +64,10 @@ let b: [i32; 3]* = &a;
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Add = %Add.decl
|
||||
// CHECK:STDOUT: .ConvertToU32 = %ConvertToU32.decl
|
||||
// CHECK:STDOUT: .a = %a
|
||||
// CHECK:STDOUT: .b = @__global_init.%b
|
||||
// CHECK:STDOUT: .c = @__global_init.%c
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] {
|
||||
@@ -70,47 +94,98 @@ let b: [i32; 3]* = &a;
|
||||
// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2
|
||||
// CHECK:STDOUT: %return: ref i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add]
|
||||
// CHECK:STDOUT: %.loc13_18: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_21: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc13_18, %.loc13_21) [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc13_9.1: type = value_of_initializer %int.make_type_32.loc13 [template = i32]
|
||||
// CHECK:STDOUT: %.loc13_9.2: type = converted %int.make_type_32.loc13, %.loc13_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc13_23: type = array_type %int.sadd, i32 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %a.var: ref %.4 = var a
|
||||
// CHECK:STDOUT: %a: ref %.4 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %ConvertToU32.decl: %ConvertToU32.type = fn_decl @ConvertToU32 [template = constants.%ConvertToU32] {
|
||||
// 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: %.2 = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: %.2 = out_param_pattern %return.patt, runtime_param1
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_32, %.loc12_20.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_28.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %int.make_type_unsigned: init type = call constants.%UInt(%.loc12_28.1) [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc12_28.2: type = value_of_initializer %int.make_type_unsigned [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc12_28.3: type = converted %int.make_type_unsigned, %.loc12_28.2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.param: i32 = value_param runtime_param0
|
||||
// CHECK:STDOUT: %a: i32 = bind_name a, %a.param
|
||||
// CHECK:STDOUT: %return.param: ref %.2 = out_param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref %.2 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_14: i32 = int_value 3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add]
|
||||
// CHECK:STDOUT: %.loc14_18: i32 = int_value 1 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc14_21: i32 = int_value 2 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc14_18, %.loc14_21) [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32.loc14, %.loc14_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_15: type = array_type %.loc14_14, i32 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_16: type = ptr_type %.4 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_17.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc14_17.2: <bound method> = bound_method %int.sadd, %.loc14_17.1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc14_17.3: i32 = value_of_initializer %int.sadd [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_17.4: i32 = converted %int.sadd, %.loc14_17.3 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc14: init Core.IntLiteral = call %.loc14_17.2(%.loc14_17.4) [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc14_17.5: Core.IntLiteral = value_of_initializer %int.convert_checked.loc14 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc14_17.6: Core.IntLiteral = converted %int.sadd, %.loc14_17.5 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc14_23: type = array_type %.loc14_17.6, i32 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %a.var: ref %.32 = var a
|
||||
// CHECK:STDOUT: %a: ref %.32 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_14.1: i32 = int_value 3 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_9.2: type = converted %int.make_type_32.loc15, %.loc15_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_14.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc15_14.3: <bound method> = bound_method %.loc15_14.1, %.loc15_14.2 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc15: init Core.IntLiteral = call %.loc15_14.3(%.loc15_14.1) [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc15_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc15 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc15_14.5: Core.IntLiteral = converted %.loc15_14.1, %.loc15_14.4 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc15_15: type = array_type %.loc15_14.5, i32 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc15_16: type = ptr_type %.32 [template = constants.%.33]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %ConvertToU32.ref: %ConvertToU32.type = name_ref ConvertToU32, %ConvertToU32.decl [template = constants.%ConvertToU32]
|
||||
// CHECK:STDOUT: %.loc16_27: i32 = int_value 3 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc16_26.1: init %.2 = call %ConvertToU32.ref(%.loc16_27) [template = constants.%.35]
|
||||
// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32]
|
||||
// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32.loc16, %.loc16_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc16_26.1: %Convert.type.2 = interface_witness_access constants.%.37, element0 [template = constants.%Convert.16]
|
||||
// CHECK:STDOUT: %.loc16_26.2: <bound method> = bound_method %int.convert_checked.loc16_26.1, %.loc16_26.1 [template = constants.%.38]
|
||||
// CHECK:STDOUT: %.loc16_26.3: <specific function> = specific_function %.loc16_26.2, @Convert.5(constants.%.1) [template = constants.%.39]
|
||||
// CHECK:STDOUT: %.loc16_26.4: %.2 = value_of_initializer %int.convert_checked.loc16_26.1 [template = constants.%.35]
|
||||
// CHECK:STDOUT: %.loc16_26.5: %.2 = converted %int.convert_checked.loc16_26.1, %.loc16_26.4 [template = constants.%.35]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc16_26.2: init Core.IntLiteral = call %.loc16_26.3(%.loc16_26.5) [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc16_26.6: Core.IntLiteral = value_of_initializer %int.convert_checked.loc16_26.2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc16_26.7: Core.IntLiteral = converted %int.convert_checked.loc16_26.1, %.loc16_26.6 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc16_29: type = array_type %.loc16_26.7, i32 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc16_30: type = ptr_type %.32 [template = constants.%.33]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ConvertToU32(%a.param_patt: i32) -> %.2 = "int.convert_checked";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc13_28: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_31: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc13_34: i32 = int_value 3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc13_35.1: %tuple.type = tuple_literal (%.loc13_28, %.loc13_31, %.loc13_34)
|
||||
// CHECK:STDOUT: %.loc13_35.2: i32 = int_value 0 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc13_35.3: ref i32 = array_index file.%a.var, %.loc13_35.2
|
||||
// CHECK:STDOUT: %.loc13_35.4: init i32 = initialize_from %.loc13_28 to %.loc13_35.3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_35.5: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_35.6: ref i32 = array_index file.%a.var, %.loc13_35.5
|
||||
// CHECK:STDOUT: %.loc13_35.7: init i32 = initialize_from %.loc13_31 to %.loc13_35.6 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc13_35.8: i32 = int_value 2 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc13_35.9: ref i32 = array_index file.%a.var, %.loc13_35.8
|
||||
// CHECK:STDOUT: %.loc13_35.10: init i32 = initialize_from %.loc13_34 to %.loc13_35.9 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc13_35.11: init %.4 = array_init (%.loc13_35.4, %.loc13_35.7, %.loc13_35.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc13_36: init %.4 = converted %.loc13_35.1, %.loc13_35.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc13_36
|
||||
// CHECK:STDOUT: %a.ref: ref %.4 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc14: %.5 = addr_of %a.ref
|
||||
// CHECK:STDOUT: %b: %.5 = bind_name b, %.loc14
|
||||
// CHECK:STDOUT: %.loc14_28: i32 = int_value 1 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc14_31: i32 = int_value 2 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_34: i32 = int_value 3 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_35.1: %tuple.type = tuple_literal (%.loc14_28, %.loc14_31, %.loc14_34)
|
||||
// CHECK:STDOUT: %.loc14_35.2: i32 = int_value 0 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc14_35.3: ref i32 = array_index file.%a.var, %.loc14_35.2
|
||||
// CHECK:STDOUT: %.loc14_35.4: init i32 = initialize_from %.loc14_28 to %.loc14_35.3 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc14_35.5: i32 = int_value 1 [template = constants.%.3]
|
||||
// CHECK:STDOUT: %.loc14_35.6: ref i32 = array_index file.%a.var, %.loc14_35.5
|
||||
// CHECK:STDOUT: %.loc14_35.7: init i32 = initialize_from %.loc14_31 to %.loc14_35.6 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_35.8: i32 = int_value 2 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_35.9: ref i32 = array_index file.%a.var, %.loc14_35.8
|
||||
// CHECK:STDOUT: %.loc14_35.10: init i32 = initialize_from %.loc14_34 to %.loc14_35.9 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_35.11: init %.32 = array_init (%.loc14_35.4, %.loc14_35.7, %.loc14_35.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc14_36: init %.32 = converted %.loc14_35.1, %.loc14_35.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc14_36
|
||||
// CHECK:STDOUT: %a.ref.loc15: ref %.32 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc15: %.33 = addr_of %a.ref.loc15
|
||||
// CHECK:STDOUT: %b: %.33 = bind_name b, %.loc15
|
||||
// CHECK:STDOUT: %a.ref.loc16: ref %.32 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc16: %.33 = addr_of %a.ref.loc16
|
||||
// CHECK:STDOUT: %c: %.33 = bind_name c, %.loc16
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+16
-2
@@ -24,11 +24,18 @@ var a: [i32; Negate(1)];
|
||||
// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.2: i32 = int_value -1 [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: %.26: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.27: <bound method> = bound_method %.2, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.28: Core.IntLiteral = int_value -1 [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: }
|
||||
@@ -64,7 +71,14 @@ var a: [i32; Negate(1)];
|
||||
// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc16_21) [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc16_9.2: type = converted %int.make_type_32, %.loc16_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc16_23: type = array_type %int.snegate, i32 [template = <error>]
|
||||
// CHECK:STDOUT: %.loc16_20.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc16_20.2: <bound method> = bound_method %int.snegate, %.loc16_20.1 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc16_20.3: i32 = value_of_initializer %int.snegate [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc16_20.4: i32 = converted %int.snegate, %.loc16_20.3 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc16_20.2(%.loc16_20.4) [template = constants.%.28]
|
||||
// CHECK:STDOUT: %.loc16_20.5: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.28]
|
||||
// CHECK:STDOUT: %.loc16_20.6: Core.IntLiteral = converted %int.snegate, %.loc16_20.5 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %.loc16_23: type = array_type %.loc16_20.6, i32 [template = <error>]
|
||||
// CHECK:STDOUT: %a.var: ref <error> = var a
|
||||
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -25,13 +25,20 @@ var p: Incomplete* = &a[0];
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, %Incomplete [template]
|
||||
// CHECK:STDOUT: %.3: type = ptr_type %Incomplete [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 0 [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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, %Incomplete [template]
|
||||
// CHECK:STDOUT: %.29: type = ptr_type %Incomplete [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.1
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -47,14 +54,19 @@ var p: Incomplete* = &a[0];
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {}
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %.loc19_21: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc19_22: type = array_type %.loc19_21, %Incomplete [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc19_21.1: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc19_21.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc19_21.3: <bound method> = bound_method %.loc19_21.1, %.loc19_21.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc19_21.3(%.loc19_21.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc19_21.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc19_21.5: Core.IntLiteral = converted %.loc19_21.1, %.loc19_21.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc19_22: type = array_type %.loc19_21.5, %Incomplete [template = constants.%.28]
|
||||
// CHECK:STDOUT: %a.var: ref <error> = var a
|
||||
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc21: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %.loc21: type = ptr_type %Incomplete [template = constants.%.3]
|
||||
// CHECK:STDOUT: %p.var: ref %.3 = var p
|
||||
// CHECK:STDOUT: %p: ref %.3 = bind_name p, %p.var
|
||||
// CHECK:STDOUT: %.loc21: type = ptr_type %Incomplete [template = constants.%.29]
|
||||
// CHECK:STDOUT: %p.var: ref %.29 = var p
|
||||
// CHECK:STDOUT: %p: ref %.29 = bind_name p, %p.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @Incomplete;
|
||||
@@ -62,7 +74,7 @@ var p: Incomplete* = &a[0];
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.ref: ref <error> = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc21_25: i32 = int_value 0 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc21_25: i32 = int_value 0 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc21_22: <error> = addr_of <error> [template = <error>]
|
||||
// CHECK:STDOUT: assign file.%p.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
+13
-2
@@ -20,6 +20,12 @@ var a: [1; 1];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
|
||||
// CHECK:STDOUT: %Convert.type.16: type = fn_type @Convert.11 [template]
|
||||
// CHECK:STDOUT: %Convert.16: %Convert.type.16 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.27: <witness> = interface_witness (%Convert.16) [template]
|
||||
// CHECK:STDOUT: %.28: <bound method> = bound_method %.1, %Convert.16 [template]
|
||||
// CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -37,9 +43,14 @@ var a: [1; 1];
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %.loc17_9.1: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc17_12: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc17_12.1: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc17_9.2: type = converted %.loc17_9.1, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %.loc17_13: type = array_type %.loc17_12, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %.loc17_12.2: %Convert.type.6 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.16]
|
||||
// CHECK:STDOUT: %.loc17_12.3: <bound method> = bound_method %.loc17_12.1, %.loc17_12.2 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc17_12.3(%.loc17_12.1) [template = constants.%.29]
|
||||
// CHECK:STDOUT: %.loc17_12.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.29]
|
||||
// CHECK:STDOUT: %.loc17_12.5: Core.IntLiteral = converted %.loc17_12.1, %.loc17_12.4 [template = constants.%.29]
|
||||
// CHECK:STDOUT: %.loc17_13: type = array_type %.loc17_12.5, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %a.var: ref <error> = var a
|
||||
// CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+22
-10
@@ -19,15 +19,22 @@ var a: [i32; 1] = (1, 2, 3);
|
||||
// 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: type = array_type %.1, i32 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 3 [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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.31: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, 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: }
|
||||
@@ -40,19 +47,24 @@ var a: [i32; 1] = (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: %.loc14_14: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc14_14.1: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_9.2: type = converted %int.make_type_32, %.loc14_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc14_15: type = array_type %.loc14_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.var: ref %.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc14_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc14_14.3: <bound method> = bound_method %.loc14_14.1, %.loc14_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc14_14.3(%.loc14_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc14_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc14_14.5: Core.IntLiteral = converted %.loc14_14.1, %.loc14_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc14_15: type = array_type %.loc14_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %a.var: ref %.28 = var a
|
||||
// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc14_20: i32 = int_value 1 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc14_23: i32 = int_value 2 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc14_26: i32 = int_value 3 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc14_23: i32 = int_value 2 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc14_26: i32 = int_value 3 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc14_27: %tuple.type = tuple_literal (%.loc14_20, %.loc14_23, %.loc14_26)
|
||||
// CHECK:STDOUT: assign file.%a.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
@@ -20,19 +20,26 @@ var b: i32 = a[{.index = 3}.index];
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 2 [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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.31: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template]
|
||||
// CHECK:STDOUT: %.7: type = struct_type {.index: i32} [template]
|
||||
// CHECK:STDOUT: %struct: %.7 = struct_value (%.1) [template]
|
||||
// CHECK:STDOUT: %.32: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [template]
|
||||
// CHECK:STDOUT: %.33: type = struct_type {.index: i32} [template]
|
||||
// CHECK:STDOUT: %struct: %.33 = struct_value (%.1) [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: }
|
||||
@@ -46,12 +53,17 @@ var b: i32 = a[{.index = 3}.index];
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_14: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.var: ref %.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc11_14.3: <bound method> = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %a.var: ref %.28 = var a
|
||||
// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
|
||||
// CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32]
|
||||
@@ -61,27 +73,27 @@ var b: i32 = a[{.index = 3}.index];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_26: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26)
|
||||
// CHECK:STDOUT: %.loc11_27.2: i32 = int_value 0 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc11_27.2: i32 = int_value 0 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc11_27.3: ref i32 = array_index file.%a.var, %.loc11_27.2
|
||||
// CHECK:STDOUT: %.loc11_27.4: init i32 = initialize_from %.loc11_20 to %.loc11_27.3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_27.4: init i32 = initialize_from %.loc11_20 to %.loc11_27.3 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_27.6: ref i32 = array_index file.%a.var, %.loc11_27.5
|
||||
// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_23 to %.loc11_27.6 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_27.8: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_23 to %.loc11_27.6 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_27.8: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_27.9: ref i32 = array_index file.%a.var, %.loc11_27.8
|
||||
// CHECK:STDOUT: %.loc11_27.10: init i32 = initialize_from %.loc11_26 to %.loc11_27.9 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_27.11: init %.2 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_27.11: init %.28 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_28: init %.28 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_28
|
||||
// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %a.ref: ref %.28 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc15_26: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc15_27.1: %.7 = struct_literal (%.loc15_26)
|
||||
// CHECK:STDOUT: %struct: %.7 = struct_value (%.loc15_26) [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc15_27.2: %.7 = converted %.loc15_27.1, %struct [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc15_27.1: %.33 = struct_literal (%.loc15_26)
|
||||
// CHECK:STDOUT: %struct: %.33 = struct_value (%.loc15_26) [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc15_27.2: %.33 = converted %.loc15_27.1, %struct [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc15_28: i32 = struct_access %.loc15_27.2, element0 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc15_34.1: ref i32 = array_index %a.ref, %.loc15_28 [template = <error>]
|
||||
// CHECK:STDOUT: %.loc15_34.2: i32 = bind_value %.loc15_34.1
|
||||
|
||||
+56
-30
@@ -45,14 +45,20 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.6: String = string_literal "Hello" [template]
|
||||
// CHECK:STDOUT: %.7: String = string_literal "World" [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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.32: String = string_literal "Hello" [template]
|
||||
// CHECK:STDOUT: %.33: String = string_literal "World" [template]
|
||||
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32, String, String) [template]
|
||||
// CHECK:STDOUT: %.8: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %.34: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %tuple.type.2: type = tuple_type (type, type, type) [template]
|
||||
// CHECK:STDOUT: %.33: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.36: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %tuple.type.4: type = tuple_type (i32, i32) [template]
|
||||
// CHECK:STDOUT: %tuple.type.5: type = tuple_type (type, type) [template]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -78,12 +84,17 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc18_14: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc18_14.1: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32]
|
||||
// CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32.loc18, %.loc18_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc18_15: type = array_type %.loc18_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.var: ref %.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc18_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc18_14.3: <bound method> = bound_method %.loc18_14.1, %.loc18_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc18: init Core.IntLiteral = call %.loc18_14.3(%.loc18_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc18_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc18 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc18_14.5: Core.IntLiteral = converted %.loc18_14.1, %.loc18_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc18_15: type = array_type %.loc18_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %a.var: ref %.28 = var a
|
||||
// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc20: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc20_29.1: %tuple.type.2 = tuple_literal (%int.make_type_32.loc20, String, String)
|
||||
// CHECK:STDOUT: %.loc20_29.2: type = value_of_initializer %int.make_type_32.loc20 [template = i32]
|
||||
@@ -92,19 +103,29 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: %t1.var: ref %tuple.type.1 = var t1
|
||||
// CHECK:STDOUT: %t1: ref %tuple.type.1 = bind_name t1, %t1.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc28_14: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc28_14.1: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc28_9.1: type = value_of_initializer %int.make_type_32.loc28 [template = i32]
|
||||
// CHECK:STDOUT: %.loc28_9.2: type = converted %int.make_type_32.loc28, %.loc28_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc28_15: type = array_type %.loc28_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %b.var: ref %.2 = var b
|
||||
// CHECK:STDOUT: %b: ref %.2 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %.loc28_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc28_14.3: <bound method> = bound_method %.loc28_14.1, %.loc28_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc28: init Core.IntLiteral = call %.loc28_14.3(%.loc28_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc28_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc28 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc28_14.5: Core.IntLiteral = converted %.loc28_14.1, %.loc28_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc28_15: type = array_type %.loc28_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %b.var: ref %.28 = var b
|
||||
// CHECK:STDOUT: %b: ref %.28 = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc34_14: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc34_14.1: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc34_9.1: type = value_of_initializer %int.make_type_32.loc34 [template = i32]
|
||||
// CHECK:STDOUT: %.loc34_9.2: type = converted %int.make_type_32.loc34, %.loc34_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc34_15: type = array_type %.loc34_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %c.var: ref %.2 = var c
|
||||
// CHECK:STDOUT: %c: ref %.2 = bind_name c, %c.var
|
||||
// CHECK:STDOUT: %.loc34_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc34_14.3: <bound method> = bound_method %.loc34_14.1, %.loc34_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc34: init Core.IntLiteral = call %.loc34_14.3(%.loc34_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc34_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc34 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc34_14.5: Core.IntLiteral = converted %.loc34_14.1, %.loc34_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc34_15: type = array_type %.loc34_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %c.var: ref %.28 = var c
|
||||
// CHECK:STDOUT: %c: ref %.28 = bind_name c, %c.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc36_10: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc36_15: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc36_18.1: %tuple.type.5 = tuple_literal (%int.make_type_32.loc36_10, %int.make_type_32.loc36_15)
|
||||
@@ -116,36 +137,41 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: %t2.var: ref %tuple.type.4 = var t2
|
||||
// CHECK:STDOUT: %t2: ref %tuple.type.4 = bind_name t2, %t2.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc40: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc40_14: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc40_14.1: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc40_9.1: type = value_of_initializer %int.make_type_32.loc40 [template = i32]
|
||||
// CHECK:STDOUT: %.loc40_9.2: type = converted %int.make_type_32.loc40, %.loc40_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc40_15: type = array_type %.loc40_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %d.var: ref %.2 = var d
|
||||
// CHECK:STDOUT: %d: ref %.2 = bind_name d, %d.var
|
||||
// CHECK:STDOUT: %.loc40_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc40_14.3: <bound method> = bound_method %.loc40_14.1, %.loc40_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc40: init Core.IntLiteral = call %.loc40_14.3(%.loc40_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc40_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked.loc40 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc40_14.5: Core.IntLiteral = converted %.loc40_14.1, %.loc40_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc40_15: type = array_type %.loc40_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %d.var: ref %.28 = var d
|
||||
// CHECK:STDOUT: %d: ref %.28 = bind_name d, %d.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc18_20: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc18_23: String = string_literal "Hello" [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc18_32: String = string_literal "World" [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc18_20: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc18_23: String = string_literal "Hello" [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc18_32: String = string_literal "World" [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc18_39.1: %tuple.type.1 = tuple_literal (%.loc18_20, %.loc18_23, %.loc18_32)
|
||||
// CHECK:STDOUT: %.loc18_39.2: i32 = int_value 0 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc18_39.2: i32 = int_value 0 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc18_39.3: ref i32 = array_index file.%a.var, %.loc18_39.2
|
||||
// CHECK:STDOUT: %.loc18_39.4: init i32 = initialize_from %.loc18_20 to %.loc18_39.3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc18_39.4: init i32 = initialize_from %.loc18_20 to %.loc18_39.3 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc18_39.5: i32 = converted %.loc18_23, <error> [template = <error>]
|
||||
// CHECK:STDOUT: assign file.%a.var, <error>
|
||||
// CHECK:STDOUT: %t1.ref: ref %tuple.type.1 = name_ref t1, file.%t1
|
||||
// CHECK:STDOUT: %.loc28_19.1: ref i32 = tuple_access %t1.ref, element0
|
||||
// CHECK:STDOUT: %.loc28_19.2: i32 = bind_value %.loc28_19.1
|
||||
// CHECK:STDOUT: %.loc28_19.3: i32 = int_value 0 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc28_19.3: i32 = int_value 0 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc28_19.4: ref i32 = array_index file.%b.var, %.loc28_19.3
|
||||
// CHECK:STDOUT: %.loc28_19.5: init i32 = initialize_from %.loc28_19.2 to %.loc28_19.4
|
||||
// CHECK:STDOUT: %.loc28_19.6: ref String = tuple_access %t1.ref, element1
|
||||
// CHECK:STDOUT: %.loc28_19.7: i32 = converted %.loc28_19.6, <error> [template = <error>]
|
||||
// CHECK:STDOUT: assign file.%b.var, <error>
|
||||
// CHECK:STDOUT: %.loc34_20: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc34_23: i32 = int_value 2 [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc34_20: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc34_23: i32 = int_value 2 [template = constants.%.36]
|
||||
// CHECK:STDOUT: %.loc34_24: %tuple.type.4 = tuple_literal (%.loc34_20, %.loc34_23)
|
||||
// CHECK:STDOUT: assign file.%c.var, <error>
|
||||
// CHECK:STDOUT: %t2.ref: ref %tuple.type.4 = name_ref t2, file.%t2
|
||||
|
||||
+40
-28
@@ -22,21 +22,28 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, 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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.31: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template]
|
||||
// CHECK:STDOUT: %.32: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [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: }
|
||||
@@ -50,26 +57,31 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
||||
// CHECK:STDOUT: %arr.patt: %.2 = binding_pattern arr
|
||||
// CHECK:STDOUT: %arr.param_patt: %.2 = value_param_pattern %arr.patt, runtime_param0
|
||||
// CHECK:STDOUT: %arr.patt: %.28 = binding_pattern arr
|
||||
// CHECK:STDOUT: %arr.param_patt: %.28 = value_param_pattern %arr.patt, runtime_param0
|
||||
// CHECK:STDOUT: %i.patt: i32 = binding_pattern i
|
||||
// CHECK:STDOUT: %i.param_patt: i32 = value_param_pattern %i.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: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_17: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_17.1: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_12.2: type = converted %int.make_type_32.loc11_12, %.loc11_12.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %.loc11_17.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc11_17.3: <bound method> = bound_method %.loc11_17.1, %.loc11_17.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_17.3(%.loc11_17.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_17.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_17.5: Core.IntLiteral = converted %.loc11_17.1, %.loc11_17.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_18: type = array_type %.loc11_17.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_24: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_24.1: type = value_of_initializer %int.make_type_32.loc11_24 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_24.2: type = converted %int.make_type_32.loc11_24, %.loc11_24.1 [template = i32]
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_32.1: type = value_of_initializer %int.make_type_32.loc11_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_32.loc11_32, %.loc11_32.1 [template = i32]
|
||||
// CHECK:STDOUT: %arr.param: %.2 = value_param runtime_param0
|
||||
// CHECK:STDOUT: %arr: %.2 = bind_name arr, %arr.param
|
||||
// CHECK:STDOUT: %arr.param: %.28 = value_param runtime_param0
|
||||
// CHECK:STDOUT: %arr: %.28 = bind_name arr, %arr.param
|
||||
// CHECK:STDOUT: %i.param: i32 = value_param runtime_param1
|
||||
// CHECK:STDOUT: %i: i32 = bind_name i, %i.param
|
||||
// CHECK:STDOUT: %return.param: ref i32 = out_param runtime_param2
|
||||
@@ -87,11 +99,11 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%arr.param_patt: %.2, %i.param_patt: i32) -> i32 {
|
||||
// CHECK:STDOUT: fn @F(%arr.param_patt: %.28, %i.param_patt: i32) -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %arr.ref: %.2 = name_ref arr, %arr
|
||||
// CHECK:STDOUT: %arr.ref: %.28 = name_ref arr, %arr
|
||||
// CHECK:STDOUT: %i.ref: i32 = name_ref i, %i
|
||||
// CHECK:STDOUT: %.loc12_15.1: ref %.2 = value_as_ref %arr.ref
|
||||
// CHECK:STDOUT: %.loc12_15.1: ref %.28 = value_as_ref %arr.ref
|
||||
// CHECK:STDOUT: %.loc12_15.2: ref i32 = array_index %.loc12_15.1, %i.ref
|
||||
// CHECK:STDOUT: %.loc12_15.3: i32 = bind_value %.loc12_15.2
|
||||
// CHECK:STDOUT: return %.loc12_15.3
|
||||
@@ -100,25 +112,25 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: fn @G() -> i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
||||
// CHECK:STDOUT: %.loc16_13: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc16_16: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc16_13: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc16_16: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc16_19: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc16_20.1: %tuple.type = tuple_literal (%.loc16_13, %.loc16_16, %.loc16_19)
|
||||
// CHECK:STDOUT: %.loc16_23: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc16_20.2: ref %.2 = temporary_storage
|
||||
// CHECK:STDOUT: %.loc16_20.3: i32 = int_value 0 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc16_23: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc16_20.2: ref %.28 = temporary_storage
|
||||
// CHECK:STDOUT: %.loc16_20.3: i32 = int_value 0 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc16_20.4: ref i32 = array_index %.loc16_20.2, %.loc16_20.3
|
||||
// CHECK:STDOUT: %.loc16_20.5: init i32 = initialize_from %.loc16_13 to %.loc16_20.4 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc16_20.6: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc16_20.5: init i32 = initialize_from %.loc16_13 to %.loc16_20.4 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc16_20.6: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc16_20.7: ref i32 = array_index %.loc16_20.2, %.loc16_20.6
|
||||
// CHECK:STDOUT: %.loc16_20.8: init i32 = initialize_from %.loc16_16 to %.loc16_20.7 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc16_20.9: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc16_20.8: init i32 = initialize_from %.loc16_16 to %.loc16_20.7 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc16_20.9: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc16_20.10: ref i32 = array_index %.loc16_20.2, %.loc16_20.9
|
||||
// CHECK:STDOUT: %.loc16_20.11: init i32 = initialize_from %.loc16_19 to %.loc16_20.10 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc16_20.12: init %.2 = array_init (%.loc16_20.5, %.loc16_20.8, %.loc16_20.11) to %.loc16_20.2 [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc16_20.13: init %.2 = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc16_20.14: ref %.2 = temporary %.loc16_20.2, %.loc16_20.13
|
||||
// CHECK:STDOUT: %.loc16_20.15: %.2 = bind_value %.loc16_20.14
|
||||
// CHECK:STDOUT: %.loc16_20.12: init %.28 = array_init (%.loc16_20.5, %.loc16_20.8, %.loc16_20.11) to %.loc16_20.2 [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc16_20.13: init %.28 = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc16_20.14: ref %.28 = temporary %.loc16_20.2, %.loc16_20.13
|
||||
// CHECK:STDOUT: %.loc16_20.15: %.28 = bind_value %.loc16_20.14
|
||||
// CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc16_20.15, %.loc16_23)
|
||||
// CHECK:STDOUT: %.loc16_25.1: i32 = value_of_initializer %F.call
|
||||
// CHECK:STDOUT: %.loc16_25.2: i32 = converted %F.call, %.loc16_25.1
|
||||
|
||||
+22
-10
@@ -22,12 +22,19 @@ fn G(T:! type) {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, %T [symbolic]
|
||||
// CHECK:STDOUT: %array: %.2 = tuple_value () [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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 0 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, %T [symbolic]
|
||||
// CHECK:STDOUT: %array: %.28 = tuple_value () [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %import_ref.1
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
@@ -53,19 +60,24 @@ fn G(T:! type) {
|
||||
// CHECK:STDOUT: %T.patt.loc11_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc11_6.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %.loc13_17.2: type = array_type constants.%.1, @G.%T.loc11_6.2 (%T) [symbolic = %.loc13_17.2 (constants.%.2)]
|
||||
// CHECK:STDOUT: %array: @G.%.loc13_17.2 (%.2) = tuple_value () [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: %.loc13_17.2: type = array_type constants.%.27, @G.%T.loc11_6.2 (%T) [symbolic = %.loc13_17.2 (constants.%.28)]
|
||||
// CHECK:STDOUT: %array: @G.%.loc13_17.2 (%.28) = tuple_value () [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%T.param_patt: type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc11_6.1 [symbolic = %T.loc11_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc13_16: i32 = int_value 0 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_17.1: type = array_type %.loc13_16, %T [symbolic = %.loc13_17.2 (constants.%.2)]
|
||||
// CHECK:STDOUT: %arr.var: ref @G.%.loc13_17.2 (%.2) = var arr
|
||||
// CHECK:STDOUT: %arr: ref @G.%.loc13_17.2 (%.2) = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: %.loc13_16.1: i32 = int_value 0 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc13_16.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc13_16.3: <bound method> = bound_method %.loc13_16.1, %.loc13_16.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc13_16.3(%.loc13_16.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc13_16.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc13_16.5: Core.IntLiteral = converted %.loc13_16.1, %.loc13_16.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc13_17.1: type = array_type %.loc13_16.5, %T [symbolic = %.loc13_17.2 (constants.%.28)]
|
||||
// CHECK:STDOUT: %arr.var: ref @G.%.loc13_17.2 (%.28) = var arr
|
||||
// CHECK:STDOUT: %arr: ref @G.%.loc13_17.2 (%.28) = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: %.loc13_22.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc13_22.2: init @G.%.loc13_17.2 (%.2) = array_init () to %arr.var [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: %.loc13_23: init @G.%.loc13_17.2 (%.2) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: %.loc13_22.2: init @G.%.loc13_17.2 (%.28) = array_init () to %arr.var [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: %.loc13_23: init @G.%.loc13_17.2 (%.28) = converted %.loc13_22.1, %.loc13_22.2 [symbolic = %array (constants.%array)]
|
||||
// CHECK:STDOUT: assign %arr.var, %.loc13_23
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+39
-27
@@ -17,19 +17,26 @@ var b: i32 = a[{.index = 2}.index];
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 2 [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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.31: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.1) [template]
|
||||
// CHECK:STDOUT: %.7: type = struct_type {.index: i32} [template]
|
||||
// CHECK:STDOUT: %struct: %.7 = struct_value (%.5) [template]
|
||||
// CHECK:STDOUT: %.32: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.1) [template]
|
||||
// CHECK:STDOUT: %.33: type = struct_type {.index: i32} [template]
|
||||
// CHECK:STDOUT: %struct: %.33 = struct_value (%.31) [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: }
|
||||
@@ -43,12 +50,17 @@ var b: i32 = a[{.index = 2}.index];
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_14: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32.loc11, %.loc11_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.var: ref %.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc11_14.3: <bound method> = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %a.var: ref %.28 = var a
|
||||
// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_8.1: type = value_of_initializer %int.make_type_32.loc12 [template = i32]
|
||||
// CHECK:STDOUT: %.loc12_8.2: type = converted %int.make_type_32.loc12, %.loc12_8.1 [template = i32]
|
||||
@@ -58,28 +70,28 @@ var b: i32 = a[{.index = 2}.index];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_26: i32 = int_value 3 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26)
|
||||
// CHECK:STDOUT: %.loc11_27.2: i32 = int_value 0 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc11_27.2: i32 = int_value 0 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc11_27.3: ref i32 = array_index file.%a.var, %.loc11_27.2
|
||||
// CHECK:STDOUT: %.loc11_27.4: init i32 = initialize_from %.loc11_20 to %.loc11_27.3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_27.4: init i32 = initialize_from %.loc11_20 to %.loc11_27.3 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_27.5: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_27.6: ref i32 = array_index file.%a.var, %.loc11_27.5
|
||||
// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_23 to %.loc11_27.6 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_27.8: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_27.7: init i32 = initialize_from %.loc11_23 to %.loc11_27.6 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_27.8: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_27.9: ref i32 = array_index file.%a.var, %.loc11_27.8
|
||||
// CHECK:STDOUT: %.loc11_27.10: init i32 = initialize_from %.loc11_26 to %.loc11_27.9 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_27.11: init %.2 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_28: init %.2 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_27.11: init %.28 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_28: init %.28 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_28
|
||||
// CHECK:STDOUT: %a.ref: ref %.2 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc12_26: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc12_27.1: %.7 = struct_literal (%.loc12_26)
|
||||
// CHECK:STDOUT: %struct: %.7 = struct_value (%.loc12_26) [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc12_27.2: %.7 = converted %.loc12_27.1, %struct [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc12_28: i32 = struct_access %.loc12_27.2, element0 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %a.ref: ref %.28 = name_ref a, file.%a
|
||||
// CHECK:STDOUT: %.loc12_26: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc12_27.1: %.33 = struct_literal (%.loc12_26)
|
||||
// CHECK:STDOUT: %struct: %.33 = struct_value (%.loc12_26) [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc12_27.2: %.33 = converted %.loc12_27.1, %struct [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc12_28: i32 = struct_access %.loc12_27.2, element0 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc12_34.1: ref i32 = array_index %a.ref, %.loc12_28
|
||||
// CHECK:STDOUT: %.loc12_34.2: i32 = bind_value %.loc12_34.1
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc12_34.2
|
||||
|
||||
+55
-43
@@ -16,23 +16,30 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: i32 = int_value 9 [template]
|
||||
// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.5: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.7: i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: %.8: i32 = int_value 5 [template]
|
||||
// CHECK:STDOUT: %.9: i32 = int_value 6 [template]
|
||||
// CHECK:STDOUT: %.10: i32 = int_value 7 [template]
|
||||
// CHECK:STDOUT: %.11: i32 = int_value 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: %.25: <witness> = interface_witness (%Convert.15) [template]
|
||||
// CHECK:STDOUT: %.26: <bound method> = bound_method %.1, %Convert.15 [template]
|
||||
// CHECK:STDOUT: %.27: Core.IntLiteral = int_value 9 [template]
|
||||
// CHECK:STDOUT: %.28: type = array_type %.27, i32 [template]
|
||||
// CHECK:STDOUT: %.30: i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %.31: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.32: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.33: i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: %.34: i32 = int_value 5 [template]
|
||||
// CHECK:STDOUT: %.35: i32 = int_value 6 [template]
|
||||
// CHECK:STDOUT: %.36: i32 = int_value 7 [template]
|
||||
// CHECK:STDOUT: %.37: i32 = int_value 8 [template]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32, i32, i32, i32, i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.12: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.2 = tuple_value (%.4, %.5, %.6, %.7, %.8, %.9, %.10, %.11, %.1) [template]
|
||||
// CHECK:STDOUT: %.38: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.28 = tuple_value (%.30, %.31, %.32, %.33, %.34, %.35, %.36, %.37, %.1) [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: }
|
||||
@@ -45,55 +52,60 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_14: i32 = int_value 9 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_14.1: i32 = int_value 9 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_9.2: type = converted %int.make_type_32, %.loc11_9.1 [template = i32]
|
||||
// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14, i32 [template = constants.%.2]
|
||||
// CHECK:STDOUT: %a.var: ref %.2 = var a
|
||||
// CHECK:STDOUT: %a: ref %.2 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc11_14.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.15]
|
||||
// CHECK:STDOUT: %.loc11_14.3: <bound method> = bound_method %.loc11_14.1, %.loc11_14.2 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %.loc11_14.3(%.loc11_14.1) [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_14.4: Core.IntLiteral = value_of_initializer %int.convert_checked [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_14.5: Core.IntLiteral = converted %.loc11_14.1, %.loc11_14.4 [template = constants.%.27]
|
||||
// CHECK:STDOUT: %.loc11_15: type = array_type %.loc11_14.5, i32 [template = constants.%.28]
|
||||
// CHECK:STDOUT: %a.var: ref %.28 = var a
|
||||
// CHECK:STDOUT: %a: ref %.28 = bind_name a, %a.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_26: i32 = int_value 3 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc11_29: i32 = int_value 4 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc11_32: i32 = int_value 5 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc11_35: i32 = int_value 6 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc11_38: i32 = int_value 7 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc11_41: i32 = int_value 8 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_23: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_26: i32 = int_value 3 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc11_29: i32 = int_value 4 [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc11_32: i32 = int_value 5 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc11_35: i32 = int_value 6 [template = constants.%.35]
|
||||
// CHECK:STDOUT: %.loc11_38: i32 = int_value 7 [template = constants.%.36]
|
||||
// CHECK:STDOUT: %.loc11_41: i32 = int_value 8 [template = constants.%.37]
|
||||
// CHECK:STDOUT: %.loc11_44: i32 = int_value 9 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_45.1: %tuple.type = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26, %.loc11_29, %.loc11_32, %.loc11_35, %.loc11_38, %.loc11_41, %.loc11_44)
|
||||
// CHECK:STDOUT: %.loc11_45.2: i32 = int_value 0 [template = constants.%.12]
|
||||
// CHECK:STDOUT: %.loc11_45.2: i32 = int_value 0 [template = constants.%.38]
|
||||
// CHECK:STDOUT: %.loc11_45.3: ref i32 = array_index file.%a.var, %.loc11_45.2
|
||||
// CHECK:STDOUT: %.loc11_45.4: init i32 = initialize_from %.loc11_20 to %.loc11_45.3 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_45.5: i32 = int_value 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc11_45.4: init i32 = initialize_from %.loc11_20 to %.loc11_45.3 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_45.5: i32 = int_value 1 [template = constants.%.30]
|
||||
// CHECK:STDOUT: %.loc11_45.6: ref i32 = array_index file.%a.var, %.loc11_45.5
|
||||
// CHECK:STDOUT: %.loc11_45.7: init i32 = initialize_from %.loc11_23 to %.loc11_45.6 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_45.8: i32 = int_value 2 [template = constants.%.5]
|
||||
// CHECK:STDOUT: %.loc11_45.7: init i32 = initialize_from %.loc11_23 to %.loc11_45.6 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_45.8: i32 = int_value 2 [template = constants.%.31]
|
||||
// CHECK:STDOUT: %.loc11_45.9: ref i32 = array_index file.%a.var, %.loc11_45.8
|
||||
// CHECK:STDOUT: %.loc11_45.10: init i32 = initialize_from %.loc11_26 to %.loc11_45.9 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc11_45.11: i32 = int_value 3 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc11_45.10: init i32 = initialize_from %.loc11_26 to %.loc11_45.9 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc11_45.11: i32 = int_value 3 [template = constants.%.32]
|
||||
// CHECK:STDOUT: %.loc11_45.12: ref i32 = array_index file.%a.var, %.loc11_45.11
|
||||
// CHECK:STDOUT: %.loc11_45.13: init i32 = initialize_from %.loc11_29 to %.loc11_45.12 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc11_45.14: i32 = int_value 4 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc11_45.13: init i32 = initialize_from %.loc11_29 to %.loc11_45.12 [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc11_45.14: i32 = int_value 4 [template = constants.%.33]
|
||||
// CHECK:STDOUT: %.loc11_45.15: ref i32 = array_index file.%a.var, %.loc11_45.14
|
||||
// CHECK:STDOUT: %.loc11_45.16: init i32 = initialize_from %.loc11_32 to %.loc11_45.15 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc11_45.17: i32 = int_value 5 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc11_45.16: init i32 = initialize_from %.loc11_32 to %.loc11_45.15 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc11_45.17: i32 = int_value 5 [template = constants.%.34]
|
||||
// CHECK:STDOUT: %.loc11_45.18: ref i32 = array_index file.%a.var, %.loc11_45.17
|
||||
// CHECK:STDOUT: %.loc11_45.19: init i32 = initialize_from %.loc11_35 to %.loc11_45.18 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc11_45.20: i32 = int_value 6 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc11_45.19: init i32 = initialize_from %.loc11_35 to %.loc11_45.18 [template = constants.%.35]
|
||||
// CHECK:STDOUT: %.loc11_45.20: i32 = int_value 6 [template = constants.%.35]
|
||||
// CHECK:STDOUT: %.loc11_45.21: ref i32 = array_index file.%a.var, %.loc11_45.20
|
||||
// CHECK:STDOUT: %.loc11_45.22: init i32 = initialize_from %.loc11_38 to %.loc11_45.21 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc11_45.23: i32 = int_value 7 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc11_45.22: init i32 = initialize_from %.loc11_38 to %.loc11_45.21 [template = constants.%.36]
|
||||
// CHECK:STDOUT: %.loc11_45.23: i32 = int_value 7 [template = constants.%.36]
|
||||
// CHECK:STDOUT: %.loc11_45.24: ref i32 = array_index file.%a.var, %.loc11_45.23
|
||||
// CHECK:STDOUT: %.loc11_45.25: init i32 = initialize_from %.loc11_41 to %.loc11_45.24 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc11_45.26: i32 = int_value 8 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc11_45.25: init i32 = initialize_from %.loc11_41 to %.loc11_45.24 [template = constants.%.37]
|
||||
// CHECK:STDOUT: %.loc11_45.26: i32 = int_value 8 [template = constants.%.37]
|
||||
// CHECK:STDOUT: %.loc11_45.27: ref i32 = array_index file.%a.var, %.loc11_45.26
|
||||
// CHECK:STDOUT: %.loc11_45.28: init i32 = initialize_from %.loc11_44 to %.loc11_45.27 [template = constants.%.1]
|
||||
// CHECK:STDOUT: %.loc11_45.29: init %.2 = array_init (%.loc11_45.4, %.loc11_45.7, %.loc11_45.10, %.loc11_45.13, %.loc11_45.16, %.loc11_45.19, %.loc11_45.22, %.loc11_45.25, %.loc11_45.28) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_46: init %.2 = converted %.loc11_45.1, %.loc11_45.29 [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_45.29: init %.28 = array_init (%.loc11_45.4, %.loc11_45.7, %.loc11_45.10, %.loc11_45.13, %.loc11_45.16, %.loc11_45.19, %.loc11_45.22, %.loc11_45.25, %.loc11_45.28) to file.%a.var [template = constants.%array]
|
||||
// CHECK:STDOUT: %.loc11_46: init %.28 = converted %.loc11_45.1, %.loc11_45.29 [template = constants.%array]
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc11_46
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
Reference in New Issue
Block a user