aggregate.carbon 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/eval/aggregate.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/eval/aggregate.carbon
  10. var tuple_copy: (i32, i32) = (1, 2) as (i32, i32);
  11. var struct_copy: {.a: i32, .b: i32, .c: i32} = {.c = 3, .b = 2, .a = 1} as {.b: i32, .a: i32, .c: i32};
  12. var tuple_index: [i32; 1] = (0,) as [i32; (5, 7, 1, 9).2];
  13. var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b];
  14. // CHECK:STDOUT: --- aggregate.carbon
  15. // CHECK:STDOUT:
  16. // CHECK:STDOUT: constants {
  17. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  18. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  19. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
  20. // CHECK:STDOUT: %tuple.type.471: type = tuple_type (%i32, %i32) [template]
  21. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
  22. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  23. // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  24. // CHECK:STDOUT: %Convert.type.cd1: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  25. // CHECK:STDOUT: %impl_witness.5b0: <witness> = impl_witness (imports.%import_ref.723), @impl.1(%int_32) [template]
  26. // CHECK:STDOUT: %Convert.type.466: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  27. // CHECK:STDOUT: %Convert.925: %Convert.type.466 = struct_value () [template]
  28. // CHECK:STDOUT: %Convert.bound.afd: <bound method> = bound_method %int_1.5b8, %Convert.925 [template]
  29. // CHECK:STDOUT: %Convert.specific_fn.b73: <specific function> = specific_function %Convert.bound.afd, @Convert.2(%int_32) [template]
  30. // CHECK:STDOUT: %int_1.c60: %i32 = int_value 1 [template]
  31. // CHECK:STDOUT: %Convert.bound.f0b: <bound method> = bound_method %int_2.ecc, %Convert.925 [template]
  32. // CHECK:STDOUT: %Convert.specific_fn.20e: <specific function> = specific_function %Convert.bound.f0b, @Convert.2(%int_32) [template]
  33. // CHECK:STDOUT: %int_2.166: %i32 = int_value 2 [template]
  34. // CHECK:STDOUT: %tuple.58e: %tuple.type.471 = tuple_value (%int_1.c60, %int_2.166) [template]
  35. // CHECK:STDOUT: %struct_type.a.b.c: type = struct_type {.a: %i32, .b: %i32, .c: %i32} [template]
  36. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
  37. // CHECK:STDOUT: %struct_type.c.b.a: type = struct_type {.c: Core.IntLiteral, .b: Core.IntLiteral, .a: Core.IntLiteral} [template]
  38. // CHECK:STDOUT: %struct_type.b.a.c: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [template]
  39. // CHECK:STDOUT: %Convert.bound.0db: <bound method> = bound_method %int_3.1ba, %Convert.925 [template]
  40. // CHECK:STDOUT: %Convert.specific_fn.456: <specific function> = specific_function %Convert.bound.0db, @Convert.2(%int_32) [template]
  41. // CHECK:STDOUT: %int_3.25b: %i32 = int_value 3 [template]
  42. // CHECK:STDOUT: %struct.de7: %struct_type.b.a.c = struct_value (%int_2.166, %int_1.c60, %int_3.25b) [template]
  43. // CHECK:STDOUT: %struct.cca: %struct_type.a.b.c = struct_value (%int_1.c60, %int_2.166, %int_3.25b) [template]
  44. // CHECK:STDOUT: %array_type: type = array_type %int_1.5b8, %i32 [template]
  45. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
  46. // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template]
  47. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template]
  48. // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template]
  49. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template]
  50. // CHECK:STDOUT: %tuple.type.d46: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template]
  51. // CHECK:STDOUT: %tuple.869: %tuple.type.d46 = tuple_value (%int_5, %int_7, %int_1.5b8, %int_9) [template]
  52. // CHECK:STDOUT: %Convert.bound.b41: <bound method> = bound_method %int_0.5c6, %Convert.925 [template]
  53. // CHECK:STDOUT: %Convert.specific_fn.c35: <specific function> = specific_function %Convert.bound.b41, @Convert.2(%int_32) [template]
  54. // CHECK:STDOUT: %int_0.f61: %i32 = int_value 0 [template]
  55. // CHECK:STDOUT: %array: %array_type = tuple_value (%int_0.f61) [template]
  56. // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template]
  57. // CHECK:STDOUT: %struct.a81: %struct_type.a.b = struct_value (%int_3.1ba, %int_1.5b8) [template]
  58. // CHECK:STDOUT: }
  59. // CHECK:STDOUT:
  60. // CHECK:STDOUT: imports {
  61. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  62. // CHECK:STDOUT: .Int = %import_ref.187
  63. // CHECK:STDOUT: .ImplicitAs = %import_ref.a69
  64. // CHECK:STDOUT: import Core//prelude
  65. // CHECK:STDOUT: import Core//prelude/...
  66. // CHECK:STDOUT: }
  67. // CHECK:STDOUT: }
  68. // CHECK:STDOUT:
  69. // CHECK:STDOUT: file {
  70. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  71. // CHECK:STDOUT: .Core = imports.%Core
  72. // CHECK:STDOUT: .tuple_copy = %tuple_copy
  73. // CHECK:STDOUT: .struct_copy = %struct_copy
  74. // CHECK:STDOUT: .tuple_index = %tuple_index
  75. // CHECK:STDOUT: .struct_access = %struct_access
  76. // CHECK:STDOUT: }
  77. // CHECK:STDOUT: %Core.import = import Core
  78. // CHECK:STDOUT: %tuple_copy.var: ref %tuple.type.471 = var tuple_copy
  79. // CHECK:STDOUT: %tuple_copy: ref %tuple.type.471 = bind_name tuple_copy, %tuple_copy.var
  80. // CHECK:STDOUT: %struct_copy.var: ref %struct_type.a.b.c = var struct_copy
  81. // CHECK:STDOUT: %struct_copy: ref %struct_type.a.b.c = bind_name struct_copy, %struct_copy.var
  82. // CHECK:STDOUT: %tuple_index.var: ref %array_type = var tuple_index
  83. // CHECK:STDOUT: %tuple_index: ref %array_type = bind_name tuple_index, %tuple_index.var
  84. // CHECK:STDOUT: %struct_access.var: ref %array_type = var struct_access
  85. // CHECK:STDOUT: %struct_access: ref %array_type = bind_name struct_access, %struct_access.var
  86. // CHECK:STDOUT: }
  87. // CHECK:STDOUT:
  88. // CHECK:STDOUT: fn @__global_init() {
  89. // CHECK:STDOUT: !entry:
  90. // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  91. // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  92. // CHECK:STDOUT: %.loc11_35.1: %tuple.type.f94 = tuple_literal (%int_1.loc11, %int_2.loc11)
  93. // CHECK:STDOUT: %int_32.loc11_41: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  94. // CHECK:STDOUT: %i32.loc11_41: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  95. // CHECK:STDOUT: %int_32.loc11_46: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  96. // CHECK:STDOUT: %i32.loc11_46: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  97. // CHECK:STDOUT: %.loc11_49.1: %tuple.type.24b = tuple_literal (%i32.loc11_41, %i32.loc11_46)
  98. // CHECK:STDOUT: %.loc11_49.2: type = converted %.loc11_49.1, constants.%tuple.type.471 [template = constants.%tuple.type.471]
  99. // CHECK:STDOUT: %impl.elem0.loc11_35.1: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  100. // CHECK:STDOUT: %Convert.bound.loc11_35.1: <bound method> = bound_method %int_1.loc11, %impl.elem0.loc11_35.1 [template = constants.%Convert.bound.afd]
  101. // CHECK:STDOUT: %Convert.specific_fn.loc11_35.1: <specific function> = specific_function %Convert.bound.loc11_35.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b73]
  102. // CHECK:STDOUT: %int.convert_checked.loc11_35.1: init %i32 = call %Convert.specific_fn.loc11_35.1(%int_1.loc11) [template = constants.%int_1.c60]
  103. // CHECK:STDOUT: %.loc11_35.2: %i32 = value_of_initializer %int.convert_checked.loc11_35.1 [template = constants.%int_1.c60]
  104. // CHECK:STDOUT: %.loc11_35.3: %i32 = converted %int_1.loc11, %.loc11_35.2 [template = constants.%int_1.c60]
  105. // CHECK:STDOUT: %impl.elem0.loc11_35.2: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  106. // CHECK:STDOUT: %Convert.bound.loc11_35.2: <bound method> = bound_method %int_2.loc11, %impl.elem0.loc11_35.2 [template = constants.%Convert.bound.f0b]
  107. // CHECK:STDOUT: %Convert.specific_fn.loc11_35.2: <specific function> = specific_function %Convert.bound.loc11_35.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.20e]
  108. // CHECK:STDOUT: %int.convert_checked.loc11_35.2: init %i32 = call %Convert.specific_fn.loc11_35.2(%int_2.loc11) [template = constants.%int_2.166]
  109. // CHECK:STDOUT: %.loc11_35.4: %i32 = value_of_initializer %int.convert_checked.loc11_35.2 [template = constants.%int_2.166]
  110. // CHECK:STDOUT: %.loc11_35.5: %i32 = converted %int_2.loc11, %.loc11_35.4 [template = constants.%int_2.166]
  111. // CHECK:STDOUT: %tuple.loc11: %tuple.type.471 = tuple_value (%.loc11_35.3, %.loc11_35.5) [template = constants.%tuple.58e]
  112. // CHECK:STDOUT: %.loc11_37.1: %tuple.type.471 = converted %.loc11_35.1, %tuple.loc11 [template = constants.%tuple.58e]
  113. // CHECK:STDOUT: %tuple.elem0.loc11_37.1: %i32 = tuple_access %.loc11_37.1, element0 [template = constants.%int_1.c60]
  114. // CHECK:STDOUT: %tuple.elem0.loc11_37.2: ref %i32 = tuple_access file.%tuple_copy.var, element0
  115. // CHECK:STDOUT: %.loc11_37.2: init %i32 = initialize_from %tuple.elem0.loc11_37.1 to %tuple.elem0.loc11_37.2 [template = constants.%int_1.c60]
  116. // CHECK:STDOUT: %tuple.elem1.loc11_37.1: %i32 = tuple_access %.loc11_37.1, element1 [template = constants.%int_2.166]
  117. // CHECK:STDOUT: %tuple.elem1.loc11_37.2: ref %i32 = tuple_access file.%tuple_copy.var, element1
  118. // CHECK:STDOUT: %.loc11_37.3: init %i32 = initialize_from %tuple.elem1.loc11_37.1 to %tuple.elem1.loc11_37.2 [template = constants.%int_2.166]
  119. // CHECK:STDOUT: %.loc11_37.4: init %tuple.type.471 = tuple_init (%.loc11_37.2, %.loc11_37.3) to file.%tuple_copy.var [template = constants.%tuple.58e]
  120. // CHECK:STDOUT: %.loc11_50: init %tuple.type.471 = converted %.loc11_37.1, %.loc11_37.4 [template = constants.%tuple.58e]
  121. // CHECK:STDOUT: assign file.%tuple_copy.var, %.loc11_50
  122. // CHECK:STDOUT: %int_3.loc13: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
  123. // CHECK:STDOUT: %int_2.loc13: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  124. // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  125. // CHECK:STDOUT: %.loc13_71.1: %struct_type.c.b.a = struct_literal (%int_3.loc13, %int_2.loc13, %int_1.loc13)
  126. // CHECK:STDOUT: %int_32.loc13_81: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  127. // CHECK:STDOUT: %i32.loc13_81: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  128. // CHECK:STDOUT: %int_32.loc13_90: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  129. // CHECK:STDOUT: %i32.loc13_90: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  130. // CHECK:STDOUT: %int_32.loc13_99: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  131. // CHECK:STDOUT: %i32.loc13_99: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  132. // CHECK:STDOUT: %struct_type.b.a.c: type = struct_type {.b: %i32, .a: %i32, .c: %i32} [template = constants.%struct_type.b.a.c]
  133. // CHECK:STDOUT: %impl.elem0.loc13_71.1: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  134. // CHECK:STDOUT: %Convert.bound.loc13_71.1: <bound method> = bound_method %int_2.loc13, %impl.elem0.loc13_71.1 [template = constants.%Convert.bound.f0b]
  135. // CHECK:STDOUT: %Convert.specific_fn.loc13_71.1: <specific function> = specific_function %Convert.bound.loc13_71.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.20e]
  136. // CHECK:STDOUT: %int.convert_checked.loc13_71.1: init %i32 = call %Convert.specific_fn.loc13_71.1(%int_2.loc13) [template = constants.%int_2.166]
  137. // CHECK:STDOUT: %.loc13_71.2: %i32 = value_of_initializer %int.convert_checked.loc13_71.1 [template = constants.%int_2.166]
  138. // CHECK:STDOUT: %.loc13_71.3: %i32 = converted %int_2.loc13, %.loc13_71.2 [template = constants.%int_2.166]
  139. // CHECK:STDOUT: %impl.elem0.loc13_71.2: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  140. // CHECK:STDOUT: %Convert.bound.loc13_71.2: <bound method> = bound_method %int_1.loc13, %impl.elem0.loc13_71.2 [template = constants.%Convert.bound.afd]
  141. // CHECK:STDOUT: %Convert.specific_fn.loc13_71.2: <specific function> = specific_function %Convert.bound.loc13_71.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b73]
  142. // CHECK:STDOUT: %int.convert_checked.loc13_71.2: init %i32 = call %Convert.specific_fn.loc13_71.2(%int_1.loc13) [template = constants.%int_1.c60]
  143. // CHECK:STDOUT: %.loc13_71.4: %i32 = value_of_initializer %int.convert_checked.loc13_71.2 [template = constants.%int_1.c60]
  144. // CHECK:STDOUT: %.loc13_71.5: %i32 = converted %int_1.loc13, %.loc13_71.4 [template = constants.%int_1.c60]
  145. // CHECK:STDOUT: %impl.elem0.loc13_71.3: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  146. // CHECK:STDOUT: %Convert.bound.loc13_71.3: <bound method> = bound_method %int_3.loc13, %impl.elem0.loc13_71.3 [template = constants.%Convert.bound.0db]
  147. // CHECK:STDOUT: %Convert.specific_fn.loc13_71.3: <specific function> = specific_function %Convert.bound.loc13_71.3, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.456]
  148. // CHECK:STDOUT: %int.convert_checked.loc13_71.3: init %i32 = call %Convert.specific_fn.loc13_71.3(%int_3.loc13) [template = constants.%int_3.25b]
  149. // CHECK:STDOUT: %.loc13_71.6: %i32 = value_of_initializer %int.convert_checked.loc13_71.3 [template = constants.%int_3.25b]
  150. // CHECK:STDOUT: %.loc13_71.7: %i32 = converted %int_3.loc13, %.loc13_71.6 [template = constants.%int_3.25b]
  151. // CHECK:STDOUT: %struct.loc13: %struct_type.b.a.c = struct_value (%.loc13_71.3, %.loc13_71.5, %.loc13_71.7) [template = constants.%struct.de7]
  152. // CHECK:STDOUT: %.loc13_73.1: %struct_type.b.a.c = converted %.loc13_71.1, %struct.loc13 [template = constants.%struct.de7]
  153. // CHECK:STDOUT: %.loc13_73.2: %i32 = struct_access %.loc13_73.1, element1 [template = constants.%int_1.c60]
  154. // CHECK:STDOUT: %.loc13_73.3: ref %i32 = struct_access file.%struct_copy.var, element1
  155. // CHECK:STDOUT: %.loc13_73.4: init %i32 = initialize_from %.loc13_73.2 to %.loc13_73.3 [template = constants.%int_1.c60]
  156. // CHECK:STDOUT: %.loc13_73.5: %i32 = struct_access %.loc13_73.1, element0 [template = constants.%int_2.166]
  157. // CHECK:STDOUT: %.loc13_73.6: ref %i32 = struct_access file.%struct_copy.var, element0
  158. // CHECK:STDOUT: %.loc13_73.7: init %i32 = initialize_from %.loc13_73.5 to %.loc13_73.6 [template = constants.%int_2.166]
  159. // CHECK:STDOUT: %.loc13_73.8: %i32 = struct_access %.loc13_73.1, element2 [template = constants.%int_3.25b]
  160. // CHECK:STDOUT: %.loc13_73.9: ref %i32 = struct_access file.%struct_copy.var, element2
  161. // CHECK:STDOUT: %.loc13_73.10: init %i32 = initialize_from %.loc13_73.8 to %.loc13_73.9 [template = constants.%int_3.25b]
  162. // CHECK:STDOUT: %.loc13_73.11: init %struct_type.a.b.c = struct_init (%.loc13_73.4, %.loc13_73.7, %.loc13_73.10) to file.%struct_copy.var [template = constants.%struct.cca]
  163. // CHECK:STDOUT: %.loc13_103: init %struct_type.a.b.c = converted %.loc13_73.1, %.loc13_73.11 [template = constants.%struct.cca]
  164. // CHECK:STDOUT: assign file.%struct_copy.var, %.loc13_103
  165. // CHECK:STDOUT: %int_0.loc15_30: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  166. // CHECK:STDOUT: %.loc15_32.1: %tuple.type.985 = tuple_literal (%int_0.loc15_30)
  167. // CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  168. // CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  169. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5]
  170. // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7]
  171. // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  172. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9]
  173. // CHECK:STDOUT: %.loc15_54.1: %tuple.type.d46 = tuple_literal (%int_5, %int_7, %int_1.loc15, %int_9)
  174. // CHECK:STDOUT: %int_2.loc15: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  175. // CHECK:STDOUT: %tuple.loc15: %tuple.type.d46 = tuple_value (%int_5, %int_7, %int_1.loc15, %int_9) [template = constants.%tuple.869]
  176. // CHECK:STDOUT: %.loc15_54.2: %tuple.type.d46 = converted %.loc15_54.1, %tuple.loc15 [template = constants.%tuple.869]
  177. // CHECK:STDOUT: %tuple.elem2: Core.IntLiteral = tuple_access %.loc15_54.2, element2 [template = constants.%int_1.5b8]
  178. // CHECK:STDOUT: %array_type.loc15: type = array_type %tuple.elem2, %i32 [template = constants.%array_type]
  179. // CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  180. // CHECK:STDOUT: %Convert.bound.loc15: <bound method> = bound_method %int_0.loc15_30, %impl.elem0.loc15 [template = constants.%Convert.bound.b41]
  181. // CHECK:STDOUT: %Convert.specific_fn.loc15: <specific function> = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c35]
  182. // CHECK:STDOUT: %int.convert_checked.loc15: init %i32 = call %Convert.specific_fn.loc15(%int_0.loc15_30) [template = constants.%int_0.f61]
  183. // CHECK:STDOUT: %.loc15_32.2: init %i32 = converted %int_0.loc15_30, %int.convert_checked.loc15 [template = constants.%int_0.f61]
  184. // CHECK:STDOUT: %.loc15_5: ref %array_type = splice_block file.%tuple_index.var {}
  185. // CHECK:STDOUT: %int_0.loc15_32: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  186. // CHECK:STDOUT: %.loc15_32.3: ref %i32 = array_index %.loc15_5, %int_0.loc15_32
  187. // CHECK:STDOUT: %.loc15_32.4: init %i32 = initialize_from %.loc15_32.2 to %.loc15_32.3 [template = constants.%int_0.f61]
  188. // CHECK:STDOUT: %.loc15_32.5: init %array_type = array_init (%.loc15_32.4) to %.loc15_5 [template = constants.%array]
  189. // CHECK:STDOUT: %.loc15_34: init %array_type = converted %.loc15_32.1, %.loc15_32.5 [template = constants.%array]
  190. // CHECK:STDOUT: assign file.%tuple_index.var, %.loc15_34
  191. // CHECK:STDOUT: %int_0.loc17_32: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  192. // CHECK:STDOUT: %.loc17_34.1: %tuple.type.985 = tuple_literal (%int_0.loc17_32)
  193. // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  194. // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  195. // CHECK:STDOUT: %int_3.loc17: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
  196. // CHECK:STDOUT: %int_1.loc17: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  197. // CHECK:STDOUT: %.loc17_60.1: %struct_type.a.b = struct_literal (%int_3.loc17, %int_1.loc17)
  198. // CHECK:STDOUT: %struct.loc17: %struct_type.a.b = struct_value (%int_3.loc17, %int_1.loc17) [template = constants.%struct.a81]
  199. // CHECK:STDOUT: %.loc17_60.2: %struct_type.a.b = converted %.loc17_60.1, %struct.loc17 [template = constants.%struct.a81]
  200. // CHECK:STDOUT: %.loc17_61: Core.IntLiteral = struct_access %.loc17_60.2, element1 [template = constants.%int_1.5b8]
  201. // CHECK:STDOUT: %array_type.loc17: type = array_type %.loc17_61, %i32 [template = constants.%array_type]
  202. // CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  203. // CHECK:STDOUT: %Convert.bound.loc17: <bound method> = bound_method %int_0.loc17_32, %impl.elem0.loc17 [template = constants.%Convert.bound.b41]
  204. // CHECK:STDOUT: %Convert.specific_fn.loc17: <specific function> = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c35]
  205. // CHECK:STDOUT: %int.convert_checked.loc17: init %i32 = call %Convert.specific_fn.loc17(%int_0.loc17_32) [template = constants.%int_0.f61]
  206. // CHECK:STDOUT: %.loc17_34.2: init %i32 = converted %int_0.loc17_32, %int.convert_checked.loc17 [template = constants.%int_0.f61]
  207. // CHECK:STDOUT: %.loc17_5: ref %array_type = splice_block file.%struct_access.var {}
  208. // CHECK:STDOUT: %int_0.loc17_34: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  209. // CHECK:STDOUT: %.loc17_34.3: ref %i32 = array_index %.loc17_5, %int_0.loc17_34
  210. // CHECK:STDOUT: %.loc17_34.4: init %i32 = initialize_from %.loc17_34.2 to %.loc17_34.3 [template = constants.%int_0.f61]
  211. // CHECK:STDOUT: %.loc17_34.5: init %array_type = array_init (%.loc17_34.4) to %.loc17_5 [template = constants.%array]
  212. // CHECK:STDOUT: %.loc17_36: init %array_type = converted %.loc17_34.1, %.loc17_34.5 [template = constants.%array]
  213. // CHECK:STDOUT: assign file.%struct_access.var, %.loc17_36
  214. // CHECK:STDOUT: return
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT: