mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 18:01:07 +01:00
Ensure we evaluate instructions created in uncommon ways. (#3598)
Instructions created by splices during conversion are now evaluated, as are instructions created in cases where we first create a placeholder instruction and later replace it by a different instruction. This also removes the ability to set a parse node and instruction independently after creating an `InstId`, which could lead to them accidentally not matching.
This commit is contained in:
+4
-2
@@ -20,6 +20,8 @@ fn G() {
|
||||
// CHECK:STDOUT: %.5: type = array_type %.4, (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.6: type = ptr_type [(i32, i32, i32); 2] [template]
|
||||
// CHECK:STDOUT: %.7: type = tuple_type ((i32, i32, i32), (i32, i32, i32)) [template]
|
||||
// CHECK:STDOUT: %.8: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.9: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -40,13 +42,13 @@ fn G() {
|
||||
// CHECK:STDOUT: %v: ref [(i32, i32, i32); 2] = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %F.ref.loc10_34: <function> = name_ref F, file.%F [template = file.%F]
|
||||
// CHECK:STDOUT: %.loc10_42.3: ref (i32, i32, i32) = splice_block %.loc10_42.2 {
|
||||
// CHECK:STDOUT: %.loc10_42.1: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc10_42.1: i32 = int_literal 0 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc10_42.2: ref (i32, i32, i32) = array_index %v.var, %.loc10_42.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc10_35: init (i32, i32, i32) = call %F.ref.loc10_34() to %.loc10_42.3
|
||||
// CHECK:STDOUT: %F.ref.loc10_39: <function> = name_ref F, file.%F [template = file.%F]
|
||||
// CHECK:STDOUT: %.loc10_42.6: ref (i32, i32, i32) = splice_block %.loc10_42.5 {
|
||||
// CHECK:STDOUT: %.loc10_42.4: i32 = int_literal 1
|
||||
// CHECK:STDOUT: %.loc10_42.4: i32 = int_literal 1 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc10_42.5: ref (i32, i32, i32) = array_index %v.var, %.loc10_42.4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc10_40: init (i32, i32, i32) = call %F.ref.loc10_39() to %.loc10_42.6
|
||||
|
||||
@@ -20,6 +20,7 @@ fn Run() {
|
||||
// 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: %.8: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -49,7 +50,7 @@ fn Run() {
|
||||
// CHECK:STDOUT: %.loc10_22.3: ref (i32,) = temporary %.loc10_22.2, %.loc10_22.1
|
||||
// CHECK:STDOUT: %.loc10_22.4: ref i32 = tuple_access %.loc10_22.3, element0
|
||||
// CHECK:STDOUT: %.loc10_22.5: i32 = bind_value %.loc10_22.4
|
||||
// CHECK:STDOUT: %.loc10_22.6: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc10_22.6: i32 = int_literal 0 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc10_22.7: ref i32 = array_index %t.var, %.loc10_22.6
|
||||
// CHECK:STDOUT: %.loc10_22.8: init i32 = initialize_from %.loc10_22.5 to %.loc10_22.7
|
||||
// CHECK:STDOUT: %.loc10_22.9: init [i32; 1] = array_init (%.loc10_22.8) to %t.var
|
||||
|
||||
+6
-3
@@ -19,6 +19,9 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: %.7: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.8: type = array_type %.7, i32 [template]
|
||||
// CHECK:STDOUT: %.9: type = ptr_type [i32; 3] [template]
|
||||
// CHECK:STDOUT: %.10: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.11: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.12: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -47,17 +50,17 @@ var b: [i32; 3] = a;
|
||||
// CHECK:STDOUT: %a.ref: ref (i32, i32, i32) = name_ref a, %a
|
||||
// CHECK:STDOUT: %.loc8_19.1: ref i32 = tuple_access %a.ref, element0
|
||||
// CHECK:STDOUT: %.loc8_19.2: i32 = bind_value %.loc8_19.1
|
||||
// CHECK:STDOUT: %.loc8_19.3: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc8_19.3: i32 = int_literal 0 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc8_19.4: ref i32 = array_index %b.var, %.loc8_19.3
|
||||
// CHECK:STDOUT: %.loc8_19.5: init i32 = initialize_from %.loc8_19.2 to %.loc8_19.4
|
||||
// CHECK:STDOUT: %.loc8_19.6: ref i32 = tuple_access %a.ref, element1
|
||||
// CHECK:STDOUT: %.loc8_19.7: i32 = bind_value %.loc8_19.6
|
||||
// CHECK:STDOUT: %.loc8_19.8: i32 = int_literal 1
|
||||
// CHECK:STDOUT: %.loc8_19.8: i32 = int_literal 1 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc8_19.9: ref i32 = array_index %b.var, %.loc8_19.8
|
||||
// CHECK:STDOUT: %.loc8_19.10: init i32 = initialize_from %.loc8_19.7 to %.loc8_19.9
|
||||
// CHECK:STDOUT: %.loc8_19.11: ref i32 = tuple_access %a.ref, element2
|
||||
// CHECK:STDOUT: %.loc8_19.12: i32 = bind_value %.loc8_19.11
|
||||
// CHECK:STDOUT: %.loc8_19.13: i32 = int_literal 2
|
||||
// CHECK:STDOUT: %.loc8_19.13: i32 = int_literal 2 [template = constants.%.12]
|
||||
// CHECK:STDOUT: %.loc8_19.14: ref i32 = array_index %b.var, %.loc8_19.13
|
||||
// CHECK:STDOUT: %.loc8_19.15: init i32 = initialize_from %.loc8_19.12 to %.loc8_19.14
|
||||
// CHECK:STDOUT: %.loc8_19.16: init [i32; 3] = array_init (%.loc8_19.5, %.loc8_19.10, %.loc8_19.15) to %b.var
|
||||
|
||||
+34
-26
@@ -16,17 +16,25 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %.3: type = ptr_type [i32; 1] [template]
|
||||
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.5: type = tuple_type (i32) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.7: type = array_type %.6, f64 [template]
|
||||
// CHECK:STDOUT: %.8: type = ptr_type [f64; 2] [template]
|
||||
// CHECK:STDOUT: %.9: f64 = real_literal 111e-1 [template]
|
||||
// CHECK:STDOUT: %.10: f64 = real_literal 22e-1 [template]
|
||||
// CHECK:STDOUT: %.11: type = tuple_type (f64, f64) [template]
|
||||
// CHECK:STDOUT: %.12: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %.13: i32 = int_literal 5 [template]
|
||||
// CHECK:STDOUT: %.14: type = array_type %.13, () [template]
|
||||
// CHECK:STDOUT: %.15: type = ptr_type [(); 5] [template]
|
||||
// CHECK:STDOUT: %.16: type = tuple_type ((), (), (), (), ()) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.7: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.8: type = array_type %.7, f64 [template]
|
||||
// CHECK:STDOUT: %.9: type = ptr_type [f64; 2] [template]
|
||||
// CHECK:STDOUT: %.10: f64 = real_literal 111e-1 [template]
|
||||
// CHECK:STDOUT: %.11: f64 = real_literal 22e-1 [template]
|
||||
// CHECK:STDOUT: %.12: type = tuple_type (f64, f64) [template]
|
||||
// CHECK:STDOUT: %.13: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.14: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.15: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %.16: i32 = int_literal 5 [template]
|
||||
// CHECK:STDOUT: %.17: type = array_type %.16, () [template]
|
||||
// CHECK:STDOUT: %.18: type = ptr_type [(); 5] [template]
|
||||
// CHECK:STDOUT: %.19: type = tuple_type ((), (), (), (), ()) [template]
|
||||
// CHECK:STDOUT: %.20: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.21: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.22: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.23: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.24: i32 = int_literal 4 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -37,32 +45,32 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var
|
||||
// CHECK:STDOUT: %.loc7_20: i32 = int_literal 1 [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.loc7_22.1: (i32,) = tuple_literal (%.loc7_20)
|
||||
// CHECK:STDOUT: %.loc7_22.2: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc7_22.2: i32 = int_literal 0 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc7_22.3: ref i32 = array_index %a.var, %.loc7_22.2
|
||||
// CHECK:STDOUT: %.loc7_22.4: init i32 = initialize_from %.loc7_20 to %.loc7_22.3
|
||||
// CHECK:STDOUT: %.loc7_22.5: init [i32; 1] = array_init (%.loc7_22.4) to %a.var
|
||||
// CHECK:STDOUT: %.loc7_22.6: init [i32; 1] = converted %.loc7_22.1, %.loc7_22.5
|
||||
// CHECK:STDOUT: assign %a.var, %.loc7_22.6
|
||||
// CHECK:STDOUT: %.loc8_14: i32 = int_literal 2 [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, f64 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc8_14: i32 = int_literal 2 [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, f64 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %b.var: ref [f64; 2] = var b
|
||||
// CHECK:STDOUT: %b: ref [f64; 2] = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %.loc8_20: f64 = real_literal 111e-1 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc8_26: f64 = real_literal 22e-1 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc8_20: f64 = real_literal 111e-1 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc8_26: f64 = real_literal 22e-1 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc8_30.1: (f64, f64) = tuple_literal (%.loc8_20, %.loc8_26)
|
||||
// CHECK:STDOUT: %.loc8_30.2: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc8_30.2: i32 = int_literal 0 [template = constants.%.13]
|
||||
// CHECK:STDOUT: %.loc8_30.3: ref f64 = array_index %b.var, %.loc8_30.2
|
||||
// CHECK:STDOUT: %.loc8_30.4: init f64 = initialize_from %.loc8_20 to %.loc8_30.3
|
||||
// CHECK:STDOUT: %.loc8_30.5: i32 = int_literal 1
|
||||
// CHECK:STDOUT: %.loc8_30.5: i32 = int_literal 1 [template = constants.%.14]
|
||||
// CHECK:STDOUT: %.loc8_30.6: ref f64 = array_index %b.var, %.loc8_30.5
|
||||
// CHECK:STDOUT: %.loc8_30.7: init f64 = initialize_from %.loc8_26 to %.loc8_30.6
|
||||
// CHECK:STDOUT: %.loc8_30.8: init [f64; 2] = array_init (%.loc8_30.4, %.loc8_30.7) to %b.var
|
||||
// CHECK:STDOUT: %.loc8_30.9: init [f64; 2] = converted %.loc8_30.1, %.loc8_30.8
|
||||
// CHECK:STDOUT: assign %b.var, %.loc8_30.9
|
||||
// CHECK:STDOUT: %.loc9_10.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc9_13: i32 = int_literal 5 [template = constants.%.13]
|
||||
// CHECK:STDOUT: %.loc9_10.2: type = converted %.loc9_10.1, constants.%.12 [template = constants.%.12]
|
||||
// CHECK:STDOUT: %.loc9_14: type = array_type %.loc9_13, () [template = constants.%.14]
|
||||
// CHECK:STDOUT: %.loc9_13: i32 = int_literal 5 [template = constants.%.16]
|
||||
// CHECK:STDOUT: %.loc9_10.2: type = converted %.loc9_10.1, constants.%.15 [template = constants.%.15]
|
||||
// CHECK:STDOUT: %.loc9_14: type = array_type %.loc9_13, () [template = constants.%.17]
|
||||
// CHECK:STDOUT: %c.var: ref [(); 5] = var c
|
||||
// CHECK:STDOUT: %c: ref [(); 5] = bind_name c, %c.var
|
||||
// CHECK:STDOUT: %.loc9_20.1: () = tuple_literal ()
|
||||
@@ -71,23 +79,23 @@ var c: [(); 5] = ((), (), (), (), (),);
|
||||
// CHECK:STDOUT: %.loc9_32.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc9_36.1: () = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc9_38.1: ((), (), (), (), ()) = tuple_literal (%.loc9_20.1, %.loc9_24.1, %.loc9_28.1, %.loc9_32.1, %.loc9_36.1)
|
||||
// CHECK:STDOUT: %.loc9_38.2: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc9_38.2: i32 = int_literal 0 [template = constants.%.20]
|
||||
// CHECK:STDOUT: %.loc9_38.3: ref () = array_index %c.var, %.loc9_38.2
|
||||
// CHECK:STDOUT: %.loc9_20.2: init () = tuple_init () to %.loc9_38.3
|
||||
// CHECK:STDOUT: %.loc9_20.3: init () = converted %.loc9_20.1, %.loc9_20.2
|
||||
// CHECK:STDOUT: %.loc9_38.4: i32 = int_literal 1
|
||||
// CHECK:STDOUT: %.loc9_38.4: i32 = int_literal 1 [template = constants.%.21]
|
||||
// CHECK:STDOUT: %.loc9_38.5: ref () = array_index %c.var, %.loc9_38.4
|
||||
// CHECK:STDOUT: %.loc9_24.2: init () = tuple_init () to %.loc9_38.5
|
||||
// CHECK:STDOUT: %.loc9_24.3: init () = converted %.loc9_24.1, %.loc9_24.2
|
||||
// CHECK:STDOUT: %.loc9_38.6: i32 = int_literal 2
|
||||
// CHECK:STDOUT: %.loc9_38.6: i32 = int_literal 2 [template = constants.%.22]
|
||||
// CHECK:STDOUT: %.loc9_38.7: ref () = array_index %c.var, %.loc9_38.6
|
||||
// CHECK:STDOUT: %.loc9_28.2: init () = tuple_init () to %.loc9_38.7
|
||||
// CHECK:STDOUT: %.loc9_28.3: init () = converted %.loc9_28.1, %.loc9_28.2
|
||||
// CHECK:STDOUT: %.loc9_38.8: i32 = int_literal 3
|
||||
// CHECK:STDOUT: %.loc9_38.8: i32 = int_literal 3 [template = constants.%.23]
|
||||
// CHECK:STDOUT: %.loc9_38.9: ref () = array_index %c.var, %.loc9_38.8
|
||||
// CHECK:STDOUT: %.loc9_32.2: init () = tuple_init () to %.loc9_38.9
|
||||
// CHECK:STDOUT: %.loc9_32.3: init () = converted %.loc9_32.1, %.loc9_32.2
|
||||
// CHECK:STDOUT: %.loc9_38.10: i32 = int_literal 4
|
||||
// CHECK:STDOUT: %.loc9_38.10: i32 = int_literal 4 [template = constants.%.24]
|
||||
// CHECK:STDOUT: %.loc9_38.11: ref () = array_index %c.var, %.loc9_38.10
|
||||
// CHECK:STDOUT: %.loc9_36.2: init () = tuple_init () to %.loc9_38.11
|
||||
// CHECK:STDOUT: %.loc9_36.3: init () = converted %.loc9_36.1, %.loc9_36.2
|
||||
|
||||
+27
-23
@@ -37,20 +37,24 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: %.6: String = string_literal "Hello" [template]
|
||||
// CHECK:STDOUT: %.7: String = string_literal "World" [template]
|
||||
// CHECK:STDOUT: %.8: type = tuple_type (i32, String, String) [template]
|
||||
// CHECK:STDOUT: %.9: type = tuple_type (type, type, type) [template]
|
||||
// CHECK:STDOUT: %.10: type = tuple_type (i32, String*, String*) [template]
|
||||
// CHECK:STDOUT: %.11: type = ptr_type (i32, String*, String*) [template]
|
||||
// CHECK:STDOUT: %.12: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.13: type = array_type %.12, i32 [template]
|
||||
// CHECK:STDOUT: %.9: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.10: i32 = int_literal 1 [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: %.14: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.15: type = array_type %.14, i32 [template]
|
||||
// CHECK:STDOUT: %.16: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.17: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.18: type = tuple_type (i32, i32) [template]
|
||||
// CHECK:STDOUT: %.19: type = tuple_type (type, type) [template]
|
||||
// CHECK:STDOUT: %.20: type = ptr_type (i32, i32) [template]
|
||||
// CHECK:STDOUT: %.21: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.22: type = array_type %.21, i32 [template]
|
||||
// CHECK:STDOUT: %.16: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.17: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.18: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.19: type = array_type %.18, i32 [template]
|
||||
// CHECK:STDOUT: %.20: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.21: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.22: type = tuple_type (i32, i32) [template]
|
||||
// CHECK:STDOUT: %.23: type = tuple_type (type, type) [template]
|
||||
// CHECK:STDOUT: %.24: type = ptr_type (i32, i32) [template]
|
||||
// CHECK:STDOUT: %.25: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.26: type = array_type %.25, i32 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -63,7 +67,7 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: %.loc10_23: String = string_literal "Hello" [template = constants.%.6]
|
||||
// CHECK:STDOUT: %.loc10_32: String = string_literal "World" [template = constants.%.7]
|
||||
// CHECK:STDOUT: %.loc10_39.1: (i32, String, String) = tuple_literal (%.loc10_20, %.loc10_23, %.loc10_32)
|
||||
// CHECK:STDOUT: %.loc10_39.2: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc10_39.2: i32 = int_literal 0 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc10_39.3: ref i32 = array_index %a.var, %.loc10_39.2
|
||||
// CHECK:STDOUT: %.loc10_39.4: init i32 = initialize_from %.loc10_20 to %.loc10_39.3
|
||||
// CHECK:STDOUT: assign %a.var, <error>
|
||||
@@ -71,32 +75,32 @@ var d: [i32; 3] = t2;
|
||||
// CHECK:STDOUT: %.loc12_29.2: type = converted %.loc12_29.1, constants.%.8 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %t1.var: ref (i32, String, String) = var t1
|
||||
// CHECK:STDOUT: %t1: ref (i32, String, String) = bind_name t1, %t1.var
|
||||
// CHECK:STDOUT: %.loc16_14: i32 = int_literal 3 [template = constants.%.12]
|
||||
// CHECK:STDOUT: %.loc16_15: type = array_type %.loc16_14, i32 [template = constants.%.13]
|
||||
// CHECK:STDOUT: %.loc16_14: i32 = int_literal 3 [template = constants.%.14]
|
||||
// CHECK:STDOUT: %.loc16_15: type = array_type %.loc16_14, i32 [template = constants.%.15]
|
||||
// CHECK:STDOUT: %b.var: ref [i32; 3] = var b
|
||||
// CHECK:STDOUT: %b: ref [i32; 3] = bind_name b, %b.var
|
||||
// CHECK:STDOUT: %t1.ref: ref (i32, String, String) = name_ref t1, %t1
|
||||
// CHECK:STDOUT: %.loc16_19.1: ref i32 = tuple_access %t1.ref, element0
|
||||
// CHECK:STDOUT: %.loc16_19.2: i32 = bind_value %.loc16_19.1
|
||||
// CHECK:STDOUT: %.loc16_19.3: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc16_19.3: i32 = int_literal 0 [template = constants.%.16]
|
||||
// CHECK:STDOUT: %.loc16_19.4: ref i32 = array_index %b.var, %.loc16_19.3
|
||||
// CHECK:STDOUT: %.loc16_19.5: init i32 = initialize_from %.loc16_19.2 to %.loc16_19.4
|
||||
// CHECK:STDOUT: %.loc16_19.6: ref String = tuple_access %t1.ref, element1
|
||||
// CHECK:STDOUT: assign %b.var, <error>
|
||||
// CHECK:STDOUT: %.loc21_14: i32 = int_literal 3 [template = constants.%.14]
|
||||
// CHECK:STDOUT: %.loc21_15: type = array_type %.loc21_14, i32 [template = constants.%.15]
|
||||
// CHECK:STDOUT: %.loc21_14: i32 = int_literal 3 [template = constants.%.18]
|
||||
// CHECK:STDOUT: %.loc21_15: type = array_type %.loc21_14, i32 [template = constants.%.19]
|
||||
// CHECK:STDOUT: %c.var: ref [i32; 3] = var c
|
||||
// CHECK:STDOUT: %c: ref [i32; 3] = bind_name c, %c.var
|
||||
// CHECK:STDOUT: %.loc21_20: i32 = int_literal 1 [template = constants.%.16]
|
||||
// CHECK:STDOUT: %.loc21_23: i32 = int_literal 2 [template = constants.%.17]
|
||||
// CHECK:STDOUT: %.loc21_20: i32 = int_literal 1 [template = constants.%.20]
|
||||
// CHECK:STDOUT: %.loc21_23: i32 = int_literal 2 [template = constants.%.21]
|
||||
// CHECK:STDOUT: %.loc21_24: (i32, i32) = tuple_literal (%.loc21_20, %.loc21_23)
|
||||
// CHECK:STDOUT: assign %c.var, <error>
|
||||
// CHECK:STDOUT: %.loc23_18.1: (type, type) = tuple_literal (i32, i32)
|
||||
// CHECK:STDOUT: %.loc23_18.2: type = converted %.loc23_18.1, constants.%.18 [template = constants.%.18]
|
||||
// CHECK:STDOUT: %.loc23_18.2: type = converted %.loc23_18.1, constants.%.22 [template = constants.%.22]
|
||||
// CHECK:STDOUT: %t2.var: ref (i32, i32) = var t2
|
||||
// CHECK:STDOUT: %t2: ref (i32, i32) = bind_name t2, %t2.var
|
||||
// CHECK:STDOUT: %.loc27_14: i32 = int_literal 3 [template = constants.%.21]
|
||||
// CHECK:STDOUT: %.loc27_15: type = array_type %.loc27_14, i32 [template = constants.%.22]
|
||||
// CHECK:STDOUT: %.loc27_14: i32 = int_literal 3 [template = constants.%.25]
|
||||
// CHECK:STDOUT: %.loc27_15: type = array_type %.loc27_14, i32 [template = constants.%.26]
|
||||
// CHECK:STDOUT: %d.var: ref [i32; 3] = var d
|
||||
// CHECK:STDOUT: %d: ref [i32; 3] = bind_name d, %d.var
|
||||
// CHECK:STDOUT: %t2.ref: ref (i32, i32) = name_ref t2, %t2
|
||||
|
||||
+6
-3
@@ -23,6 +23,9 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %.6: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.7: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.8: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.9: i32 = int_literal 0 [template]
|
||||
// CHECK:STDOUT: %.10: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.11: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -50,13 +53,13 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %.loc12_20.1: (i32, i32, i32) = tuple_literal (%.loc12_13, %.loc12_16, %.loc12_19)
|
||||
// CHECK:STDOUT: %.loc12_23: i32 = int_literal 1 [template = constants.%.8]
|
||||
// CHECK:STDOUT: %.loc12_20.2: ref [i32; 3] = temporary_storage
|
||||
// CHECK:STDOUT: %.loc12_20.3: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc12_20.3: i32 = int_literal 0 [template = constants.%.9]
|
||||
// CHECK:STDOUT: %.loc12_20.4: ref i32 = array_index %.loc12_20.2, %.loc12_20.3
|
||||
// CHECK:STDOUT: %.loc12_20.5: init i32 = initialize_from %.loc12_13 to %.loc12_20.4
|
||||
// CHECK:STDOUT: %.loc12_20.6: i32 = int_literal 1
|
||||
// CHECK:STDOUT: %.loc12_20.6: i32 = int_literal 1 [template = constants.%.10]
|
||||
// CHECK:STDOUT: %.loc12_20.7: ref i32 = array_index %.loc12_20.2, %.loc12_20.6
|
||||
// CHECK:STDOUT: %.loc12_20.8: init i32 = initialize_from %.loc12_16 to %.loc12_20.7
|
||||
// CHECK:STDOUT: %.loc12_20.9: i32 = int_literal 2
|
||||
// CHECK:STDOUT: %.loc12_20.9: i32 = int_literal 2 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc12_20.10: ref i32 = array_index %.loc12_20.2, %.loc12_20.9
|
||||
// CHECK:STDOUT: %.loc12_20.11: init i32 = initialize_from %.loc12_19 to %.loc12_20.10
|
||||
// CHECK:STDOUT: %.loc12_20.12: init [i32; 3] = array_init (%.loc12_20.5, %.loc12_20.8, %.loc12_20.11) to %.loc12_20.2
|
||||
|
||||
+18
-9
@@ -22,6 +22,15 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
// CHECK:STDOUT: %.11: i32 = int_literal 8 [template]
|
||||
// CHECK:STDOUT: %.12: i32 = int_literal 9 [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: %.15: i32 = int_literal 1 [template]
|
||||
// CHECK:STDOUT: %.16: i32 = int_literal 2 [template]
|
||||
// CHECK:STDOUT: %.17: i32 = int_literal 3 [template]
|
||||
// CHECK:STDOUT: %.18: i32 = int_literal 4 [template]
|
||||
// CHECK:STDOUT: %.19: i32 = int_literal 5 [template]
|
||||
// CHECK:STDOUT: %.20: i32 = int_literal 6 [template]
|
||||
// CHECK:STDOUT: %.21: i32 = int_literal 7 [template]
|
||||
// CHECK:STDOUT: %.22: i32 = int_literal 8 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -40,31 +49,31 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
// CHECK:STDOUT: %.loc7_41: i32 = int_literal 8 [template = constants.%.11]
|
||||
// CHECK:STDOUT: %.loc7_44: i32 = int_literal 9 [template = constants.%.12]
|
||||
// CHECK:STDOUT: %.loc7_45.1: (i32, i32, i32, i32, i32, i32, i32, i32, i32) = tuple_literal (%.loc7_20, %.loc7_23, %.loc7_26, %.loc7_29, %.loc7_32, %.loc7_35, %.loc7_38, %.loc7_41, %.loc7_44)
|
||||
// CHECK:STDOUT: %.loc7_45.2: i32 = int_literal 0
|
||||
// CHECK:STDOUT: %.loc7_45.2: i32 = int_literal 0 [template = constants.%.14]
|
||||
// CHECK:STDOUT: %.loc7_45.3: ref i32 = array_index %a.var, %.loc7_45.2
|
||||
// CHECK:STDOUT: %.loc7_45.4: init i32 = initialize_from %.loc7_20 to %.loc7_45.3
|
||||
// CHECK:STDOUT: %.loc7_45.5: i32 = int_literal 1
|
||||
// CHECK:STDOUT: %.loc7_45.5: i32 = int_literal 1 [template = constants.%.15]
|
||||
// CHECK:STDOUT: %.loc7_45.6: ref i32 = array_index %a.var, %.loc7_45.5
|
||||
// CHECK:STDOUT: %.loc7_45.7: init i32 = initialize_from %.loc7_23 to %.loc7_45.6
|
||||
// CHECK:STDOUT: %.loc7_45.8: i32 = int_literal 2
|
||||
// CHECK:STDOUT: %.loc7_45.8: i32 = int_literal 2 [template = constants.%.16]
|
||||
// CHECK:STDOUT: %.loc7_45.9: ref i32 = array_index %a.var, %.loc7_45.8
|
||||
// CHECK:STDOUT: %.loc7_45.10: init i32 = initialize_from %.loc7_26 to %.loc7_45.9
|
||||
// CHECK:STDOUT: %.loc7_45.11: i32 = int_literal 3
|
||||
// CHECK:STDOUT: %.loc7_45.11: i32 = int_literal 3 [template = constants.%.17]
|
||||
// CHECK:STDOUT: %.loc7_45.12: ref i32 = array_index %a.var, %.loc7_45.11
|
||||
// CHECK:STDOUT: %.loc7_45.13: init i32 = initialize_from %.loc7_29 to %.loc7_45.12
|
||||
// CHECK:STDOUT: %.loc7_45.14: i32 = int_literal 4
|
||||
// CHECK:STDOUT: %.loc7_45.14: i32 = int_literal 4 [template = constants.%.18]
|
||||
// CHECK:STDOUT: %.loc7_45.15: ref i32 = array_index %a.var, %.loc7_45.14
|
||||
// CHECK:STDOUT: %.loc7_45.16: init i32 = initialize_from %.loc7_32 to %.loc7_45.15
|
||||
// CHECK:STDOUT: %.loc7_45.17: i32 = int_literal 5
|
||||
// CHECK:STDOUT: %.loc7_45.17: i32 = int_literal 5 [template = constants.%.19]
|
||||
// CHECK:STDOUT: %.loc7_45.18: ref i32 = array_index %a.var, %.loc7_45.17
|
||||
// CHECK:STDOUT: %.loc7_45.19: init i32 = initialize_from %.loc7_35 to %.loc7_45.18
|
||||
// CHECK:STDOUT: %.loc7_45.20: i32 = int_literal 6
|
||||
// CHECK:STDOUT: %.loc7_45.20: i32 = int_literal 6 [template = constants.%.20]
|
||||
// CHECK:STDOUT: %.loc7_45.21: ref i32 = array_index %a.var, %.loc7_45.20
|
||||
// CHECK:STDOUT: %.loc7_45.22: init i32 = initialize_from %.loc7_38 to %.loc7_45.21
|
||||
// CHECK:STDOUT: %.loc7_45.23: i32 = int_literal 7
|
||||
// CHECK:STDOUT: %.loc7_45.23: i32 = int_literal 7 [template = constants.%.21]
|
||||
// CHECK:STDOUT: %.loc7_45.24: ref i32 = array_index %a.var, %.loc7_45.23
|
||||
// CHECK:STDOUT: %.loc7_45.25: init i32 = initialize_from %.loc7_41 to %.loc7_45.24
|
||||
// CHECK:STDOUT: %.loc7_45.26: i32 = int_literal 8
|
||||
// CHECK:STDOUT: %.loc7_45.26: i32 = int_literal 8 [template = constants.%.22]
|
||||
// CHECK:STDOUT: %.loc7_45.27: ref i32 = array_index %a.var, %.loc7_45.26
|
||||
// CHECK:STDOUT: %.loc7_45.28: init i32 = initialize_from %.loc7_44 to %.loc7_45.27
|
||||
// CHECK:STDOUT: %.loc7_45.29: init [i32; 9] = array_init (%.loc7_45.4, %.loc7_45.7, %.loc7_45.10, %.loc7_45.13, %.loc7_45.16, %.loc7_45.19, %.loc7_45.22, %.loc7_45.25, %.loc7_45.28) to %a.var
|
||||
|
||||
Reference in New Issue
Block a user