init_dependent_bound.carbon 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/array/init_dependent_bound.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/init_dependent_bound.carbon
  12. // --- generic_empty.carbon
  13. library "[[@TEST_NAME]]";
  14. fn G(T:! type) {
  15. // We can initialize this without knowing T.
  16. //@dump-sem-ir-begin
  17. var arr: array(T, 0) = ();
  18. //@dump-sem-ir-end
  19. }
  20. class C {}
  21. fn H() {
  22. G(C);
  23. }
  24. // --- fail_init_dependent_bound.carbon
  25. library "[[@TEST_NAME]]";
  26. fn F(N:! i32) {
  27. // CHECK:STDERR: fail_init_dependent_bound.carbon:[[@LINE+4]]:28: error: cannot initialize array with dependent bound from a list of initializers [ArrayInitDependentBound]
  28. // CHECK:STDERR: var arr: array(i32, N) = (1, 2, 3);
  29. // CHECK:STDERR: ^~~~~~~~~
  30. // CHECK:STDERR:
  31. var arr: array(i32, N) = (1, 2, 3);
  32. }
  33. // --- fail_todo_init_template_dependent_bound.carbon
  34. library "[[@TEST_NAME]]";
  35. // TODO: This should be valid.
  36. fn G(template N:! i32) {
  37. //@dump-sem-ir-begin
  38. // CHECK:STDERR: fail_todo_init_template_dependent_bound.carbon:[[@LINE+4]]:12: error: cannot evaluate type expression [TypeExprEvaluationFailure]
  39. // CHECK:STDERR: var arr: array(i32, N) = (1, 2, 3);
  40. // CHECK:STDERR: ^~~~~~~~~~~~~
  41. // CHECK:STDERR:
  42. var arr: array(i32, N) = (1, 2, 3);
  43. //@dump-sem-ir-end
  44. }
  45. fn H() { G(3); }
  46. // CHECK:STDOUT: --- generic_empty.carbon
  47. // CHECK:STDOUT:
  48. // CHECK:STDOUT: constants {
  49. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  50. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  51. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  52. // CHECK:STDOUT: %array_type.281: type = array_type %int_0, %T [symbolic]
  53. // CHECK:STDOUT: %ptr.e06: type = ptr_type %array_type.281 [symbolic]
  54. // CHECK:STDOUT: %require_complete.b7f: <witness> = require_complete_type %array_type.281 [symbolic]
  55. // CHECK:STDOUT: %pattern_type.d48: type = pattern_type %array_type.281 [symbolic]
  56. // CHECK:STDOUT: %array.2ed: %array_type.281 = tuple_value () [symbolic]
  57. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  58. // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete]
  59. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  60. // CHECK:STDOUT: %DestroyT: %type_where = bind_symbolic_name DestroyT, 0 [symbolic]
  61. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%DestroyT) [symbolic]
  62. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.544: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d = struct_value () [symbolic]
  63. // CHECK:STDOUT: %facet_value.bf1: %type_where = facet_value %array_type.281, () [symbolic]
  64. // CHECK:STDOUT: %Destroy.impl_witness.5dc: <witness> = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.bf1) [symbolic]
  65. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.90e: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.bf1) [symbolic]
  66. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.84c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.90e = struct_value () [symbolic]
  67. // CHECK:STDOUT: %require_complete.662: <witness> = require_complete_type %ptr.e06 [symbolic]
  68. // CHECK:STDOUT: %Destroy.facet.b30: %Destroy.type = facet_value %array_type.281, (%Destroy.impl_witness.5dc) [symbolic]
  69. // CHECK:STDOUT: %.dc4: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.b30 [symbolic]
  70. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.9d2: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.84c, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.bf1) [symbolic]
  71. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  72. // CHECK:STDOUT: %array_type.6f1: type = array_type %int_0, %C [concrete]
  73. // CHECK:STDOUT: %ptr.cf4: type = ptr_type %array_type.6f1 [concrete]
  74. // CHECK:STDOUT: %complete_type.ed6: <witness> = complete_type_witness %array_type.6f1 [concrete]
  75. // CHECK:STDOUT: %pattern_type.9c8: type = pattern_type %array_type.6f1 [concrete]
  76. // CHECK:STDOUT: %array.2e5: %array_type.6f1 = tuple_value () [concrete]
  77. // CHECK:STDOUT: %facet_value.cba: %type_where = facet_value %array_type.6f1, () [concrete]
  78. // CHECK:STDOUT: %Destroy.impl_witness.f4d: <witness> = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.cba) [concrete]
  79. // CHECK:STDOUT: %Destroy.facet.84e: %Destroy.type = facet_value %array_type.6f1, (%Destroy.impl_witness.f4d) [concrete]
  80. // CHECK:STDOUT: %.d5d: type = fn_type_with_self_type %Destroy.Op.type, %Destroy.facet.84e [concrete]
  81. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ac2: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.cba) [concrete]
  82. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.155: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.ac2 = struct_value () [concrete]
  83. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.e21: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.155, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.cba) [concrete]
  84. // CHECK:STDOUT: %complete_type.3e1: <witness> = complete_type_witness %ptr.cf4 [concrete]
  85. // CHECK:STDOUT: }
  86. // CHECK:STDOUT:
  87. // CHECK:STDOUT: imports {
  88. // CHECK:STDOUT: %Core.import_ref.950: @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.b5d) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @DestroyT.binding.as_type.as.Destroy.impl.%DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.544)]
  89. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (%Core.import_ref.950), @DestroyT.binding.as_type.as.Destroy.impl [concrete]
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT:
  92. // CHECK:STDOUT: generic fn @G(%T.loc4_6.2: type) {
  93. // CHECK:STDOUT: <elided>
  94. // CHECK:STDOUT:
  95. // CHECK:STDOUT: !definition:
  96. // CHECK:STDOUT: %array_type.loc7_22.2: type = array_type constants.%int_0, %T.loc4_6.1 [symbolic = %array_type.loc7_22.2 (constants.%array_type.281)]
  97. // CHECK:STDOUT: %require_complete.loc7_22: <witness> = require_complete_type %array_type.loc7_22.2 [symbolic = %require_complete.loc7_22 (constants.%require_complete.b7f)]
  98. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_22.2 [symbolic = %pattern_type (constants.%pattern_type.d48)]
  99. // CHECK:STDOUT: %array: @G.%array_type.loc7_22.2 (%array_type.281) = tuple_value () [symbolic = %array (constants.%array.2ed)]
  100. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.loc7_22.2, () [symbolic = %facet_value (constants.%facet_value.bf1)]
  101. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness imports.%Destroy.impl_witness_table, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %Destroy.impl_witness (constants.%Destroy.impl_witness.5dc)]
  102. // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %array_type.loc7_22.2, (%Destroy.impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.b30)]
  103. // CHECK:STDOUT: %.loc7_3.2: type = fn_type_with_self_type constants.%Destroy.Op.type, %Destroy.facet [symbolic = %.loc7_3.2 (constants.%.dc4)]
  104. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.type (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.90e)]
  105. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op: @G.%DestroyT.binding.as_type.as.Destroy.impl.Op.type (%DestroyT.binding.as_type.as.Destroy.impl.Op.type.90e) = struct_value () [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.84c)]
  106. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.9d2)]
  107. // CHECK:STDOUT: %ptr: type = ptr_type %array_type.loc7_22.2 [symbolic = %ptr (constants.%ptr.e06)]
  108. // CHECK:STDOUT: %require_complete.loc7_3: <witness> = require_complete_type %ptr [symbolic = %require_complete.loc7_3 (constants.%require_complete.662)]
  109. // CHECK:STDOUT:
  110. // CHECK:STDOUT: fn() {
  111. // CHECK:STDOUT: !entry:
  112. // CHECK:STDOUT: name_binding_decl {
  113. // CHECK:STDOUT: %arr.patt: @G.%pattern_type (%pattern_type.d48) = binding_pattern arr [concrete]
  114. // CHECK:STDOUT: %arr.var_patt: @G.%pattern_type (%pattern_type.d48) = var_pattern %arr.patt [concrete]
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT: %arr.var: ref @G.%array_type.loc7_22.2 (%array_type.281) = var %arr.var_patt
  117. // CHECK:STDOUT: %.loc7_27.1: %empty_tuple.type = tuple_literal ()
  118. // CHECK:STDOUT: %.loc7_27.2: init @G.%array_type.loc7_22.2 (%array_type.281) = array_init () to %arr.var [symbolic = %array (constants.%array.2ed)]
  119. // CHECK:STDOUT: %.loc7_3.1: init @G.%array_type.loc7_22.2 (%array_type.281) = converted %.loc7_27.1, %.loc7_27.2 [symbolic = %array (constants.%array.2ed)]
  120. // CHECK:STDOUT: assign %arr.var, %.loc7_3.1
  121. // CHECK:STDOUT: %.loc7_22: type = splice_block %array_type.loc7_22.1 [symbolic = %array_type.loc7_22.2 (constants.%array_type.281)] {
  122. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)]
  123. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  124. // CHECK:STDOUT: %array_type.loc7_22.1: type = array_type %int_0, %T.ref [symbolic = %array_type.loc7_22.2 (constants.%array_type.281)]
  125. // CHECK:STDOUT: }
  126. // CHECK:STDOUT: %arr: ref @G.%array_type.loc7_22.2 (%array_type.281) = bind_name arr, %arr.var
  127. // CHECK:STDOUT: %impl.elem0: @G.%.loc7_3.2 (%.dc4) = impl_witness_access constants.%Destroy.impl_witness.5dc, element0 [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.84c)]
  128. // CHECK:STDOUT: %bound_method.loc7_3.1: <bound method> = bound_method %arr.var, %impl.elem0
  129. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.bf1) [symbolic = %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn (constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.9d2)]
  130. // CHECK:STDOUT: %bound_method.loc7_3.2: <bound method> = bound_method %arr.var, %specific_fn
  131. // CHECK:STDOUT: %addr: @G.%ptr (%ptr.e06) = addr_of %arr.var
  132. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%addr)
  133. // CHECK:STDOUT: <elided>
  134. // CHECK:STDOUT: }
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: specific @G(constants.%T) {
  138. // CHECK:STDOUT: %T.loc4_6.1 => constants.%T
  139. // CHECK:STDOUT: }
  140. // CHECK:STDOUT:
  141. // CHECK:STDOUT: specific @G(constants.%C) {
  142. // CHECK:STDOUT: %T.loc4_6.1 => constants.%C
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: !definition:
  145. // CHECK:STDOUT: %array_type.loc7_22.2 => constants.%array_type.6f1
  146. // CHECK:STDOUT: %require_complete.loc7_22 => constants.%complete_type.ed6
  147. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9c8
  148. // CHECK:STDOUT: %array => constants.%array.2e5
  149. // CHECK:STDOUT: %facet_value => constants.%facet_value.cba
  150. // CHECK:STDOUT: %Destroy.impl_witness => constants.%Destroy.impl_witness.f4d
  151. // CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.84e
  152. // CHECK:STDOUT: %.loc7_3.2 => constants.%.d5d
  153. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.type.ac2
  154. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.155
  155. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn => constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.e21
  156. // CHECK:STDOUT: %ptr => constants.%ptr.cf4
  157. // CHECK:STDOUT: %require_complete.loc7_3 => constants.%complete_type.3e1
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: --- fail_todo_init_template_dependent_bound.carbon
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: constants {
  163. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  164. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  165. // CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0, template [template]
  166. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  167. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  168. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  169. // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete]
  170. // CHECK:STDOUT: %ImplicitAs.type.7a9: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  171. // CHECK:STDOUT: %From: Core.IntLiteral = bind_symbolic_name From, 0 [symbolic]
  172. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.543: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic]
  173. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.c08: %Int.as.ImplicitAs.impl.Convert.type.543 = struct_value () [symbolic]
  174. // CHECK:STDOUT: %ImplicitAs.Convert.type.71e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
  175. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  176. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bf: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.e99, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  177. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.516: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  178. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.b09: %Int.as.ImplicitAs.impl.Convert.type.516 = struct_value () [concrete]
  179. // CHECK:STDOUT: %ImplicitAs.facet.1a1: %ImplicitAs.type.7a9 = facet_value %i32, (%ImplicitAs.impl_witness.6bf) [concrete]
  180. // CHECK:STDOUT: %.81e: type = fn_type_with_self_type %ImplicitAs.Convert.type.71e, %ImplicitAs.facet.1a1 [concrete]
  181. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_3.822, %Int.as.ImplicitAs.impl.Convert.b09 [concrete]
  182. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Int.as.ImplicitAs.impl.Convert.b09, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  183. // CHECK:STDOUT: %bound_method.e83: <bound method> = bound_method %int_3.822, %Int.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  184. // CHECK:STDOUT: %inst.splice_block: <instruction> = inst_value [concrete] {
  185. // CHECK:STDOUT: %.7f6: Core.IntLiteral = splice_block %.efe [concrete = %int_3.1ba] {
  186. // CHECK:STDOUT: %impl.elem0: %.81e = impl_witness_access %ImplicitAs.impl_witness.6bf, element0 [concrete = %Int.as.ImplicitAs.impl.Convert.b09]
  187. // CHECK:STDOUT: %bound_method.d9e: <bound method> = bound_method %int_3.822, %impl.elem0 [concrete = %Int.as.ImplicitAs.impl.Convert.bound]
  188. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete = %Int.as.ImplicitAs.impl.Convert.specific_fn]
  189. // CHECK:STDOUT: %bound_method.320: <bound method> = bound_method %int_3.822, %specific_fn [concrete = %bound_method.e83]
  190. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.320(%int_3.822) [concrete = %int_3.1ba]
  191. // CHECK:STDOUT: %.f92: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call [concrete = %int_3.1ba]
  192. // CHECK:STDOUT: %.efe: Core.IntLiteral = converted %int_3.822, %.f92 [concrete = %int_3.1ba]
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT:
  197. // CHECK:STDOUT: imports {
  198. // CHECK:STDOUT: %Core.import_ref.25c: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.543) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.c08)]
  199. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.e99 = impl_witness_table (%Core.import_ref.25c), @Int.as.ImplicitAs.impl [concrete]
  200. // CHECK:STDOUT: }
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: generic fn @G(%N.loc5_15.2: %i32) {
  203. // CHECK:STDOUT: <elided>
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: !definition:
  206. // CHECK:STDOUT: %.loc11_23.2: <instruction> = convert_to_value_action %N.ref, Core.IntLiteral [template]
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: fn() {
  209. // CHECK:STDOUT: !entry:
  210. // CHECK:STDOUT: name_binding_decl {
  211. // CHECK:STDOUT: %arr.patt: <error> = binding_pattern arr [concrete]
  212. // CHECK:STDOUT: %arr.var_patt: <error> = var_pattern %arr.patt [concrete]
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT: %arr.var: ref <error> = var %arr.var_patt [concrete = <error>]
  215. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  216. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  217. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  218. // CHECK:STDOUT: %.loc11_36: %tuple.type = tuple_literal (%int_1, %int_2, %int_3)
  219. // CHECK:STDOUT: assign %arr.var, <error>
  220. // CHECK:STDOUT: <elided>
  221. // CHECK:STDOUT: %arr: <error> = bind_name arr, <error> [concrete = <error>]
  222. // CHECK:STDOUT: <elided>
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT: specific @G(constants.%N.51e) {
  227. // CHECK:STDOUT: %N.loc5_15.1 => constants.%N.51e
  228. // CHECK:STDOUT: }
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: specific @G(constants.%int_3.822) {
  231. // CHECK:STDOUT: %N.loc5_15.1 => constants.%int_3.822
  232. // CHECK:STDOUT:
  233. // CHECK:STDOUT: !definition:
  234. // CHECK:STDOUT: %.loc11_23.2 => constants.%inst.splice_block
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT: