import.carbon 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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/function/builtin/no_prelude/import.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/no_prelude/import.carbon
  10. // --- core.carbon
  11. package Core library "[[@TEST_NAME]]";
  12. fn IntLiteral() -> type = "int_literal.make_type";
  13. fn Int(N: IntLiteral()) -> type = "int.make_type_signed";
  14. fn AsI32(a: IntLiteral()) -> i32 = "int.convert_checked";
  15. fn AsIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked";
  16. fn TestAdd(a: i32, b: i32) -> i32 = "int.sadd";
  17. // --- use.carbon
  18. import Core library "core";
  19. var arr: [i32; Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)))] = (Core.AsI32(1), Core.AsI32(2), Core.AsI32(3));
  20. // CHECK:STDOUT: --- core.carbon
  21. // CHECK:STDOUT:
  22. // CHECK:STDOUT: constants {
  23. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
  24. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
  25. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  26. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  27. // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template]
  28. // CHECK:STDOUT: %i32: type = int_type signed, %.1 [template]
  29. // CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [template]
  30. // CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [template]
  31. // CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template]
  32. // CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template]
  33. // CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template]
  34. // CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template]
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: file {
  38. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  39. // CHECK:STDOUT: .IntLiteral = %IntLiteral.decl
  40. // CHECK:STDOUT: .Int = %Int.decl
  41. // CHECK:STDOUT: .AsI32 = %AsI32.decl
  42. // CHECK:STDOUT: .AsIntLiteral = %AsIntLiteral.decl
  43. // CHECK:STDOUT: .TestAdd = %TestAdd.decl
  44. // CHECK:STDOUT: }
  45. // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] {
  46. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  47. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0
  48. // CHECK:STDOUT: } {
  49. // CHECK:STDOUT: %return.param: ref type = out_param runtime_param0
  50. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  51. // CHECK:STDOUT: }
  52. // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] {
  53. // CHECK:STDOUT: %N.patt: Core.IntLiteral = binding_pattern N
  54. // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt, runtime_param0
  55. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  56. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1
  57. // CHECK:STDOUT: } {
  58. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  59. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  60. // CHECK:STDOUT: %.loc6_22.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  61. // CHECK:STDOUT: %.loc6_22.2: type = converted %int_literal.make_type, %.loc6_22.1 [template = Core.IntLiteral]
  62. // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param0
  63. // CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param
  64. // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1
  65. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  66. // CHECK:STDOUT: }
  67. // CHECK:STDOUT: %AsI32.decl: %AsI32.type = fn_decl @AsI32 [template = constants.%AsI32] {
  68. // CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a
  69. // CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0
  70. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  71. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  72. // CHECK:STDOUT: } {
  73. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  74. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  75. // CHECK:STDOUT: %.loc8_24.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  76. // CHECK:STDOUT: %.loc8_24.2: type = converted %int_literal.make_type, %.loc8_24.1 [template = Core.IntLiteral]
  77. // CHECK:STDOUT: %.loc8_30.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
  78. // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_30.1) [template = constants.%i32]
  79. // CHECK:STDOUT: %.loc8_30.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
  80. // CHECK:STDOUT: %.loc8_30.3: type = converted %int.make_type_signed, %.loc8_30.2 [template = constants.%i32]
  81. // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0
  82. // CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param
  83. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  84. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  85. // CHECK:STDOUT: }
  86. // CHECK:STDOUT: %AsIntLiteral.decl: %AsIntLiteral.type = fn_decl @AsIntLiteral [template = constants.%AsIntLiteral] {
  87. // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
  88. // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
  89. // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
  90. // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
  91. // CHECK:STDOUT: } {
  92. // CHECK:STDOUT: %.loc9_20.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
  93. // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc9_20.1) [template = constants.%i32]
  94. // CHECK:STDOUT: %.loc9_20.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
  95. // CHECK:STDOUT: %.loc9_20.3: type = converted %int.make_type_signed, %.loc9_20.2 [template = constants.%i32]
  96. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  97. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  98. // CHECK:STDOUT: %.loc9_39.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  99. // CHECK:STDOUT: %.loc9_39.2: type = converted %int_literal.make_type, %.loc9_39.1 [template = Core.IntLiteral]
  100. // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
  101. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  102. // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
  103. // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
  104. // CHECK:STDOUT: }
  105. // CHECK:STDOUT: %TestAdd.decl: %TestAdd.type = fn_decl @TestAdd [template = constants.%TestAdd] {
  106. // CHECK:STDOUT: %a.patt: %i32 = binding_pattern a
  107. // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0
  108. // CHECK:STDOUT: %b.patt: %i32 = binding_pattern b
  109. // CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1
  110. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  111. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2
  112. // CHECK:STDOUT: } {
  113. // CHECK:STDOUT: %.loc11_15.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
  114. // CHECK:STDOUT: %int.make_type_signed.loc11_15: init type = call constants.%Int(%.loc11_15.1) [template = constants.%i32]
  115. // CHECK:STDOUT: %.loc11_15.2: type = value_of_initializer %int.make_type_signed.loc11_15 [template = constants.%i32]
  116. // CHECK:STDOUT: %.loc11_15.3: type = converted %int.make_type_signed.loc11_15, %.loc11_15.2 [template = constants.%i32]
  117. // CHECK:STDOUT: %.loc11_23.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
  118. // CHECK:STDOUT: %int.make_type_signed.loc11_23: init type = call constants.%Int(%.loc11_23.1) [template = constants.%i32]
  119. // CHECK:STDOUT: %.loc11_23.2: type = value_of_initializer %int.make_type_signed.loc11_23 [template = constants.%i32]
  120. // CHECK:STDOUT: %.loc11_23.3: type = converted %int.make_type_signed.loc11_23, %.loc11_23.2 [template = constants.%i32]
  121. // CHECK:STDOUT: %.loc11_31.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
  122. // CHECK:STDOUT: %int.make_type_signed.loc11_31: init type = call constants.%Int(%.loc11_31.1) [template = constants.%i32]
  123. // CHECK:STDOUT: %.loc11_31.2: type = value_of_initializer %int.make_type_signed.loc11_31 [template = constants.%i32]
  124. // CHECK:STDOUT: %.loc11_31.3: type = converted %int.make_type_signed.loc11_31, %.loc11_31.2 [template = constants.%i32]
  125. // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0
  126. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  127. // CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1
  128. // CHECK:STDOUT: %b: %i32 = bind_name b, %b.param
  129. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2
  130. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT: }
  133. // CHECK:STDOUT:
  134. // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type";
  135. // CHECK:STDOUT:
  136. // CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed";
  137. // CHECK:STDOUT:
  138. // CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> %i32 = "int.convert_checked";
  139. // CHECK:STDOUT:
  140. // CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked";
  141. // CHECK:STDOUT:
  142. // CHECK:STDOUT: fn @TestAdd(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd";
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: --- use.carbon
  145. // CHECK:STDOUT:
  146. // CHECK:STDOUT: constants {
  147. // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template]
  148. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  149. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  150. // CHECK:STDOUT: %i32: type = int_type signed, %.1 [template]
  151. // CHECK:STDOUT: %AsIntLiteral.type: type = fn_type @AsIntLiteral [template]
  152. // CHECK:STDOUT: %AsIntLiteral: %AsIntLiteral.type = struct_value () [template]
  153. // CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template]
  154. // CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template]
  155. // CHECK:STDOUT: %AsI32.type: type = fn_type @AsI32 [template]
  156. // CHECK:STDOUT: %AsI32: %AsI32.type = struct_value () [template]
  157. // CHECK:STDOUT: %.2: Core.IntLiteral = int_value 1 [template]
  158. // CHECK:STDOUT: %.3: %i32 = int_value 1 [template]
  159. // CHECK:STDOUT: %.4: Core.IntLiteral = int_value 2 [template]
  160. // CHECK:STDOUT: %.5: %i32 = int_value 2 [template]
  161. // CHECK:STDOUT: %.6: %i32 = int_value 3 [template]
  162. // CHECK:STDOUT: %.7: Core.IntLiteral = int_value 3 [template]
  163. // CHECK:STDOUT: %.8: type = array_type %.7, %i32 [template]
  164. // CHECK:STDOUT: %tuple.type: type = tuple_type (%i32, %i32, %i32) [template]
  165. // CHECK:STDOUT: %.10: Core.IntLiteral = int_value 0 [template]
  166. // CHECK:STDOUT: %array: %.8 = tuple_value (%.3, %.5, %.6) [template]
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: imports {
  170. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  171. // CHECK:STDOUT: .Int = %import_ref.1
  172. // CHECK:STDOUT: .AsIntLiteral = %import_ref.2
  173. // CHECK:STDOUT: .TestAdd = %import_ref.3
  174. // CHECK:STDOUT: .AsI32 = %import_ref.4
  175. // CHECK:STDOUT: import Core//core
  176. // CHECK:STDOUT: }
  177. // CHECK:STDOUT: %import_ref.2: %AsIntLiteral.type = import_ref Core//core, inst+61, loaded [template = constants.%AsIntLiteral]
  178. // CHECK:STDOUT: %import_ref.3: %TestAdd.type = import_ref Core//core, inst+88, loaded [template = constants.%TestAdd]
  179. // CHECK:STDOUT: %import_ref.4: %AsI32.type = import_ref Core//core, inst+42, loaded [template = constants.%AsI32]
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT:
  182. // CHECK:STDOUT: file {
  183. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  184. // CHECK:STDOUT: .Core = imports.%Core
  185. // CHECK:STDOUT: .arr = %arr
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT: %Core.import = import Core
  188. // CHECK:STDOUT: %.loc4_11.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
  189. // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_11.1) [template = constants.%i32]
  190. // CHECK:STDOUT: %Core.ref.loc4_16: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  191. // CHECK:STDOUT: %AsIntLiteral.ref: %AsIntLiteral.type = name_ref AsIntLiteral, imports.%import_ref.2 [template = constants.%AsIntLiteral]
  192. // CHECK:STDOUT: %Core.ref.loc4_34: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  193. // CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.3 [template = constants.%TestAdd]
  194. // CHECK:STDOUT: %Core.ref.loc4_47: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  195. // CHECK:STDOUT: %AsI32.ref.loc4_51: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32]
  196. // CHECK:STDOUT: %.loc4_58: Core.IntLiteral = int_value 1 [template = constants.%.2]
  197. // CHECK:STDOUT: %int.convert_checked.loc4_57: init %i32 = call %AsI32.ref.loc4_51(%.loc4_58) [template = constants.%.3]
  198. // CHECK:STDOUT: %Core.ref.loc4_62: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  199. // CHECK:STDOUT: %AsI32.ref.loc4_66: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32]
  200. // CHECK:STDOUT: %.loc4_73: Core.IntLiteral = int_value 2 [template = constants.%.4]
  201. // CHECK:STDOUT: %int.convert_checked.loc4_72: init %i32 = call %AsI32.ref.loc4_66(%.loc4_73) [template = constants.%.5]
  202. // CHECK:STDOUT: %.loc4_57.1: %i32 = value_of_initializer %int.convert_checked.loc4_57 [template = constants.%.3]
  203. // CHECK:STDOUT: %.loc4_57.2: %i32 = converted %int.convert_checked.loc4_57, %.loc4_57.1 [template = constants.%.3]
  204. // CHECK:STDOUT: %.loc4_72.1: %i32 = value_of_initializer %int.convert_checked.loc4_72 [template = constants.%.5]
  205. // CHECK:STDOUT: %.loc4_72.2: %i32 = converted %int.convert_checked.loc4_72, %.loc4_72.1 [template = constants.%.5]
  206. // CHECK:STDOUT: %int.sadd: init %i32 = call %TestAdd.ref(%.loc4_57.2, %.loc4_72.2) [template = constants.%.6]
  207. // CHECK:STDOUT: %.loc4_46.1: %i32 = value_of_initializer %int.sadd [template = constants.%.6]
  208. // CHECK:STDOUT: %.loc4_46.2: %i32 = converted %int.sadd, %.loc4_46.1 [template = constants.%.6]
  209. // CHECK:STDOUT: %int.convert_checked.loc4_33: init Core.IntLiteral = call %AsIntLiteral.ref(%.loc4_46.2) [template = constants.%.7]
  210. // CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
  211. // CHECK:STDOUT: %.loc4_11.3: type = converted %int.make_type_signed, %.loc4_11.2 [template = constants.%i32]
  212. // CHECK:STDOUT: %.loc4_33.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc4_33 [template = constants.%.7]
  213. // CHECK:STDOUT: %.loc4_33.2: Core.IntLiteral = converted %int.convert_checked.loc4_33, %.loc4_33.1 [template = constants.%.7]
  214. // CHECK:STDOUT: %.loc4_77: type = array_type %.loc4_33.2, %i32 [template = constants.%.8]
  215. // CHECK:STDOUT: %arr.var: ref %.8 = var arr
  216. // CHECK:STDOUT: %arr: ref %.8 = bind_name arr, %arr.var
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: fn @Int(%N.param_patt: Core.IntLiteral) -> type = "int.make_type_signed";
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: fn @AsIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked";
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: fn @TestAdd(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd";
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: fn @AsI32(%a.param_patt: Core.IntLiteral) -> %i32 = "int.convert_checked";
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: fn @__global_init() {
  228. // CHECK:STDOUT: !entry:
  229. // CHECK:STDOUT: %Core.ref.loc4_82: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  230. // CHECK:STDOUT: %AsI32.ref.loc4_86: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32]
  231. // CHECK:STDOUT: %.loc4_93: Core.IntLiteral = int_value 1 [template = constants.%.2]
  232. // CHECK:STDOUT: %int.convert_checked.loc4_92: init %i32 = call %AsI32.ref.loc4_86(%.loc4_93) [template = constants.%.3]
  233. // CHECK:STDOUT: %Core.ref.loc4_97: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  234. // CHECK:STDOUT: %AsI32.ref.loc4_101: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32]
  235. // CHECK:STDOUT: %.loc4_108: Core.IntLiteral = int_value 2 [template = constants.%.4]
  236. // CHECK:STDOUT: %int.convert_checked.loc4_107: init %i32 = call %AsI32.ref.loc4_101(%.loc4_108) [template = constants.%.5]
  237. // CHECK:STDOUT: %Core.ref.loc4_112: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  238. // CHECK:STDOUT: %AsI32.ref.loc4_116: %AsI32.type = name_ref AsI32, imports.%import_ref.4 [template = constants.%AsI32]
  239. // CHECK:STDOUT: %.loc4_123: Core.IntLiteral = int_value 3 [template = constants.%.7]
  240. // CHECK:STDOUT: %int.convert_checked.loc4_122: init %i32 = call %AsI32.ref.loc4_116(%.loc4_123) [template = constants.%.6]
  241. // CHECK:STDOUT: %.loc4_125.1: %tuple.type = tuple_literal (%int.convert_checked.loc4_92, %int.convert_checked.loc4_107, %int.convert_checked.loc4_122)
  242. // CHECK:STDOUT: %.loc4_125.2: Core.IntLiteral = int_value 0 [template = constants.%.10]
  243. // CHECK:STDOUT: %.loc4_125.3: ref %i32 = array_index file.%arr.var, %.loc4_125.2
  244. // CHECK:STDOUT: %.loc4_125.4: init %i32 = initialize_from %int.convert_checked.loc4_92 to %.loc4_125.3 [template = constants.%.3]
  245. // CHECK:STDOUT: %.loc4_125.5: Core.IntLiteral = int_value 1 [template = constants.%.2]
  246. // CHECK:STDOUT: %.loc4_125.6: ref %i32 = array_index file.%arr.var, %.loc4_125.5
  247. // CHECK:STDOUT: %.loc4_125.7: init %i32 = initialize_from %int.convert_checked.loc4_107 to %.loc4_125.6 [template = constants.%.5]
  248. // CHECK:STDOUT: %.loc4_125.8: Core.IntLiteral = int_value 2 [template = constants.%.4]
  249. // CHECK:STDOUT: %.loc4_125.9: ref %i32 = array_index file.%arr.var, %.loc4_125.8
  250. // CHECK:STDOUT: %.loc4_125.10: init %i32 = initialize_from %int.convert_checked.loc4_122 to %.loc4_125.9 [template = constants.%.6]
  251. // CHECK:STDOUT: %.loc4_125.11: init %.8 = array_init (%.loc4_125.4, %.loc4_125.7, %.loc4_125.10) to file.%arr.var [template = constants.%array]
  252. // CHECK:STDOUT: %.loc4_126: init %.8 = converted %.loc4_125.1, %.loc4_125.11 [template = constants.%array]
  253. // CHECK:STDOUT: assign file.%arr.var, %.loc4_126
  254. // CHECK:STDOUT: return
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT: