Format types in SemIR using the formatting for their instruction. (#4035)

Don't use the pretty-printed type name, because that's intended for
diagnostics, not for a theoretically machine-readable format like SemIR.

Types are always constants, so omit the leading `constant.` on the type
instruction name.
This commit is contained in:
Richard Smith
2024-06-06 15:12:48 +00:00
committed by GitHub
parent 9a11e977b3
commit 1c07f959a8
520 changed files with 12043 additions and 12040 deletions
+33 -33
View File
@@ -19,18 +19,18 @@ fn G() {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type, type, type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: <type of F> = struct_value () [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: <type of G> = struct_value () [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %.4: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.5: type = array_type %.4, (i32, i32, i32) [template]
// CHECK:STDOUT: %.6: type = ptr_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.7: type = ptr_type [(i32, i32, i32); 2] [template]
// CHECK:STDOUT: %.8: type = tuple_type ((i32, i32, i32), (i32, i32, i32)) [template]
// CHECK:STDOUT: %.5: type = array_type %.4, %.3 [template]
// CHECK:STDOUT: %.6: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.7: type = ptr_type %.5 [template]
// CHECK:STDOUT: %.8: type = tuple_type (%.3, %.3) [template]
// CHECK:STDOUT: %.9: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.10: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
@@ -42,14 +42,14 @@ fn G() {
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: <type of F> = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %int.make_type_32.loc11_22: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_25.1: (type, type, type) = tuple_literal (%int.make_type_32.loc11_12, %int.make_type_32.loc11_17, %int.make_type_32.loc11_22)
// CHECK:STDOUT: %.loc11_25.1: %.2 = tuple_literal (%int.make_type_32.loc11_12, %int.make_type_32.loc11_17, %int.make_type_32.loc11_22)
// CHECK:STDOUT: %.loc11_25.2: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32]
// CHECK:STDOUT: %.loc11_25.3: type = converted %int.make_type_32.loc11_12, %.loc11_25.2 [template = i32]
// CHECK:STDOUT: %.loc11_25.4: type = value_of_initializer %int.make_type_32.loc11_17 [template = i32]
@@ -57,24 +57,24 @@ fn G() {
// CHECK:STDOUT: %.loc11_25.6: type = value_of_initializer %int.make_type_32.loc11_22 [template = i32]
// CHECK:STDOUT: %.loc11_25.7: type = converted %int.make_type_32.loc11_22, %.loc11_25.6 [template = i32]
// CHECK:STDOUT: %.loc11_25.8: type = converted %.loc11_25.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: @F.%return: ref (i32, i32, i32) = var <return slot>
// CHECK:STDOUT: @F.%return: ref %.3 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl: <type of G> = fn_decl @G [template = constants.%G] {}
// CHECK:STDOUT: %import_ref.4: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {}
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() -> (i32, i32, i32);
// CHECK:STDOUT: fn @F() -> %.3;
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int.make_type_32.loc14_12: init type = call constants.%Int32() [template = i32]
// 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: (type, type, type) = tuple_literal (%int.make_type_32.loc14_12, %int.make_type_32.loc14_17, %int.make_type_32.loc14_22)
// CHECK:STDOUT: %.loc14_25.1: %.2 = 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_literal 2 [template = constants.%.4]
// 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]
@@ -83,24 +83,24 @@ 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.%.3 [template = constants.%.3]
// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28, (i32, i32, i32) [template = constants.%.5]
// CHECK:STDOUT: %v.var: ref [(i32, i32, i32); 2] = var v
// CHECK:STDOUT: %v: ref [(i32, i32, i32); 2] = bind_name v, %v.var
// CHECK:STDOUT: %F.ref.loc14_34: <type of F> = name_ref F, file.%F.decl [template = constants.%F]
// CHECK:STDOUT: %.loc14_42.3: ref (i32, i32, i32) = splice_block %.loc14_42.2 {
// CHECK:STDOUT: %.loc14_29: type = array_type %.loc14_28, %.3 [template = constants.%.5]
// CHECK:STDOUT: %v.var: ref %.5 = var v
// CHECK:STDOUT: %v: ref %.5 = 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 %.3 = splice_block %.loc14_42.2 {
// CHECK:STDOUT: %.loc14_42.1: i32 = int_literal 0 [template = constants.%.9]
// CHECK:STDOUT: %.loc14_42.2: ref (i32, i32, i32) = array_index %v.var, %.loc14_42.1
// CHECK:STDOUT: %.loc14_42.2: ref %.3 = array_index %v.var, %.loc14_42.1
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.call.loc14_35: init (i32, i32, i32) = call %F.ref.loc14_34() to %.loc14_42.3
// CHECK:STDOUT: %F.ref.loc14_39: <type of F> = name_ref F, file.%F.decl [template = constants.%F]
// CHECK:STDOUT: %.loc14_42.6: ref (i32, i32, i32) = splice_block %.loc14_42.5 {
// CHECK:STDOUT: %F.call.loc14_35: init %.3 = 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 %.3 = splice_block %.loc14_42.5 {
// CHECK:STDOUT: %.loc14_42.4: i32 = int_literal 1 [template = constants.%.10]
// CHECK:STDOUT: %.loc14_42.5: ref (i32, i32, i32) = array_index %v.var, %.loc14_42.4
// CHECK:STDOUT: %.loc14_42.5: ref %.3 = array_index %v.var, %.loc14_42.4
// CHECK:STDOUT: }
// CHECK:STDOUT: %F.call.loc14_40: init (i32, i32, i32) = call %F.ref.loc14_39() to %.loc14_42.6
// CHECK:STDOUT: %.loc14_42.7: ((i32, i32, i32), (i32, i32, i32)) = tuple_literal (%F.call.loc14_35, %F.call.loc14_40)
// CHECK:STDOUT: %.loc14_42.8: init [(i32, i32, i32); 2] = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var
// CHECK:STDOUT: %.loc14_43: init [(i32, i32, i32); 2] = converted %.loc14_42.7, %.loc14_42.8
// CHECK:STDOUT: %F.call.loc14_40: init %.3 = call %F.ref.loc14_39() to %.loc14_42.6
// CHECK:STDOUT: %.loc14_42.7: %.8 = tuple_literal (%F.call.loc14_35, %F.call.loc14_40)
// CHECK:STDOUT: %.loc14_42.8: init %.5 = array_init (%F.call.loc14_35, %F.call.loc14_40) to %v.var
// CHECK:STDOUT: %.loc14_43: init %.5 = converted %.loc14_42.7, %.loc14_42.8
// CHECK:STDOUT: assign %v.var, %.loc14_43
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+22 -22
View File
@@ -19,20 +19,20 @@ fn G() {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %G: <type of G> = struct_value () [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template]
// CHECK:STDOUT: %.4: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.8: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: %array: %.3 = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: %.9: type = tuple_type (type, type, type) [template]
// CHECK:STDOUT: %.10: type = ptr_type (i32, i32, i32) [template]
// CHECK:STDOUT: %tuple: (i32, i32, i32) = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: %.10: type = ptr_type %.7 [template]
// CHECK:STDOUT: %tuple: %.7 = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -41,11 +41,11 @@ fn G() {
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %G.decl: <type of G> = fn_decl @G [template = constants.%G] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {}
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() {
@@ -55,12 +55,12 @@ fn G() {
// 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.%.3]
// CHECK:STDOUT: %a.var: ref [i32; 3] = var a
// CHECK:STDOUT: %a: ref [i32; 3] = bind_name a, %a.var
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: %.loc13_22: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc13_25: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc13_28: i32 = int_literal 3 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_29.1: (i32, i32, i32) = tuple_literal (%.loc13_22, %.loc13_25, %.loc13_28)
// CHECK:STDOUT: %.loc13_29.1: %.7 = tuple_literal (%.loc13_22, %.loc13_25, %.loc13_28)
// CHECK:STDOUT: %.loc13_29.2: i32 = int_literal 0 [template = constants.%.8]
// 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.%.5]
@@ -70,13 +70,13 @@ fn G() {
// CHECK:STDOUT: %.loc13_29.8: i32 = int_literal 2 [template = constants.%.6]
// 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.%.2]
// CHECK:STDOUT: %.loc13_29.11: init [i32; 3] = array_init (%.loc13_29.4, %.loc13_29.7, %.loc13_29.10) to %a.var [template = constants.%array]
// CHECK:STDOUT: %.loc13_30: init [i32; 3] = converted %.loc13_29.1, %.loc13_29.11 [template = constants.%array]
// CHECK:STDOUT: %.loc13_29.11: init %.3 = array_init (%.loc13_29.4, %.loc13_29.7, %.loc13_29.10) to %a.var [template = constants.%array]
// CHECK:STDOUT: %.loc13_30: init %.3 = 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]
// CHECK:STDOUT: %int.make_type_32.loc14_21: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_24.1: (type, type, type) = tuple_literal (%int.make_type_32.loc14_11, %int.make_type_32.loc14_16, %int.make_type_32.loc14_21)
// CHECK:STDOUT: %.loc14_24.1: %.9 = tuple_literal (%int.make_type_32.loc14_11, %int.make_type_32.loc14_16, %int.make_type_32.loc14_21)
// CHECK:STDOUT: %.loc14_24.2: type = value_of_initializer %int.make_type_32.loc14_11 [template = i32]
// CHECK:STDOUT: %.loc14_24.3: type = converted %int.make_type_32.loc14_11, %.loc14_24.2 [template = i32]
// CHECK:STDOUT: %.loc14_24.4: type = value_of_initializer %int.make_type_32.loc14_16 [template = i32]
@@ -84,20 +84,20 @@ fn G() {
// CHECK:STDOUT: %.loc14_24.6: type = value_of_initializer %int.make_type_32.loc14_21 [template = i32]
// CHECK:STDOUT: %.loc14_24.7: type = converted %int.make_type_32.loc14_21, %.loc14_24.6 [template = i32]
// CHECK:STDOUT: %.loc14_24.8: type = converted %.loc14_24.1, constants.%.7 [template = constants.%.7]
// CHECK:STDOUT: %b.var: ref (i32, i32, i32) = var b
// CHECK:STDOUT: %b: ref (i32, i32, i32) = bind_name b, %b.var
// CHECK:STDOUT: %b.var: ref %.7 = var b
// CHECK:STDOUT: %b: ref %.7 = bind_name b, %b.var
// CHECK:STDOUT: %.loc14_29: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_32: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc14_35: i32 = int_literal 3 [template = constants.%.2]
// CHECK:STDOUT: %.loc14_36.1: (i32, i32, i32) = tuple_literal (%.loc14_29, %.loc14_32, %.loc14_35)
// CHECK:STDOUT: %.loc14_36.1: %.7 = 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.%.5]
// 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.%.6]
// 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.%.2]
// CHECK:STDOUT: %.loc14_36.8: init (i32, i32, i32) = tuple_init (%.loc14_36.3, %.loc14_36.5, %.loc14_36.7) to %b.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc14_37: init (i32, i32, i32) = converted %.loc14_36.1, %.loc14_36.8 [template = constants.%tuple]
// CHECK:STDOUT: %.loc14_36.8: init %.7 = tuple_init (%.loc14_36.3, %.loc14_36.5, %.loc14_36.7) to %b.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc14_37: init %.7 = converted %.loc14_36.1, %.loc14_36.8 [template = constants.%tuple]
// CHECK:STDOUT: assign %b.var, %.loc14_37
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+23 -23
View File
@@ -19,18 +19,18 @@ fn Run() {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32) [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: <type of F> = struct_value () [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.4: i32 = int_literal 0 [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.4) [template]
// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.4) [template]
// CHECK:STDOUT: %Run.type: type = fn_type @Run [template]
// CHECK:STDOUT: %Run: <type of Run> = struct_value () [template]
// CHECK:STDOUT: %Run: %Run.type = struct_value () [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: type = array_type %.5, i32 [template]
// CHECK:STDOUT: %.7: type = ptr_type [i32; 1] [template]
// CHECK:STDOUT: %.7: type = ptr_type %.6 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -40,27 +40,27 @@ fn Run() {
// CHECK:STDOUT: .Run = %Run.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: <type of F> = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_16.1: (type,) = tuple_literal (%int.make_type_32)
// CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32)
// CHECK:STDOUT: %.loc11_16.2: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc11_16.3: type = converted %int.make_type_32, %.loc11_16.2 [template = i32]
// CHECK:STDOUT: %.loc11_16.4: type = converted %.loc11_16.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: @F.%return: ref (i32,) = var <return slot>
// CHECK:STDOUT: @F.%return: ref %.3 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Run.decl: <type of Run> = fn_decl @Run [template = constants.%Run] {}
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {}
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() -> (i32,) {
// CHECK:STDOUT: fn @F() -> %.3 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_28: i32 = int_literal 0 [template = constants.%.4]
// CHECK:STDOUT: %.loc11_30: (i32,) = tuple_literal (%.loc11_28)
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc11_28) [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_31: (i32,) = converted %.loc11_30, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_30: %.3 = tuple_literal (%.loc11_28)
// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.loc11_28) [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_31: %.3 = converted %.loc11_30, %tuple [template = constants.%tuple]
// CHECK:STDOUT: return %.loc11_31
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -71,19 +71,19 @@ fn Run() {
// 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.%.6]
// CHECK:STDOUT: %t.var: ref [i32; 1] = var t
// CHECK:STDOUT: %t: ref [i32; 1] = bind_name t, %t.var
// CHECK:STDOUT: %F.ref: <type of F> = name_ref F, file.%F.decl [template = constants.%F]
// CHECK:STDOUT: %F.call: init (i32,) = call %F.ref()
// CHECK:STDOUT: %.loc14_22.1: ref (i32,) = temporary_storage
// CHECK:STDOUT: %.loc14_22.2: ref (i32,) = temporary %.loc14_22.1, %F.call
// CHECK:STDOUT: %t.var: ref %.6 = var t
// CHECK:STDOUT: %t: ref %.6 = 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 %.3 = call %F.ref()
// CHECK:STDOUT: %.loc14_22.1: ref %.3 = temporary_storage
// CHECK:STDOUT: %.loc14_22.2: ref %.3 = temporary %.loc14_22.1, %F.call
// CHECK:STDOUT: %.loc14_22.3: ref i32 = tuple_access %.loc14_22.2, element0
// CHECK:STDOUT: %.loc14_22.4: i32 = bind_value %.loc14_22.3
// CHECK:STDOUT: %.loc14_22.5: i32 = int_literal 0 [template = constants.%.4]
// 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 [i32; 1] = array_init (%.loc14_22.7) to %t.var
// CHECK:STDOUT: %.loc14_24: init [i32; 1] = converted %F.call, %.loc14_22.8
// CHECK:STDOUT: %.loc14_22.8: init %.6 = array_init (%.loc14_22.7) to %t.var
// CHECK:STDOUT: %.loc14_24: init %.6 = converted %F.call, %.loc14_22.8
// CHECK:STDOUT: assign %t.var, %.loc14_24
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+19 -19
View File
@@ -16,16 +16,16 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: type = tuple_type (type, type, type) [template]
// CHECK:STDOUT: %.3: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.4: type = ptr_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.7: i32 = int_literal 3 [template]
// CHECK:STDOUT: %tuple: (i32, i32, i32) = tuple_value (%.5, %.6, %.7) [template]
// CHECK:STDOUT: %tuple: %.3 = tuple_value (%.5, %.6, %.7) [template]
// CHECK:STDOUT: %.8: type = array_type %.7, i32 [template]
// CHECK:STDOUT: %.9: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.9: type = ptr_type %.8 [template]
// CHECK:STDOUT: %.10: i32 = int_literal 0 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -36,13 +36,13 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %import_ref.3: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_22.1: (type, type, type) = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14, %int.make_type_32.loc11_19)
// CHECK:STDOUT: %.loc11_22.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14, %int.make_type_32.loc11_19)
// CHECK:STDOUT: %.loc11_22.2: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32]
// CHECK:STDOUT: %.loc11_22.3: type = converted %int.make_type_32.loc11_9, %.loc11_22.2 [template = i32]
// CHECK:STDOUT: %.loc11_22.4: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32]
@@ -50,16 +50,16 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: %.loc11_22.6: type = value_of_initializer %int.make_type_32.loc11_19 [template = i32]
// CHECK:STDOUT: %.loc11_22.7: type = converted %int.make_type_32.loc11_19, %.loc11_22.6 [template = i32]
// CHECK:STDOUT: %.loc11_22.8: type = converted %.loc11_22.1, constants.%.3 [template = constants.%.3]
// CHECK:STDOUT: %a.var: ref (i32, i32, i32) = var a
// CHECK:STDOUT: %a: ref (i32, i32, i32) = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.4: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc12_14: i32 = int_literal 3 [template = constants.%.7]
// 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.%.8]
// CHECK:STDOUT: %b.var: ref [i32; 3] = var b
// CHECK:STDOUT: %b: ref [i32; 3] = bind_name b, %b.var
// CHECK:STDOUT: %b.var: ref %.8 = var b
// CHECK:STDOUT: %b: ref %.8 = bind_name b, %b.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
@@ -69,17 +69,17 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: %.loc11_27: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_30: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_33: i32 = int_literal 3 [template = constants.%.7]
// CHECK:STDOUT: %.loc11_34.1: (i32, i32, i32) = tuple_literal (%.loc11_27, %.loc11_30, %.loc11_33)
// CHECK:STDOUT: %.loc11_34.1: %.3 = tuple_literal (%.loc11_27, %.loc11_30, %.loc11_33)
// CHECK:STDOUT: %.loc11_34.2: ref i32 = tuple_access file.%a.var, element0
// CHECK:STDOUT: %.loc11_34.3: init i32 = initialize_from %.loc11_27 to %.loc11_34.2 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_34.4: ref i32 = tuple_access file.%a.var, element1
// CHECK:STDOUT: %.loc11_34.5: init i32 = initialize_from %.loc11_30 to %.loc11_34.4 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_34.6: ref i32 = tuple_access file.%a.var, element2
// CHECK:STDOUT: %.loc11_34.7: init i32 = initialize_from %.loc11_33 to %.loc11_34.6 [template = constants.%.7]
// CHECK:STDOUT: %.loc11_34.8: init (i32, i32, i32) = tuple_init (%.loc11_34.3, %.loc11_34.5, %.loc11_34.7) to file.%a.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_35: init (i32, i32, i32) = converted %.loc11_34.1, %.loc11_34.8 [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_34.8: init %.3 = tuple_init (%.loc11_34.3, %.loc11_34.5, %.loc11_34.7) to file.%a.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc11_35: init %.3 = converted %.loc11_34.1, %.loc11_34.8 [template = constants.%tuple]
// CHECK:STDOUT: assign file.%a.var, %.loc11_35
// CHECK:STDOUT: %a.ref: ref (i32, i32, i32) = name_ref a, file.%a
// CHECK:STDOUT: %a.ref: ref %.3 = 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_literal 0 [template = constants.%.10]
@@ -95,8 +95,8 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: %.loc12_19.13: i32 = int_literal 2 [template = constants.%.6]
// 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 [i32; 3] = array_init (%.loc12_19.5, %.loc12_19.10, %.loc12_19.15) to file.%b.var
// CHECK:STDOUT: %.loc12_20: init [i32; 3] = converted %a.ref, %.loc12_19.16
// CHECK:STDOUT: %.loc12_19.16: init %.8 = array_init (%.loc12_19.5, %.loc12_19.10, %.loc12_19.15) to file.%b.var
// CHECK:STDOUT: %.loc12_20: init %.8 = converted %a.ref, %.loc12_19.16
// CHECK:STDOUT: assign file.%b.var, %.loc12_20
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+50 -50
View File
@@ -17,31 +17,31 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template]
// CHECK:STDOUT: %.4: type = ptr_type [i32; 1] [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.6: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array.1: [i32; 1] = tuple_value (%.2) [template]
// CHECK:STDOUT: %array.1: %.3 = tuple_value (%.2) [template]
// CHECK:STDOUT: %.7: i32 = int_literal 64 [template]
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
// CHECK:STDOUT: %Float: <type of Float> = struct_value () [template]
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
// CHECK:STDOUT: %.8: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.9: type = array_type %.8, f64 [template]
// CHECK:STDOUT: %.10: type = ptr_type [f64; 2] [template]
// CHECK:STDOUT: %.10: type = ptr_type %.9 [template]
// CHECK:STDOUT: %.11: f64 = float_literal 11.100000000000001 [template]
// CHECK:STDOUT: %.12: f64 = float_literal 2.2000000000000002 [template]
// CHECK:STDOUT: %.13: type = tuple_type (f64, f64) [template]
// CHECK:STDOUT: %array.2: [f64; 2] = tuple_value (%.11, %.12) [template]
// CHECK:STDOUT: %array.2: %.9 = tuple_value (%.11, %.12) [template]
// CHECK:STDOUT: %.14: i32 = int_literal 5 [template]
// CHECK:STDOUT: %.15: type = array_type %.14, () [template]
// CHECK:STDOUT: %.16: type = ptr_type [(); 5] [template]
// CHECK:STDOUT: %.17: type = tuple_type ((), (), (), (), ()) [template]
// CHECK:STDOUT: %tuple: () = tuple_value () [template]
// CHECK:STDOUT: %.15: type = array_type %.14, %.1 [template]
// CHECK:STDOUT: %.16: type = ptr_type %.15 [template]
// CHECK:STDOUT: %.17: type = tuple_type (%.1, %.1, %.1, %.1, %.1) [template]
// CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
// CHECK:STDOUT: %.18: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.19: i32 = int_literal 4 [template]
// CHECK:STDOUT: %array.3: [(); 5] = tuple_value (%tuple, %tuple, %tuple, %tuple, %tuple) [template]
// CHECK:STDOUT: %array.3: %.15 = tuple_value (%tuple, %tuple, %tuple, %tuple, %tuple) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -52,29 +52,29 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: .c = %c
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2]
// 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.%.3]
// CHECK:STDOUT: %a.var: ref [i32; 1] = var a
// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: %.loc12_9.1: i32 = int_literal 64 [template = constants.%.7]
// CHECK:STDOUT: %import_ref.2: <type of Float> = import_ref ir3, inst+31, loaded [template = constants.%Float]
// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref ir3, inst+31, loaded [template = constants.%Float]
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc12_9.1) [template = f64]
// CHECK:STDOUT: %.loc12_14: i32 = int_literal 2 [template = constants.%.8]
// 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.%.9]
// CHECK:STDOUT: %b.var: ref [f64; 2] = var b
// CHECK:STDOUT: %b: ref [f64; 2] = bind_name b, %b.var
// CHECK:STDOUT: %.loc13_10.1: () = tuple_literal ()
// CHECK:STDOUT: %b.var: ref %.9 = var b
// CHECK:STDOUT: %b: ref %.9 = bind_name b, %b.var
// CHECK:STDOUT: %.loc13_10.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc13_13: i32 = int_literal 5 [template = constants.%.14]
// CHECK:STDOUT: %.loc13_10.2: type = converted %.loc13_10.1, constants.%.1 [template = constants.%.1]
// CHECK:STDOUT: %.loc13_14: type = array_type %.loc13_13, () [template = constants.%.15]
// CHECK:STDOUT: %c.var: ref [(); 5] = var c
// CHECK:STDOUT: %c: ref [(); 5] = bind_name c, %c.var
// CHECK:STDOUT: %.loc13_14: type = array_type %.loc13_13, %.1 [template = constants.%.15]
// CHECK:STDOUT: %c.var: ref %.15 = var c
// CHECK:STDOUT: %c: ref %.15 = bind_name c, %c.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
@@ -84,53 +84,53 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_20: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc11_22.1: (i32,) = tuple_literal (%.loc11_20)
// CHECK:STDOUT: %.loc11_22.1: %.5 = tuple_literal (%.loc11_20)
// CHECK:STDOUT: %.loc11_22.2: i32 = int_literal 0 [template = constants.%.6]
// 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.%.2]
// CHECK:STDOUT: %.loc11_22.5: init [i32; 1] = array_init (%.loc11_22.4) to file.%a.var [template = constants.%array.1]
// CHECK:STDOUT: %.loc11_23: init [i32; 1] = converted %.loc11_22.1, %.loc11_22.5 [template = constants.%array.1]
// CHECK:STDOUT: %.loc11_22.5: init %.3 = array_init (%.loc11_22.4) to file.%a.var [template = constants.%array.1]
// CHECK:STDOUT: %.loc11_23: init %.3 = 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.%.11]
// CHECK:STDOUT: %.loc12_26: f64 = float_literal 2.2000000000000002 [template = constants.%.12]
// CHECK:STDOUT: %.loc12_30.1: (f64, f64) = tuple_literal (%.loc12_20, %.loc12_26)
// CHECK:STDOUT: %.loc12_30.1: %.13 = tuple_literal (%.loc12_20, %.loc12_26)
// CHECK:STDOUT: %.loc12_30.2: i32 = int_literal 0 [template = constants.%.6]
// 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.%.11]
// CHECK:STDOUT: %.loc12_30.5: i32 = int_literal 1 [template = constants.%.2]
// 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.%.12]
// CHECK:STDOUT: %.loc12_30.8: init [f64; 2] = array_init (%.loc12_30.4, %.loc12_30.7) to file.%b.var [template = constants.%array.2]
// CHECK:STDOUT: %.loc12_31: init [f64; 2] = converted %.loc12_30.1, %.loc12_30.8 [template = constants.%array.2]
// CHECK:STDOUT: %.loc12_30.8: init %.9 = array_init (%.loc12_30.4, %.loc12_30.7) to file.%b.var [template = constants.%array.2]
// CHECK:STDOUT: %.loc12_31: init %.9 = converted %.loc12_30.1, %.loc12_30.8 [template = constants.%array.2]
// CHECK:STDOUT: assign file.%b.var, %.loc12_31
// CHECK:STDOUT: %.loc13_20.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc13_24.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc13_28.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc13_32.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc13_36.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc13_38.1: ((), (), (), (), ()) = tuple_literal (%.loc13_20.1, %.loc13_24.1, %.loc13_28.1, %.loc13_32.1, %.loc13_36.1)
// CHECK:STDOUT: %.loc13_20.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc13_24.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc13_28.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc13_32.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc13_36.1: %.1 = tuple_literal ()
// CHECK:STDOUT: %.loc13_38.1: %.17 = tuple_literal (%.loc13_20.1, %.loc13_24.1, %.loc13_28.1, %.loc13_32.1, %.loc13_36.1)
// CHECK:STDOUT: %.loc13_38.2: i32 = int_literal 0 [template = constants.%.6]
// CHECK:STDOUT: %.loc13_38.3: ref () = array_index file.%c.var, %.loc13_38.2
// CHECK:STDOUT: %.loc13_20.2: init () = tuple_init () to %.loc13_38.3 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.4: init () = converted %.loc13_20.1, %.loc13_20.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.3: ref %.1 = array_index file.%c.var, %.loc13_38.2
// CHECK:STDOUT: %.loc13_20.2: init %.1 = tuple_init () to %.loc13_38.3 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.4: init %.1 = converted %.loc13_20.1, %.loc13_20.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.5: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_38.6: ref () = array_index file.%c.var, %.loc13_38.5
// CHECK:STDOUT: %.loc13_24.2: init () = tuple_init () to %.loc13_38.6 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.7: init () = converted %.loc13_24.1, %.loc13_24.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.6: ref %.1 = array_index file.%c.var, %.loc13_38.5
// CHECK:STDOUT: %.loc13_24.2: init %.1 = tuple_init () to %.loc13_38.6 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.7: init %.1 = converted %.loc13_24.1, %.loc13_24.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.8: i32 = int_literal 2 [template = constants.%.8]
// CHECK:STDOUT: %.loc13_38.9: ref () = array_index file.%c.var, %.loc13_38.8
// CHECK:STDOUT: %.loc13_28.2: init () = tuple_init () to %.loc13_38.9 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.10: init () = converted %.loc13_28.1, %.loc13_28.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.9: ref %.1 = array_index file.%c.var, %.loc13_38.8
// CHECK:STDOUT: %.loc13_28.2: init %.1 = tuple_init () to %.loc13_38.9 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.10: init %.1 = converted %.loc13_28.1, %.loc13_28.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.11: i32 = int_literal 3 [template = constants.%.18]
// CHECK:STDOUT: %.loc13_38.12: ref () = array_index file.%c.var, %.loc13_38.11
// CHECK:STDOUT: %.loc13_32.2: init () = tuple_init () to %.loc13_38.12 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.13: init () = converted %.loc13_32.1, %.loc13_32.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.12: ref %.1 = array_index file.%c.var, %.loc13_38.11
// CHECK:STDOUT: %.loc13_32.2: init %.1 = tuple_init () to %.loc13_38.12 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.13: init %.1 = converted %.loc13_32.1, %.loc13_32.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.14: i32 = int_literal 4 [template = constants.%.19]
// CHECK:STDOUT: %.loc13_38.15: ref () = array_index file.%c.var, %.loc13_38.14
// CHECK:STDOUT: %.loc13_36.2: init () = tuple_init () to %.loc13_38.15 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.16: init () = converted %.loc13_36.1, %.loc13_36.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.17: init [(); 5] = 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 [(); 5] = converted %.loc13_38.1, %.loc13_38.17 [template = constants.%array.3]
// CHECK:STDOUT: %.loc13_38.15: ref %.1 = array_index file.%c.var, %.loc13_38.14
// CHECK:STDOUT: %.loc13_36.2: init %.1 = tuple_init () to %.loc13_38.15 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.16: init %.1 = converted %.loc13_36.1, %.loc13_36.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc13_38.17: init %.15 = 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 %.15 = converted %.loc13_38.1, %.loc13_38.17 [template = constants.%array.3]
// CHECK:STDOUT: assign file.%c.var, %.loc13_39
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+20 -20
View File
@@ -18,17 +18,17 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %Add.type: type = fn_type @Add [template]
// CHECK:STDOUT: %Add: <type of Add> = struct_value () [template]
// CHECK:STDOUT: %Add: %Add.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.4: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template]
// CHECK:STDOUT: %.6: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.6: type = ptr_type %.5 [template]
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.8: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.2, %.3, %.4) [template]
// CHECK:STDOUT: %array: %.5 = tuple_value (%.2, %.3, %.4) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -38,10 +38,10 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: .a = %a.loc13
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Add.decl: <type of Add> = fn_decl @Add [template = constants.%Add] {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] {
// CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32]
// CHECK:STDOUT: %.loc11_11.2: type = converted %int.make_type_32.loc11_11, %.loc11_11.1 [template = i32]
@@ -57,27 +57,27 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: %.loc11_27.2: type = converted %int.make_type_32.loc11_27, %.loc11_27.1 [template = i32]
// CHECK:STDOUT: @Add.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.4: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %Add.ref: <type of Add> = name_ref Add, %Add.decl [template = constants.%Add]
// CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, %Add.decl [template = constants.%Add]
// CHECK:STDOUT: %.loc13_18: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_21: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %int.sadd: init i32 = call %Add.ref(%.loc13_18, %.loc13_21) [template = constants.%.4]
// 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.%.5]
// CHECK:STDOUT: %a.var: ref [i32; 3] = var a
// CHECK:STDOUT: %a.loc13: ref [i32; 3] = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.5: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %a.var: ref %.5 = var a
// CHECK:STDOUT: %a.loc13: ref %.5 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc14: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_14: i32 = int_literal 3 [template = constants.%.4]
// 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.%.5]
// CHECK:STDOUT: %.loc14_16: type = ptr_type [i32; 3] [template = constants.%.6]
// CHECK:STDOUT: %a.ref: ref [i32; 3] = name_ref a, %a.loc13
// CHECK:STDOUT: %.loc14_20: [i32; 3]* = addr_of %a.ref
// CHECK:STDOUT: %b.loc14: [i32; 3]* = bind_name b, %.loc14_20
// CHECK:STDOUT: %.loc14_16: type = ptr_type %.5 [template = constants.%.6]
// CHECK:STDOUT: %a.ref: ref %.5 = name_ref a, %a.loc13
// CHECK:STDOUT: %.loc14_20: %.6 = addr_of %a.ref
// CHECK:STDOUT: %b.loc14: %.6 = bind_name b, %.loc14_20
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
@@ -89,7 +89,7 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: %.loc13_28: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc13_31: i32 = int_literal 2 [template = constants.%.3]
// CHECK:STDOUT: %.loc13_34: i32 = int_literal 3 [template = constants.%.4]
// CHECK:STDOUT: %.loc13_35.1: (i32, i32, i32) = tuple_literal (%.loc13_28, %.loc13_31, %.loc13_34)
// CHECK:STDOUT: %.loc13_35.1: %.7 = tuple_literal (%.loc13_28, %.loc13_31, %.loc13_34)
// CHECK:STDOUT: %.loc13_35.2: i32 = int_literal 0 [template = constants.%.8]
// 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.%.2]
@@ -99,8 +99,8 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: %.loc13_35.8: i32 = int_literal 2 [template = constants.%.3]
// 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.%.4]
// CHECK:STDOUT: %.loc13_35.11: init [i32; 3] = array_init (%.loc13_35.4, %.loc13_35.7, %.loc13_35.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc13_36: init [i32; 3] = converted %.loc13_35.1, %.loc13_35.11 [template = constants.%array]
// CHECK:STDOUT: %.loc13_35.11: init %.5 = array_init (%.loc13_35.4, %.loc13_35.7, %.loc13_35.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc13_36: init %.5 = converted %.loc13_35.1, %.loc13_35.11 [template = constants.%array]
// CHECK:STDOUT: assign file.%a.var, %.loc13_36
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+7 -7
View File
@@ -20,9 +20,9 @@ var a: [i32; Negate(1)];
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template]
// CHECK:STDOUT: %Negate: <type of Negate> = struct_value () [template]
// CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: i32 = int_literal -1 [template]
// CHECK:STDOUT: }
@@ -34,9 +34,9 @@ var a: [i32; Negate(1)];
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Negate.decl: <type of Negate> = fn_decl @Negate [template = constants.%Negate] {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] {
// CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32]
// CHECK:STDOUT: %.loc11_14.2: type = converted %int.make_type_32.loc11_14, %.loc11_14.1 [template = i32]
@@ -47,9 +47,9 @@ var a: [i32; Negate(1)];
// CHECK:STDOUT: %.loc11_22.2: type = converted %int.make_type_32.loc11_22, %.loc11_22.1 [template = i32]
// CHECK:STDOUT: @Negate.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.3: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %Negate.ref: <type of Negate> = name_ref Negate, %Negate.decl [template = constants.%Negate]
// CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, %Negate.decl [template = constants.%Negate]
// CHECK:STDOUT: %.loc16_21: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %int.snegate: init i32 = call %Negate.ref(%.loc16_21) [template = constants.%.3]
// CHECK:STDOUT: %.loc16_9.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32]
+2 -2
View File
@@ -31,7 +31,7 @@ var b: [1; 39999999999999999993];
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -42,7 +42,7 @@ var b: [1; 39999999999999999993];
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32 [template = i32]
// CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32, %.loc18_9.1 [template = i32]
@@ -25,8 +25,8 @@ var p: Incomplete* = &a[0];
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template]
// CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.2: type = array_type %.1, Incomplete [template]
// CHECK:STDOUT: %.3: type = ptr_type Incomplete [template]
// CHECK:STDOUT: %.2: type = array_type %.1, %Incomplete [template]
// CHECK:STDOUT: %.3: type = ptr_type %Incomplete [template]
// CHECK:STDOUT: %.4: i32 = int_literal 0 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -41,13 +41,13 @@ var p: Incomplete* = &a[0];
// 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_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc19_22: type = array_type %.loc19_21, Incomplete [template = constants.%.2]
// CHECK:STDOUT: %.loc19_22: type = array_type %.loc19_21, %Incomplete [template = constants.%.2]
// 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 Incomplete* = var p
// CHECK:STDOUT: %p: ref Incomplete* = bind_name p, %p.var
// 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: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Incomplete;
+6 -6
View File
@@ -18,10 +18,10 @@ var a: [i32; 1] = (1, 2, 3);
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template]
// CHECK:STDOUT: %.4: type = ptr_type [i32; 1] [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
@@ -33,14 +33,14 @@ var a: [i32; 1] = (1, 2, 3);
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc14_14: i32 = int_literal 1 [template = constants.%.2]
// 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.%.3]
// CHECK:STDOUT: %a.var: ref [i32; 1] = var a
// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
@@ -50,7 +50,7 @@ var a: [i32; 1] = (1, 2, 3);
// CHECK:STDOUT: %.loc14_20: i32 = int_literal 1 [template = constants.%.2]
// CHECK:STDOUT: %.loc14_23: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc14_26: i32 = int_literal 3 [template = constants.%.6]
// CHECK:STDOUT: %.loc14_27: (i32, i32, i32) = tuple_literal (%.loc14_20, %.loc14_23, %.loc14_26)
// CHECK:STDOUT: %.loc14_27: %.7 = tuple_literal (%.loc14_20, %.loc14_23, %.loc14_26)
// CHECK:STDOUT: assign file.%a.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -19,17 +19,17 @@ var b: i32 = a[{.index = 3}.index];
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template]
// CHECK:STDOUT: %.4: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.8: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: %array: %.3 = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: %.9: type = struct_type {.index: i32} [template]
// CHECK:STDOUT: %struct: {.index: i32} = struct_value (%.2) [template]
// CHECK:STDOUT: %struct: %.9 = struct_value (%.2) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -39,15 +39,15 @@ var b: i32 = a[{.index = 3}.index];
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_14: i32 = int_literal 3 [template = constants.%.2]
// 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.%.3]
// CHECK:STDOUT: %a.var: ref [i32; 3] = var a
// CHECK:STDOUT: %a: ref [i32; 3] = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -62,7 +62,7 @@ var b: i32 = a[{.index = 3}.index];
// CHECK:STDOUT: %.loc11_20: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_23: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_26: i32 = int_literal 3 [template = constants.%.2]
// CHECK:STDOUT: %.loc11_27.1: (i32, i32, i32) = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26)
// CHECK:STDOUT: %.loc11_27.1: %.7 = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26)
// CHECK:STDOUT: %.loc11_27.2: i32 = int_literal 0 [template = constants.%.8]
// 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.%.5]
@@ -72,14 +72,14 @@ var b: i32 = a[{.index = 3}.index];
// CHECK:STDOUT: %.loc11_27.8: i32 = int_literal 2 [template = constants.%.6]
// 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.%.2]
// CHECK:STDOUT: %.loc11_27.11: init [i32; 3] = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc11_28: init [i32; 3] = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
// CHECK:STDOUT: %.loc11_27.11: init %.3 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc11_28: init %.3 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
// CHECK:STDOUT: assign file.%a.var, %.loc11_28
// CHECK:STDOUT: %a.ref: ref [i32; 3] = name_ref a, file.%a
// CHECK:STDOUT: %a.ref: ref %.3 = name_ref a, file.%a
// CHECK:STDOUT: %.loc15_26: i32 = int_literal 3 [template = constants.%.2]
// CHECK:STDOUT: %.loc15_27.1: {.index: i32} = struct_literal (%.loc15_26)
// CHECK:STDOUT: %struct: {.index: i32} = struct_value (%.loc15_26) [template = constants.%struct]
// CHECK:STDOUT: %.loc15_27.2: {.index: i32} = converted %.loc15_27.1, %struct [template = constants.%struct]
// CHECK:STDOUT: %.loc15_27.1: %.9 = struct_literal (%.loc15_26)
// CHECK:STDOUT: %struct: %.9 = struct_value (%.loc15_26) [template = constants.%struct]
// CHECK:STDOUT: %.loc15_27.2: %.9 = converted %.loc15_27.1, %struct [template = constants.%struct]
// CHECK:STDOUT: %.loc15_28: i32 = struct_access %.loc15_27.2, element0 [template = constants.%.2]
// 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
+30 -30
View File
@@ -38,10 +38,10 @@ var d: [i32; 3] = t2;
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template]
// CHECK:STDOUT: %.4: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: type = ptr_type String [template]
// CHECK:STDOUT: %.7: String = string_literal "Hello" [template]
@@ -49,12 +49,12 @@ var d: [i32; 3] = t2;
// CHECK:STDOUT: %.9: type = tuple_type (i32, String, String) [template]
// CHECK:STDOUT: %.10: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.11: type = tuple_type (type, type, type) [template]
// CHECK:STDOUT: %.12: type = tuple_type (i32, String*, String*) [template]
// CHECK:STDOUT: %.13: type = ptr_type (i32, String*, String*) [template]
// CHECK:STDOUT: %.12: type = tuple_type (i32, %.6, %.6) [template]
// CHECK:STDOUT: %.13: type = ptr_type %.12 [template]
// CHECK:STDOUT: %.14: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.15: type = tuple_type (i32, i32) [template]
// CHECK:STDOUT: %.16: type = tuple_type (type, type) [template]
// CHECK:STDOUT: %.17: type = ptr_type (i32, i32) [template]
// CHECK:STDOUT: %.17: type = ptr_type %.15 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -68,58 +68,58 @@ var d: [i32; 3] = t2;
// CHECK:STDOUT: .d = %d
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_14: i32 = int_literal 3 [template = constants.%.2]
// 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_15: type = array_type %.loc15_14, i32 [template = constants.%.3]
// CHECK:STDOUT: %a.var: ref [i32; 3] = var a
// CHECK:STDOUT: %a: ref [i32; 3] = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc17: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc17_29.1: (type, type, type) = tuple_literal (%int.make_type_32.loc17, String, String)
// CHECK:STDOUT: %.loc17_29.1: %.11 = tuple_literal (%int.make_type_32.loc17, String, String)
// CHECK:STDOUT: %.loc17_29.2: type = value_of_initializer %int.make_type_32.loc17 [template = i32]
// CHECK:STDOUT: %.loc17_29.3: type = converted %int.make_type_32.loc17, %.loc17_29.2 [template = i32]
// CHECK:STDOUT: %.loc17_29.4: type = converted %.loc17_29.1, constants.%.9 [template = constants.%.9]
// CHECK:STDOUT: %t1.var: ref (i32, String, String) = var t1
// CHECK:STDOUT: %t1: ref (i32, String, String) = bind_name t1, %t1.var
// CHECK:STDOUT: %import_ref.3: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %t1.var: ref %.9 = var t1
// CHECK:STDOUT: %t1: ref %.9 = bind_name t1, %t1.var
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc22: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc22_14: i32 = int_literal 3 [template = constants.%.2]
// CHECK:STDOUT: %.loc22_9.1: type = value_of_initializer %int.make_type_32.loc22 [template = i32]
// CHECK:STDOUT: %.loc22_9.2: type = converted %int.make_type_32.loc22, %.loc22_9.1 [template = i32]
// CHECK:STDOUT: %.loc22_15: type = array_type %.loc22_14, i32 [template = constants.%.3]
// CHECK:STDOUT: %b.var: ref [i32; 3] = var b
// CHECK:STDOUT: %b: ref [i32; 3] = bind_name b, %b.var
// CHECK:STDOUT: %import_ref.4: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %b.var: ref %.3 = var b
// CHECK:STDOUT: %b: ref %.3 = bind_name b, %b.var
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc28: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc28_14: i32 = int_literal 3 [template = constants.%.2]
// 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.%.3]
// CHECK:STDOUT: %c.var: ref [i32; 3] = var c
// CHECK:STDOUT: %c: ref [i32; 3] = bind_name c, %c.var
// CHECK:STDOUT: %import_ref.5: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %c.var: ref %.3 = var c
// CHECK:STDOUT: %c: ref %.3 = bind_name c, %c.var
// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc30_10: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %import_ref.6: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc30_15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc30_18.1: (type, type) = tuple_literal (%int.make_type_32.loc30_10, %int.make_type_32.loc30_15)
// CHECK:STDOUT: %.loc30_18.1: %.16 = tuple_literal (%int.make_type_32.loc30_10, %int.make_type_32.loc30_15)
// CHECK:STDOUT: %.loc30_18.2: type = value_of_initializer %int.make_type_32.loc30_10 [template = i32]
// CHECK:STDOUT: %.loc30_18.3: type = converted %int.make_type_32.loc30_10, %.loc30_18.2 [template = i32]
// CHECK:STDOUT: %.loc30_18.4: type = value_of_initializer %int.make_type_32.loc30_15 [template = i32]
// CHECK:STDOUT: %.loc30_18.5: type = converted %int.make_type_32.loc30_15, %.loc30_18.4 [template = i32]
// CHECK:STDOUT: %.loc30_18.6: type = converted %.loc30_18.1, constants.%.15 [template = constants.%.15]
// CHECK:STDOUT: %t2.var: ref (i32, i32) = var t2
// CHECK:STDOUT: %t2: ref (i32, i32) = bind_name t2, %t2.var
// CHECK:STDOUT: %import_ref.7: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %t2.var: ref %.15 = var t2
// CHECK:STDOUT: %t2: ref %.15 = bind_name t2, %t2.var
// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc34: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc34_14: i32 = int_literal 3 [template = constants.%.2]
// 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.%.3]
// CHECK:STDOUT: %d.var: ref [i32; 3] = var d
// CHECK:STDOUT: %d: ref [i32; 3] = bind_name d, %d.var
// CHECK:STDOUT: %d.var: ref %.3 = var d
// CHECK:STDOUT: %d: ref %.3 = bind_name d, %d.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
@@ -129,12 +129,12 @@ var d: [i32; 3] = t2;
// CHECK:STDOUT: %.loc15_20: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc15_23: String = string_literal "Hello" [template = constants.%.7]
// CHECK:STDOUT: %.loc15_32: String = string_literal "World" [template = constants.%.8]
// CHECK:STDOUT: %.loc15_39.1: (i32, String, String) = tuple_literal (%.loc15_20, %.loc15_23, %.loc15_32)
// CHECK:STDOUT: %.loc15_39.1: %.9 = tuple_literal (%.loc15_20, %.loc15_23, %.loc15_32)
// CHECK:STDOUT: %.loc15_39.2: i32 = int_literal 0 [template = constants.%.10]
// CHECK:STDOUT: %.loc15_39.3: ref i32 = array_index file.%a.var, %.loc15_39.2
// CHECK:STDOUT: %.loc15_39.4: init i32 = initialize_from %.loc15_20 to %.loc15_39.3 [template = constants.%.5]
// CHECK:STDOUT: assign file.%a.var, <error>
// CHECK:STDOUT: %t1.ref: ref (i32, String, String) = name_ref t1, file.%t1
// CHECK:STDOUT: %t1.ref: ref %.9 = name_ref t1, file.%t1
// CHECK:STDOUT: %.loc22_19.1: ref i32 = tuple_access %t1.ref, element0
// CHECK:STDOUT: %.loc22_19.2: i32 = bind_value %.loc22_19.1
// CHECK:STDOUT: %.loc22_19.3: i32 = int_literal 0 [template = constants.%.10]
@@ -144,9 +144,9 @@ var d: [i32; 3] = t2;
// CHECK:STDOUT: assign file.%b.var, <error>
// CHECK:STDOUT: %.loc28_20: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc28_23: i32 = int_literal 2 [template = constants.%.14]
// CHECK:STDOUT: %.loc28_24: (i32, i32) = tuple_literal (%.loc28_20, %.loc28_23)
// CHECK:STDOUT: %.loc28_24: %.15 = tuple_literal (%.loc28_20, %.loc28_23)
// CHECK:STDOUT: assign file.%c.var, <error>
// CHECK:STDOUT: %t2.ref: ref (i32, i32) = name_ref t2, file.%t2
// CHECK:STDOUT: %t2.ref: ref %.15 = name_ref t2, file.%t2
// CHECK:STDOUT: assign file.%d.var, <error>
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+1 -1
View File
@@ -18,7 +18,7 @@ var a: [i32; ];
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {}
+23 -23
View File
@@ -21,19 +21,19 @@ fn G() -> i32 {
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: <type of F> = struct_value () [template]
// CHECK:STDOUT: %.4: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: <type of G> = struct_value () [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.8: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: %array: %.3 = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -43,17 +43,17 @@ fn G() -> i32 {
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: <type of F> = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_17: i32 = int_literal 3 [template = constants.%.2]
// 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.%.3]
// CHECK:STDOUT: %arr.loc11_6.1: [i32; 3] = param arr
// CHECK:STDOUT: @F.%arr: [i32; 3] = bind_name arr, %arr.loc11_6.1
// CHECK:STDOUT: %arr.loc11_6.1: %.3 = param arr
// CHECK:STDOUT: @F.%arr: %.3 = bind_name arr, %arr.loc11_6.1
// 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]
@@ -64,8 +64,8 @@ fn G() -> i32 {
// CHECK:STDOUT: %.loc11_32.2: type = converted %int.make_type_32.loc11_32, %.loc11_32.1 [template = i32]
// CHECK:STDOUT: @F.%return: ref i32 = var <return slot>
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.4: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %G.decl: <type of G> = fn_decl @G [template = constants.%G] {
// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
// CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32]
// CHECK:STDOUT: %.loc15_11.2: type = converted %int.make_type_32.loc15, %.loc15_11.1 [template = i32]
@@ -75,11 +75,11 @@ fn G() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%arr: [i32; 3], %i: i32) -> i32 {
// CHECK:STDOUT: fn @F(%arr: %.3, %i: i32) -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %arr.ref: [i32; 3] = name_ref arr, %arr
// CHECK:STDOUT: %arr.ref: %.3 = name_ref arr, %arr
// CHECK:STDOUT: %i.ref: i32 = name_ref i, %i
// CHECK:STDOUT: %.loc12_15.1: ref [i32; 3] = value_as_ref %arr.ref
// CHECK:STDOUT: %.loc12_15.1: ref %.3 = 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
@@ -87,13 +87,13 @@ fn G() -> i32 {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() -> i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: <type of F> = name_ref F, file.%F.decl [template = constants.%F]
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
// CHECK:STDOUT: %.loc16_13: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc16_16: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc16_19: i32 = int_literal 3 [template = constants.%.2]
// CHECK:STDOUT: %.loc16_20.1: (i32, i32, i32) = tuple_literal (%.loc16_13, %.loc16_16, %.loc16_19)
// CHECK:STDOUT: %.loc16_20.1: %.7 = tuple_literal (%.loc16_13, %.loc16_16, %.loc16_19)
// CHECK:STDOUT: %.loc16_23: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc16_20.2: ref [i32; 3] = temporary_storage
// CHECK:STDOUT: %.loc16_20.2: ref %.3 = temporary_storage
// CHECK:STDOUT: %.loc16_20.3: i32 = int_literal 0 [template = constants.%.8]
// 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.%.5]
@@ -103,10 +103,10 @@ fn G() -> i32 {
// CHECK:STDOUT: %.loc16_20.9: i32 = int_literal 2 [template = constants.%.6]
// 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.%.2]
// CHECK:STDOUT: %.loc16_20.12: init [i32; 3] = array_init (%.loc16_20.5, %.loc16_20.8, %.loc16_20.11) to %.loc16_20.2 [template = constants.%array]
// CHECK:STDOUT: %.loc16_11.1: init [i32; 3] = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array]
// CHECK:STDOUT: %.loc16_11.2: ref [i32; 3] = temporary %.loc16_20.2, %.loc16_11.1
// CHECK:STDOUT: %.loc16_11.3: [i32; 3] = bind_value %.loc16_11.2
// CHECK:STDOUT: %.loc16_20.12: init %.3 = array_init (%.loc16_20.5, %.loc16_20.8, %.loc16_20.11) to %.loc16_20.2 [template = constants.%array]
// CHECK:STDOUT: %.loc16_11.1: init %.3 = converted %.loc16_20.1, %.loc16_20.12 [template = constants.%array]
// CHECK:STDOUT: %.loc16_11.2: ref %.3 = temporary %.loc16_20.2, %.loc16_11.1
// CHECK:STDOUT: %.loc16_11.3: %.3 = bind_value %.loc16_11.2
// CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc16_11.3, %.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
+15 -15
View File
@@ -16,17 +16,17 @@ var b: i32 = a[{.index = 2}.index];
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template]
// CHECK:STDOUT: %.4: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.8: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: %array: %.3 = tuple_value (%.5, %.6, %.2) [template]
// CHECK:STDOUT: %.9: type = struct_type {.index: i32} [template]
// CHECK:STDOUT: %struct: {.index: i32} = struct_value (%.6) [template]
// CHECK:STDOUT: %struct: %.9 = struct_value (%.6) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -36,15 +36,15 @@ var b: i32 = a[{.index = 2}.index];
// CHECK:STDOUT: .b = %b
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref.1: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_14: i32 = int_literal 3 [template = constants.%.2]
// 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.%.3]
// CHECK:STDOUT: %a.var: ref [i32; 3] = var a
// CHECK:STDOUT: %a: ref [i32; 3] = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.2: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// 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]
@@ -59,7 +59,7 @@ var b: i32 = a[{.index = 2}.index];
// CHECK:STDOUT: %.loc11_20: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc11_23: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc11_26: i32 = int_literal 3 [template = constants.%.2]
// CHECK:STDOUT: %.loc11_27.1: (i32, i32, i32) = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26)
// CHECK:STDOUT: %.loc11_27.1: %.7 = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26)
// CHECK:STDOUT: %.loc11_27.2: i32 = int_literal 0 [template = constants.%.8]
// 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.%.5]
@@ -69,14 +69,14 @@ var b: i32 = a[{.index = 2}.index];
// CHECK:STDOUT: %.loc11_27.8: i32 = int_literal 2 [template = constants.%.6]
// 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.%.2]
// CHECK:STDOUT: %.loc11_27.11: init [i32; 3] = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc11_28: init [i32; 3] = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
// CHECK:STDOUT: %.loc11_27.11: init %.3 = array_init (%.loc11_27.4, %.loc11_27.7, %.loc11_27.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc11_28: init %.3 = converted %.loc11_27.1, %.loc11_27.11 [template = constants.%array]
// CHECK:STDOUT: assign file.%a.var, %.loc11_28
// CHECK:STDOUT: %a.ref: ref [i32; 3] = name_ref a, file.%a
// CHECK:STDOUT: %a.ref: ref %.3 = name_ref a, file.%a
// CHECK:STDOUT: %.loc12_26: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc12_27.1: {.index: i32} = struct_literal (%.loc12_26)
// CHECK:STDOUT: %struct: {.index: i32} = struct_value (%.loc12_26) [template = constants.%struct]
// CHECK:STDOUT: %.loc12_27.2: {.index: i32} = converted %.loc12_27.1, %struct [template = constants.%struct]
// CHECK:STDOUT: %.loc12_27.1: %.9 = struct_literal (%.loc12_26)
// CHECK:STDOUT: %struct: %.9 = struct_value (%.loc12_26) [template = constants.%struct]
// CHECK:STDOUT: %.loc12_27.2: %.9 = converted %.loc12_27.1, %struct [template = constants.%struct]
// CHECK:STDOUT: %.loc12_28: i32 = struct_access %.loc12_27.2, element0 [template = constants.%.6]
// CHECK:STDOUT: %.loc12_34.1: ref i32 = array_index %a.ref, %.loc12_28
// CHECK:STDOUT: %.loc12_34.2: i32 = bind_value %.loc12_34.1
+9 -9
View File
@@ -15,10 +15,10 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %.1: type = tuple_type () [template]
// CHECK:STDOUT: %Int32: <type of Int32> = struct_value () [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.2: i32 = int_literal 9 [template]
// CHECK:STDOUT: %.3: type = array_type %.2, i32 [template]
// CHECK:STDOUT: %.4: type = ptr_type [i32; 9] [template]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.7: i32 = int_literal 3 [template]
@@ -29,7 +29,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: %.12: i32 = int_literal 8 [template]
// CHECK:STDOUT: %.13: type = tuple_type (i32, i32, i32, i32, i32, i32, i32, i32, i32) [template]
// CHECK:STDOUT: %.14: i32 = int_literal 0 [template]
// CHECK:STDOUT: %array: [i32; 9] = tuple_value (%.5, %.6, %.7, %.8, %.9, %.10, %.11, %.12, %.2) [template]
// CHECK:STDOUT: %array: %.3 = tuple_value (%.5, %.6, %.7, %.8, %.9, %.10, %.11, %.12, %.2) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -38,14 +38,14 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: .a = %a
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %import_ref: <type of Int32> = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
// CHECK:STDOUT: %.loc11_14: i32 = int_literal 9 [template = constants.%.2]
// 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.%.3]
// CHECK:STDOUT: %a.var: ref [i32; 9] = var a
// CHECK:STDOUT: %a: ref [i32; 9] = bind_name a, %a.var
// CHECK:STDOUT: %a.var: ref %.3 = var a
// CHECK:STDOUT: %a: ref %.3 = bind_name a, %a.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
@@ -61,7 +61,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: %.loc11_38: i32 = int_literal 7 [template = constants.%.11]
// CHECK:STDOUT: %.loc11_41: i32 = int_literal 8 [template = constants.%.12]
// CHECK:STDOUT: %.loc11_44: i32 = int_literal 9 [template = constants.%.2]
// CHECK:STDOUT: %.loc11_45.1: (i32, i32, i32, i32, i32, i32, i32, i32, i32) = tuple_literal (%.loc11_20, %.loc11_23, %.loc11_26, %.loc11_29, %.loc11_32, %.loc11_35, %.loc11_38, %.loc11_41, %.loc11_44)
// CHECK:STDOUT: %.loc11_45.1: %.13 = 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_literal 0 [template = constants.%.14]
// 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.%.5]
@@ -89,8 +89,8 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: %.loc11_45.26: i32 = int_literal 8 [template = constants.%.12]
// 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.%.2]
// CHECK:STDOUT: %.loc11_45.29: init [i32; 9] = 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 [i32; 9] = converted %.loc11_45.1, %.loc11_45.29 [template = constants.%array]
// CHECK:STDOUT: %.loc11_45.29: init %.3 = 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 %.3 = converted %.loc11_45.1, %.loc11_45.29 [template = constants.%array]
// CHECK:STDOUT: assign file.%a.var, %.loc11_46
// CHECK:STDOUT: return
// CHECK:STDOUT: }