in_place_tuple_init.carbon 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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/tuple/in_place_tuple_init.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/in_place_tuple_init.carbon
  12. // --- in_place_tuple_init.carbon
  13. library "[[@TEST_NAME]]";
  14. fn F() -> (i32, i32);
  15. fn G() -> (i32, i32) {
  16. //@dump-sem-ir-begin
  17. var v: (i32, i32) = F();
  18. v = F();
  19. return F();
  20. //@dump-sem-ir-end
  21. }
  22. fn H() -> i32 {
  23. //@dump-sem-ir-begin
  24. return G().0;
  25. //@dump-sem-ir-end
  26. }
  27. // --- nested_tuple_in_place.carbon
  28. library "[[@TEST_NAME]]";
  29. fn F() -> (i32, i32, i32);
  30. fn G() {
  31. //@dump-sem-ir-begin
  32. var unused v: ((i32, i32, i32), (i32, i32, i32)) = (F(), F());
  33. //@dump-sem-ir-end
  34. }
  35. fn H() {
  36. //@dump-sem-ir-begin
  37. var unused v: (i32, (i32, i32, i32), i32) = (1, F(), 2);
  38. //@dump-sem-ir-end
  39. }
  40. // CHECK:STDOUT: --- in_place_tuple_init.carbon
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: constants {
  43. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  44. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  45. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  46. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  47. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
  48. // CHECK:STDOUT: %tuple.95a: %tuple.type.24b = tuple_value (%i32, %i32) [concrete]
  49. // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
  50. // CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
  51. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  52. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  53. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  54. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  55. // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete]
  56. // CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete]
  57. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  58. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  59. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
  60. // CHECK:STDOUT: %Int.as.Copy.impl.Op.9b9: %Int.as.Copy.impl.Op.type.824 = struct_value () [symbolic]
  61. // CHECK:STDOUT: %Copy.impl_witness.f17: <witness> = impl_witness imports.%Copy.impl_witness_table.e76, @Int.as.Copy.impl(%int_32) [concrete]
  62. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.546: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
  63. // CHECK:STDOUT: %Int.as.Copy.impl.Op.664: %Int.as.Copy.impl.Op.type.546 = struct_value () [concrete]
  64. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.f17) [concrete]
  65. // CHECK:STDOUT: %Copy.WithSelf.Op.type.081: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
  66. // CHECK:STDOUT: %.8e2: type = fn_type_with_self_type %Copy.WithSelf.Op.type.081, %Copy.facet [concrete]
  67. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete]
  68. // CHECK:STDOUT: }
  69. // CHECK:STDOUT:
  70. // CHECK:STDOUT: imports {
  71. // CHECK:STDOUT: %Core.import_ref.18d: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.824) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.9b9)]
  72. // CHECK:STDOUT: %Copy.impl_witness_table.e76 = impl_witness_table (%Core.import_ref.18d), @Int.as.Copy.impl [concrete]
  73. // CHECK:STDOUT: }
  74. // CHECK:STDOUT:
  75. // CHECK:STDOUT: fn @G() -> out %return.param: %tuple.type.d07 {
  76. // CHECK:STDOUT: !entry:
  77. // CHECK:STDOUT: name_binding_decl {
  78. // CHECK:STDOUT: %v.patt: %pattern_type.511 = ref_binding_pattern v [concrete]
  79. // CHECK:STDOUT: %v.var_patt: %pattern_type.511 = var_pattern %v.patt [concrete]
  80. // CHECK:STDOUT: }
  81. // CHECK:STDOUT: %v.var: ref %tuple.type.d07 = var %v.var_patt
  82. // CHECK:STDOUT: %F.ref.loc7: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  83. // CHECK:STDOUT: %.loc7_3: ref %tuple.type.d07 = splice_block %v.var {}
  84. // CHECK:STDOUT: %F.call.loc7: init %tuple.type.d07 to %.loc7_3 = call %F.ref.loc7()
  85. // CHECK:STDOUT: assign %v.var, %F.call.loc7
  86. // CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%tuple.type.d07] {
  87. // CHECK:STDOUT: %i32.loc7_11: type = type_literal constants.%i32 [concrete = constants.%i32]
  88. // CHECK:STDOUT: %i32.loc7_16: type = type_literal constants.%i32 [concrete = constants.%i32]
  89. // CHECK:STDOUT: %.loc7_19.2: %tuple.type.24b = tuple_literal (%i32.loc7_11, %i32.loc7_16) [concrete = constants.%tuple.95a]
  90. // CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
  91. // CHECK:STDOUT: }
  92. // CHECK:STDOUT: %v: ref %tuple.type.d07 = ref_binding v, %v.var
  93. // CHECK:STDOUT: %v.ref: ref %tuple.type.d07 = name_ref v, %v
  94. // CHECK:STDOUT: %F.ref.loc8: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  95. // CHECK:STDOUT: %.loc8: ref %tuple.type.d07 = splice_block %v.ref {}
  96. // CHECK:STDOUT: %F.call.loc8: init %tuple.type.d07 to %.loc8 = call %F.ref.loc8()
  97. // CHECK:STDOUT: assign %v.ref, %F.call.loc8
  98. // CHECK:STDOUT: %F.ref.loc9: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  99. // CHECK:STDOUT: <elided>
  100. // CHECK:STDOUT: %F.call.loc9: init %tuple.type.d07 to %.loc5_20.1 = call %F.ref.loc9()
  101. // CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %v.var, constants.%Destroy.Op
  102. // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var)
  103. // CHECK:STDOUT: return %F.call.loc9 to %return.param
  104. // CHECK:STDOUT: }
  105. // CHECK:STDOUT:
  106. // CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %tuple.type.d07) = "no_op";
  107. // CHECK:STDOUT:
  108. // CHECK:STDOUT: fn @H() -> out %return.param: %i32 {
  109. // CHECK:STDOUT: !entry:
  110. // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
  111. // CHECK:STDOUT: %.loc15_12.1: ref %tuple.type.d07 = temporary_storage
  112. // CHECK:STDOUT: %G.call: init %tuple.type.d07 to %.loc15_12.1 = call %G.ref()
  113. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  114. // CHECK:STDOUT: %.loc15_12.2: ref %tuple.type.d07 = temporary %.loc15_12.1, %G.call
  115. // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc15_12.2, element0
  116. // CHECK:STDOUT: %.loc15_13: %i32 = acquire_value %tuple.elem0
  117. // CHECK:STDOUT: %impl.elem0: %.8e2 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664]
  118. // CHECK:STDOUT: %bound_method.loc15_13.1: <bound method> = bound_method %.loc15_13, %impl.elem0
  119. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  120. // CHECK:STDOUT: %bound_method.loc15_13.2: <bound method> = bound_method %.loc15_13, %specific_fn
  121. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc15_13.2(%.loc15_13)
  122. // CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc15_12.2, constants.%Destroy.Op
  123. // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc15_12.2)
  124. // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
  125. // CHECK:STDOUT: }
  126. // CHECK:STDOUT:
  127. // CHECK:STDOUT: --- nested_tuple_in_place.carbon
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: constants {
  130. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  131. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  132. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  133. // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete]
  134. // CHECK:STDOUT: %tuple.e64: %tuple.type.ff9 = tuple_value (%i32, %i32, %i32) [concrete]
  135. // CHECK:STDOUT: %tuple.type.189: type = tuple_type (%i32, %i32, %i32) [concrete]
  136. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  137. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  138. // CHECK:STDOUT: %tuple.type.f9f: type = tuple_type (%tuple.type.ff9, %tuple.type.ff9) [concrete]
  139. // CHECK:STDOUT: %tuple.9e5: %tuple.type.f9f = tuple_value (%tuple.e64, %tuple.e64) [concrete]
  140. // CHECK:STDOUT: %tuple.type.99b: type = tuple_type (%tuple.type.189, %tuple.type.189) [concrete]
  141. // CHECK:STDOUT: %pattern_type.d88: type = pattern_type %tuple.type.99b [concrete]
  142. // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc7 [concrete]
  143. // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete]
  144. // CHECK:STDOUT: %tuple.type.3a3: type = tuple_type (type, %tuple.type.ff9, type) [concrete]
  145. // CHECK:STDOUT: %tuple.5fc: %tuple.type.3a3 = tuple_value (%i32, %tuple.e64, %i32) [concrete]
  146. // CHECK:STDOUT: %tuple.type.516: type = tuple_type (%i32, %tuple.type.189, %i32) [concrete]
  147. // CHECK:STDOUT: %pattern_type.6b5: type = pattern_type %tuple.type.516 [concrete]
  148. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  149. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  150. // CHECK:STDOUT: %tuple.type.667: type = tuple_type (Core.IntLiteral, %tuple.type.189, Core.IntLiteral) [concrete]
  151. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  152. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  153. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  154. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  155. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  156. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  157. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  158. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  159. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  160. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  161. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  162. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  163. // CHECK:STDOUT: %bound_method.38b: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  164. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  165. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  166. // CHECK:STDOUT: %bound_method.646: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  167. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  168. // CHECK:STDOUT: %Destroy.Op.type.bae255.2: type = fn_type @Destroy.Op.loc13 [concrete]
  169. // CHECK:STDOUT: %Destroy.Op.651ba6.2: %Destroy.Op.type.bae255.2 = struct_value () [concrete]
  170. // CHECK:STDOUT: }
  171. // CHECK:STDOUT:
  172. // CHECK:STDOUT: imports {
  173. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  174. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  175. // CHECK:STDOUT: }
  176. // CHECK:STDOUT:
  177. // CHECK:STDOUT: fn @G() {
  178. // CHECK:STDOUT: !entry:
  179. // CHECK:STDOUT: name_binding_decl {
  180. // CHECK:STDOUT: %v.patt: %pattern_type.d88 = ref_binding_pattern v [concrete]
  181. // CHECK:STDOUT: %v.var_patt: %pattern_type.d88 = var_pattern %v.patt [concrete]
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT: %v.var: ref %tuple.type.99b = var %v.var_patt
  184. // CHECK:STDOUT: %F.ref.loc7_55: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  185. // CHECK:STDOUT: %tuple.elem0: ref %tuple.type.189 = tuple_access %v.var, element0
  186. // CHECK:STDOUT: %F.call.loc7_57: init %tuple.type.189 to %tuple.elem0 = call %F.ref.loc7_55()
  187. // CHECK:STDOUT: %F.ref.loc7_60: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  188. // CHECK:STDOUT: %tuple.elem1: ref %tuple.type.189 = tuple_access %v.var, element1
  189. // CHECK:STDOUT: %F.call.loc7_62: init %tuple.type.189 to %tuple.elem1 = call %F.ref.loc7_60()
  190. // CHECK:STDOUT: %.loc7_63.1: %tuple.type.99b = tuple_literal (%F.call.loc7_57, %F.call.loc7_62)
  191. // CHECK:STDOUT: %.loc7_63.2: init %tuple.type.99b to %v.var = tuple_init (%F.call.loc7_57, %F.call.loc7_62)
  192. // CHECK:STDOUT: %.loc7_3: init %tuple.type.99b = converted %.loc7_63.1, %.loc7_63.2
  193. // CHECK:STDOUT: assign %v.var, %.loc7_3
  194. // CHECK:STDOUT: %.loc7_50.1: type = splice_block %.loc7_50.5 [concrete = constants.%tuple.type.99b] {
  195. // CHECK:STDOUT: %i32.loc7_19: type = type_literal constants.%i32 [concrete = constants.%i32]
  196. // CHECK:STDOUT: %i32.loc7_24: type = type_literal constants.%i32 [concrete = constants.%i32]
  197. // CHECK:STDOUT: %i32.loc7_29: type = type_literal constants.%i32 [concrete = constants.%i32]
  198. // CHECK:STDOUT: %.loc7_32: %tuple.type.ff9 = tuple_literal (%i32.loc7_19, %i32.loc7_24, %i32.loc7_29) [concrete = constants.%tuple.e64]
  199. // CHECK:STDOUT: %i32.loc7_36: type = type_literal constants.%i32 [concrete = constants.%i32]
  200. // CHECK:STDOUT: %i32.loc7_41: type = type_literal constants.%i32 [concrete = constants.%i32]
  201. // CHECK:STDOUT: %i32.loc7_46: type = type_literal constants.%i32 [concrete = constants.%i32]
  202. // CHECK:STDOUT: %.loc7_49: %tuple.type.ff9 = tuple_literal (%i32.loc7_36, %i32.loc7_41, %i32.loc7_46) [concrete = constants.%tuple.e64]
  203. // CHECK:STDOUT: %.loc7_50.2: %tuple.type.f9f = tuple_literal (%.loc7_32, %.loc7_49) [concrete = constants.%tuple.9e5]
  204. // CHECK:STDOUT: %.loc7_50.3: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
  205. // CHECK:STDOUT: %.loc7_50.4: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
  206. // CHECK:STDOUT: %.loc7_50.5: type = converted %.loc7_50.2, constants.%tuple.type.99b [concrete = constants.%tuple.type.99b]
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT: %v: ref %tuple.type.99b = ref_binding v, %v.var
  209. // CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %v.var, constants.%Destroy.Op.651ba6.1
  210. // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var)
  211. // CHECK:STDOUT: <elided>
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT:
  214. // CHECK:STDOUT: fn @Destroy.Op.loc7(%self.param: ref %tuple.type.99b) = "no_op";
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: fn @H() {
  217. // CHECK:STDOUT: !entry:
  218. // CHECK:STDOUT: name_binding_decl {
  219. // CHECK:STDOUT: %v.patt: %pattern_type.6b5 = ref_binding_pattern v [concrete]
  220. // CHECK:STDOUT: %v.var_patt: %pattern_type.6b5 = var_pattern %v.patt [concrete]
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT: %v.var: ref %tuple.type.516 = var %v.var_patt
  223. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  224. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  225. // CHECK:STDOUT: %tuple.elem1: ref %tuple.type.189 = tuple_access %v.var, element1
  226. // CHECK:STDOUT: %F.call: init %tuple.type.189 to %tuple.elem1 = call %F.ref()
  227. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  228. // CHECK:STDOUT: %.loc13_57.1: %tuple.type.667 = tuple_literal (%int_1, %F.call, %int_2)
  229. // CHECK:STDOUT: %impl.elem0.loc13_57.1: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  230. // CHECK:STDOUT: %bound_method.loc13_57.1: <bound method> = bound_method %int_1, %impl.elem0.loc13_57.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  231. // CHECK:STDOUT: %specific_fn.loc13_57.1: <specific function> = specific_function %impl.elem0.loc13_57.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  232. // CHECK:STDOUT: %bound_method.loc13_57.2: <bound method> = bound_method %int_1, %specific_fn.loc13_57.1 [concrete = constants.%bound_method.38b]
  233. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_57.1: init %i32 = call %bound_method.loc13_57.2(%int_1) [concrete = constants.%int_1.5d2]
  234. // CHECK:STDOUT: %.loc13_57.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_57.1 [concrete = constants.%int_1.5d2]
  235. // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0
  236. // CHECK:STDOUT: %.loc13_57.3: init %i32 to %tuple.elem0 = in_place_init %.loc13_57.2 [concrete = constants.%int_1.5d2]
  237. // CHECK:STDOUT: %impl.elem0.loc13_57.2: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  238. // CHECK:STDOUT: %bound_method.loc13_57.3: <bound method> = bound_method %int_2, %impl.elem0.loc13_57.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  239. // CHECK:STDOUT: %specific_fn.loc13_57.2: <specific function> = specific_function %impl.elem0.loc13_57.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  240. // CHECK:STDOUT: %bound_method.loc13_57.4: <bound method> = bound_method %int_2, %specific_fn.loc13_57.2 [concrete = constants.%bound_method.646]
  241. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_57.2: init %i32 = call %bound_method.loc13_57.4(%int_2) [concrete = constants.%int_2.ef8]
  242. // CHECK:STDOUT: %.loc13_57.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_57.2 [concrete = constants.%int_2.ef8]
  243. // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2
  244. // CHECK:STDOUT: %.loc13_57.5: init %i32 to %tuple.elem2 = in_place_init %.loc13_57.4 [concrete = constants.%int_2.ef8]
  245. // CHECK:STDOUT: %.loc13_57.6: init %tuple.type.516 to %v.var = tuple_init (%.loc13_57.3, %F.call, %.loc13_57.5)
  246. // CHECK:STDOUT: %.loc13_3: init %tuple.type.516 = converted %.loc13_57.1, %.loc13_57.6
  247. // CHECK:STDOUT: assign %v.var, %.loc13_3
  248. // CHECK:STDOUT: %.loc13_43.1: type = splice_block %.loc13_43.4 [concrete = constants.%tuple.type.516] {
  249. // CHECK:STDOUT: %i32.loc13_18: type = type_literal constants.%i32 [concrete = constants.%i32]
  250. // CHECK:STDOUT: %i32.loc13_24: type = type_literal constants.%i32 [concrete = constants.%i32]
  251. // CHECK:STDOUT: %i32.loc13_29: type = type_literal constants.%i32 [concrete = constants.%i32]
  252. // CHECK:STDOUT: %i32.loc13_34: type = type_literal constants.%i32 [concrete = constants.%i32]
  253. // CHECK:STDOUT: %.loc13_37: %tuple.type.ff9 = tuple_literal (%i32.loc13_24, %i32.loc13_29, %i32.loc13_34) [concrete = constants.%tuple.e64]
  254. // CHECK:STDOUT: %i32.loc13_40: type = type_literal constants.%i32 [concrete = constants.%i32]
  255. // CHECK:STDOUT: %.loc13_43.2: %tuple.type.3a3 = tuple_literal (%i32.loc13_18, %.loc13_37, %i32.loc13_40) [concrete = constants.%tuple.5fc]
  256. // CHECK:STDOUT: %.loc13_43.3: type = converted constants.%tuple.e64, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
  257. // CHECK:STDOUT: %.loc13_43.4: type = converted %.loc13_43.2, constants.%tuple.type.516 [concrete = constants.%tuple.type.516]
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT: %v: ref %tuple.type.516 = ref_binding v, %v.var
  260. // CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %v.var, constants.%Destroy.Op.651ba6.2
  261. // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%v.var)
  262. // CHECK:STDOUT: <elided>
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: fn @Destroy.Op.loc13(%self.param: ref %tuple.type.516) = "no_op";
  266. // CHECK:STDOUT: